Submit Cart for an Exchange Order

After you’ve previewed the cart, it’s almost time to submit the exchange. There are a few considerations to keep in mind while creating the submit for the exchange.

Required Editions
Available in: Enterprise, Unlimited, and Developer Editions

Before creating your submit order, validate that orderSummaryId (MainOrderSummaryId), exchangeCartId, and referenceId:

  • Aren’t null or empty
  • Are valid Salesforce IDs
  • Represent a valid entity

The referenceId must be type ReturnOrder. Make sure the ReturnOrder’s StatusCategory is Activated or Pending.

Make sure the ReturnOrderId belongs to the MainOrderSummaryId.

The cart for an exchange needs at least one product and at least one delivery group. The cart must belong to the same account as the OrderSummary. Make sure the OrderSummary.Account equals the cart.Account.

Input Fields for the Submit Cart to Exchange Order API Representation 

NameTypeDescriptionRequired or Optional
mainOrderSummaryIdStringID of the main Order Summary.Required
exchangeCartIdStringID of the cart used for adding items to the exchange order.Required
referenceIdStringPolymorphic Reference ID, which must be related to the main Order Summary. Only Return Order ID is supported.Required
paymentInfoListPaymentInfoInputRepresentationListList of payment information if additional funds are needed for the new exchange order.
  • PaymentInfoInputRepresentation
    • String paymentAuthorizationId
    • Array[String] paymentIds
    • String paymentMethodId(optional)
    • String lastPaymentGatewayLogId(optional)
    • String name(optional)
Optional
paymentInfoItemsArray[PaymentInfoInputRepresentation]List of payment information if additional funds are needed for the new exchange order.Optional
SequenceOrderPaymentSummaryInputListSequenceOrdered list of OrderPaymentSummaries and the reserved balance amounts to apply them to.
  • Array[SequenceOrderPaymentSummaryInputRepresentation] sequences
  • String orderPaymentSummaryId (required)
  • Number amount, which uses the total Order Payment Summary balance if it’s zero or not specified.
  • Order Number: If the exchange is created in the order number specified, it creates an exchange with random guide as the order number
Optional

Example 

The submit response might look like this example.

1{
2  "changeBalances": {
3  "grandTotalAmount": -47.49,
4  "totalAdjDeliveryAmtWithTax": 12.94
5  "totalAdjDistAmountWithTax": 0,
6  "totalAdjProductAmtWithTax": -60.44,
7  "totalAdjustedDeliveryAmount": 11.99,
8  "totalAdjustedDeliveryTaxAmount": 0.95,
9  "totalAdjustedProductAmount": -55.96,
10  "totalAdjustedProductTaxAmount": -4.48,
11  "totalAdjustmentDistributedAmount": 0,
12  "totalAdjustmentDistributedTaxAmount": 0,
13  "totalAmount": -43.97,
14  "totalExcessFundsAmount": 47.49,
15  "totalFeeAmount": 0,
16  "totalFeeTaxAmount": 0,
17  "totalRefundableAmount": 47.49,
18  "totalRequiredFundsAmount": 0,
19  "totalTaxAmount": -3.52
20  },
21  "errors": [],
22  "exchangeOrderSummaryId": "1OsSB000000UdYb",
23  "orderSummaryId": "1OsSB000000UdWz0AK",
24  "success": true
25  }

See Also