New Sale Transaction With Bundled Products

Understand the required values and key considerations before you create a billing schedule for a new sale transaction with bundled products.

Considerations 

Keep these important considerations in mind when you provide the details for new sale transactions with bundled products.

  • The BillingActionType__std value for any new sale transaction must be Add.

  • For new sale transactions with bundled products, the MainTransactionId__std value is required for all the child transactions.

  • If you don’t provide the TaxTreatmentId__std value, the BillingTreatmentId__std value, or the LegalEntityId__std value for the transaction, the default TaxTreatmentId, BillingTreatmentId, and LegalEntityId of your Salesforce org is considered. If your org doesn’t have any default values, an error occurs.

  • If your transaction is for an sObject record, only specify the record ID as the id value in the transactionDetails property value. All the other transaction details are automatically fetched from the sObject record if those details are mapped in the context definition.

  • To understand the requirements for the various selling model types, see these resources.

JSON Example 

This sample is for a new sale transaction for bundled products with two levels of nesting and with these selling model types.

  • The main root product’s selling model type is OneTime.
  • The second root product’s selling model type is OneTime.
  • The child products’ selling model types are TermDefined and Evergreen.
1{
2  "Transaction": [
3    {
4      "id": "sample1",
5      "SellingModelType__std": "OneTime",
6      "ParentTransactionId__std": "sample",
7      "TransactionId__std": "sample1",
8      "ProductName__std": "OneTimeProduct",
9      "StartDate__std": "2025-02-20",
10      "UnitPrice__std": 10,
11      "Quantity__std": 1,
12      "TotalPrice__std": 10,
13      "TaxTreatmentId__std": "1ttLT000000EV7DYAW",
14      "BillingTreatmentId__std": "1BTLT00000008yT4AQ",
15      "AccountId__std": "001LT00000dPVrlYAG",
16      "BillToContactId__std": "003LT0000038bALYAY",
17      "BillingCity__std": "HYD",
18      "ShippingCity__std": "VSKP",
19      "BillingActionType__std": "Add",
20      "CurrencyIsoCode__std": "USD"
21    },
22    {
23      "id": "sample2",
24      "SellingModelType__std": "OneTime",
25      "ParentTransactionId__std": "abc",
26      "TransactionId__std": "sample2",
27      "ProductName__std": "OneTimeProduct",
28      "StartDate__std": "2025-02-20",
29      "UnitPrice__std": 10,
30      "Quantity__std": 1,
31      "TotalPrice__std": 10,
32      "TaxTreatmentId__std": "1ttLT000000EV7DYAW",
33      "BillingTreatmentId__std": "1BTLT00000008yT4AQ",
34      "AccountId__std": "001LT00000dPVrlYAG",
35      "BillToContactId__std": "003LT0000038bALYAY",
36      "BillingActionType__std": "Add",
37      "CurrencyIsoCode__std": "USD",
38      "BillingCity__std": "HYD",
39      "ShippingCity__std": "VSKP",
40      "AssociatedTransactionPricing__std": "IncludedInBundlePrice",
41      "MainTransactionRole__std": "Bundle",
42      "AssociatedTransactionRole__std": "BundleComponent",
43      "MainTransactionId__std": "sample1"
44    },
45    {
46      "id": "sample3",
47      "SellingModelType__std": "TermDefined",
48      "ParentTransactionId__std": "sample",
49      "TransactionId__std": "sample3",
50      "ProductName__std": "TermedQuarterlyProduct",
51      "StartDate__std": "2025-01-01",
52      "EndDate__std": "2025-12-31",
53      "PeriodBoundary__std": "DayOfPeriod",
54      "BillingDayOfMonth__std": 1,
55      "BillingStartMonth__std": 2,
56      "UnitPrice__std": 10,
57      "Quantity__std": 1,
58      "TotalPrice__std": 120,
59      "TaxTreatmentId__std": "1ttLT000000EV7DYAW",
60      "BillingTreatmentId__std": "1BTLT00000008yT4AQ",
61      "AccountId__std": "001LT00000dPVrlYAG",
62      "BillToContactId__std": "003LT0000038bALYAY",
63      "BillingTermUnit__std": "Quarter",
64      "BillingActionType__std": "Add",
65      "CurrencyIsoCode__std": "USD",
66      "BillingCity__std": "HYD",
67      "ShippingCity__std": "VSKP",
68      "AssociatedTransactionPricing__std": "IncludedInBundlePrice",
69      "MainTransactionRole__std": "Bundle",
70      "AssociatedTransactionRole__std": "BundleComponent",
71      "MainTransactionId__std": "sample2"
72    },
73    {
74      "id": "sample4",
75      "SellingModelType__std": "Evergreen",
76      "ParentTransactionId__std": "sample",
77      "TransactionId__std": "sample4",
78      "ProductName__std": "EvergreenSemiAnnualProduct",
79      "StartDate__std": "2025-01-01",
80      "PeriodBoundary__std": "DayOfPeriod",
81      "BillingDayOfMonth__std": 1,
82      "BillingStartMonth__std": 3,
83      "UnitPrice__std": 10,
84      "Quantity__std": 1,
85      "TotalPrice__std": 10,
86      "TaxTreatmentId__std": "1ttLT000000EV7DYAW",
87      "BillingTreatmentId__std": "1BTLT00000008yT4AQ",
88      "AccountId__std": "001LT00000dPVrlYAG",
89      "BillToContactId__std": "003LT0000038bALYAY",
90      "BillingTermUnit__std": "Semi-Annual",
91      "BillingActionType__std": "Add",
92      "BillingPostalCode__std": "94105",
93      "CurrencyIsoCode__std": "USD",
94      "BillingCity__std": "HYD",
95      "ShippingCity__std": "VSKP",
96      "AssociatedTransactionPricing__std": "IncludedInBundlePrice",
97      "MainTransactionRole__std": "Bundle",
98      "AssociatedTransactionRole__std": "BundleComponent",
99      "MainTransactionId__std": "sample2"
100    }
101  ]
102}

This example shows the request payload to create a billing schedule for a new sale transaction for bundled products.

1{
2  "transactionDetails": "{\"Transaction\":[{\"id\":\"sample1\",\"SellingModelType__std\":\"OneTime\",\"ParentTransactionId__std\":\"sample\",\"TransactionId__std\":\"sample1\",\"ProductName__std\":\"OneTimeProduct\",\"StartDate__std\":\"2025-02-20\",\"UnitPrice__std\":10,\"Quantity__std\":1,\"TotalPrice__std\":10,\"TaxTreatmentId__std\":\"1ttLT000000EV7DYAW\",\"BillingTreatmentId__std\":\"1BTLT00000008yT4AQ\",\"AccountId__std\":\"001LT00000dPVrlYAG\",\"BillToContactId__std\":\"003LT0000038bALYAY\",\"BillingCity__std\":\"HYD\",\"ShippingCity__std\":\"VSKP\",\"BillingActionType__std\":\"Add\",\"CurrencyIsoCode__std\":\"USD\"},{\"id\":\"sample2\",\"SellingModelType__std\":\"OneTime\",\"ParentTransactionId__std\":\"abc\",\"TransactionId__std\":\"sample2\",\"ProductName__std\":\"OneTimeProduct\",\"StartDate__std\":\"2025-02-20\",\"UnitPrice__std\":10,\"Quantity__std\":1,\"TotalPrice__std\":10,\"TaxTreatmentId__std\":\"1ttLT000000EV7DYAW\",\"BillingTreatmentId__std\":\"1BTLT00000008yT4AQ\",\"AccountId__std\":\"001LT00000dPVrlYAG\",\"BillToContactId__std\":\"003LT0000038bALYAY\",\"BillingActionType__std\":\"Add\",\"CurrencyIsoCode__std\":\"USD\",\"BillingCity__std\":\"HYD\",\"ShippingCity__std\":\"VSKP\",\"AssociatedTransactionPricing__std\":\"IncludedInBundlePrice\",\"MainTransactionRole__std\":\"Bundle\",\"AssociatedTransactionRole__std\":\"BundleComponent\",\"MainTransactionId__std\":\"sample1\"},{\"id\":\"sample3\",\"SellingModelType__std\":\"TermDefined\",\"ParentTransactionId__std\":\"sample\",\"TransactionId__std\":\"sample3\",\"ProductName__std\":\"TermedQuarterlyProduct\",\"StartDate__std\":\"2025-01-01\",\"EndDate__std\":\"2025-12-31\",\"PeriodBoundary__std\":\"DayOfPeriod\",\"BillingDayOfMonth__std\":1,\"BillingStartMonth__std\":2,\"UnitPrice__std\":10,\"Quantity__std\":1,\"TotalPrice__std\":120,\"TaxTreatmentId__std\":\"1ttLT000000EV7DYAW\",\"BillingTreatmentId__std\":\"1BTLT00000008yT4AQ\",\"AccountId__std\":\"001LT00000dPVrlYAG\",\"BillToContactId__std\":\"003LT0000038bALYAY\",\"BillingTermUnit__std\":\"Quarter\",\"BillingActionType__std\":\"Add\",\"CurrencyIsoCode__std\":\"USD\",\"BillingCity__std\":\"HYD\",\"ShippingCity__std\":\"VSKP\",\"AssociatedTransactionPricing__std\":\"IncludedInBundlePrice\",\"MainTransactionRole__std\":\"Bundle\",\"AssociatedTransactionRole__std\":\"BundleComponent\",\"MainTransactionId__std\":\"sample2\"},{\"id\":\"sample4\",\"SellingModelType__std\":\"Evergreen\",\"ParentTransactionId__std\":\"sample\",\"TransactionId__std\":\"sample4\",\"ProductName__std\":\"EvergreenSemiAnnualProduct\",\"StartDate__std\":\"2025-01-01\",\"PeriodBoundary__std\":\"DayOfPeriod__std\",\"BillingDayOfMonth__std\":1,\"BillingStartMonth__std\":3,\"UnitPrice__std\":10,\"Quantity__std\":1,\"TotalPrice__std\":10,\"TaxTreatmentId__std\":\"1ttLT000000EV7DYAW\",\"BillingTreatmentId__std\":\"1BTLT00000008yT4AQ\",\"AccountId__std\":\"001LT00000dPVrlYAG\",\"BillToContactId__std\":\"003LT0000038bALYAY\",\"BillingTermUnit__std\":\"Semi-Annual\",\"BillingActionType__std\":\"Add\",\"BillingPostalCode__std\":\"94105\",\"CurrencyIsoCode__std\":\"USD\",\"BillingCity__std\":\"HYD\",\"ShippingCity__std\":\"VSKP\",\"AssociatedTransactionPricing__std\":\"IncludedInBundlePrice\",\"MainTransactionRole__std\":\"Bundle\",\"AssociatedTransactionRole__std\":\"BundleComponent\",\"MainTransactionId__std\":\"sample2\"}]}",
3  "transactionContextDetails": {
4    "contextDefinitionName": "StandaloneBillingContext__stdctx",
5    "intraContextCustomMappingName": "CustomContextMapping",
6    "readContextMappingName": "TransactionMapping",
7    "saveContextMappingName": "BSGEntitiesMapping"
8  }
9}

When you’re creating a billing schedule for a new sale transaction with bundled products, make sure that you specify the mandatory values in the transactionDetails property value.

Context Tag in the Transaction Node of the StandaloneBillingContext Context DefinitionDescriptionMapped FieldRequired or Optional
BillToContactId__stdThe ID of the Contact record that’s related to the transaction.BillToContactId field on the BillingScheduleGroup objectRequired
ParentTransactionId__stdThe ID of the parent transaction record. For example, if the transaction is at a level similar to that of an Order Item record, the parent transaction will be at a level similar to that of an Order record.If the transaction is a child Order or Quote record, the ReferenceEntityId field on the BillingScheduleobject is populated. For other sObject records or external records, the Reference field on the BillingSchedule object is populated.Optional
AccountId__stdThe ID of the Account record that’s related to the transaction.BillingAccountId field on the BillingScheduleGroup objectRequired
BillingCity__stdThe city in the billing address of the transaction.BillingCity field on the BillingScheduleGroup objectAny one of the billing address fields is required.
BillingPostalCode__stdThe postal code in the billing address of the transaction.BillingPostalCode field on the BillingScheduleGroup objectAny one of the billing address fields is required.
ShippingCity__stdThe city in the shipping address of the transaction.ShippingCity field on the BillingScheduleGroup objectAny one of the shipping address fields is required.
SellingModelType__stdThe selling model type indicates whether the transaction is for a one-time product, a term-defined product, or an evergreen product. Specify OneTime as the SellingModelType for the transaction that’s related to a product that’s sold once.BillingMethod on the BillingSchedule object is populated as OrderAmount.Required
TransactionId__stdThe ID of the transaction that you want to create a billing schedule for.If the transaction is an OrderItem, OrderItemAdjustmentLineItem, OrderItemDetail, QuoteLineDetail, or QuoteLineItem record, the ReferenceEntityItemId field on the BillingScheduleobject is populated. For other sObject records or external records, the ReferenceItem field on the BillingSchedule object is populated.Required
ProductName__stdThe name of the product that’s related to the transaction that you want to create a billing schedule for.ProductName field on the BillingScheduleGroup objectEither the ProductName or the ProductId value is required
PeriodBoundary__stdThe period boundary determines the start and end date of the billing period. Valid values are AlignToCalendar, Anniversary, DayOfPeriod, or LastDayOfPeriod.PeriodBoundary field on the BillingScheduleGroup objectRequired for child products with the TermDefined or Evergreen selling model types.
BillingDayOfMonth__stdThe day of the month on which a recurring billing process is scheduled to occur for the transaction.BillDayOfMonth field on the BillingScheduleGroup objectRequired for child products with the TermDefined or Evergreen selling model types.
BillingStartMonth__stdThe month when billing begins for an annual subscription. This value can be any number from 1 through 12. For example, if billing starts in January, the value is 1. If billing starts in June, the value is 6.BillingStartMonth field on the BillingScheduleGroup objectRequired for child products with the Evergreen selling model type.
EndDate__stdThe end date of the transaction.BillingScheduleEndDate field on the BillingSchedule objectRequired for child products with the TermDefined selling model type.
StartDate__stdThe start date of the transaction.BillingScheduleStartDate field on the BillingSchedule objectRequired
Quantity__stdThe quantity of the transaction.Quantity field on the BillingSchedule objectRequired
TaxTreatmentId__stdThe ID of the tax treatment that’s used to calculate tax for the transaction. If you don’t specify a TaxTreatmentId, the org-default TaxTreatmentId is considered.TaxTreatmentId field on the BillingScheduleGroup objectRequired
BillingTermUnit__stdThe unit of measurement of the billing term. Valid values are Month, Quarter, Semi-Annual, or Year.BillingTermUnit field on the BillingSchedule objectRequired for child products with the TermDefined or Evergreen selling model types.
BillingTreatmentId__stdThe ID of the billing treatment that’s used to create the billing schedule for the transaction. If you don’t specify a BillingTreatmentId, the org-default BillingTreatmentId is considered.BillingTreatmentId field on the BillingScheduleGroup objectRequired
CurrencyIsoCode__stdThe currency code of the transaction amount if your Salesforce org has multi-currency enabled.CurrencyIsoCode field on the BillingScheduleGroup objectRequired for Salesforce orgs with multiple currencies enabled.
BillingActionType__stdThe action that you want to perform for the transaction. Valid value is Add.Category field on the BillingSchedule object is populated as Original.Required
UnitPrice__stdThe unit price of the transaction.UnitPrice field on the BillingSchedule objectEither the UnitPrice or the NetUnitPrice value is required
TotalPrice__stdThe total price of the transaction.TotalAmount field on the BillingSchedule objectRequired
MainTransactionId__stdWhen your transaction is part of a bundle, this value is the ID of the main transaction record for all the child transactions.MainBsgId field on the BsgRelationship objectRequired for all the child products.
MainTransactionRole__stdWhen your transaction is part of a bundle, this value is the role of the primary transaction in the bundle relationship. Valid values are AddOn, Bundle, or Set.MainBsgRole field on the BsgRelationship objectRequired for all the child products.
AssociatedTransactionRole__stdWhen your transaction is part of a bundle, this value is the role of the child transaction in the bundle relationship. Valid values are BundleComponent or ClassificationComponent.AssociatedBsgRole field on the BsgRelationship objectRequired for all the child products.
AssociatedTransactionPricing__stdWhen your transaction is part of a bundle, this value describes how the child transaction is priced in relation to the primary transaction. Valid values are IncludedInBundlePrice or NotIncludedInBundlePrice.AssociatedBsgPricing field on the BsgRelationship objectRequired for all the child products.

See Also