Newer Version Available

This content describes an older version of this product. View Latest

OrderSummary Class

Work with orders in Order Management.

Namespace

ConnectApi

OrderSummary Methods

The following are methods for OrderSummary. All methods are static.

createCreditMemo(orderSummaryId, creditMemoInput)

Create a credit memo to represent the refund for one or more change orders associated with an OrderSummary.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.CreateCreditMemoOutputRepresentation createCreditMemo(String orderSummaryId, ConnectApi.CreateCreditMemoInputRepresentation creditMemoInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
creditMemoInput
Type: ConnectApi.CreateCreditMemoInputRepresentation
The list of change order IDs.

ensureFundsAsync(orderSummaryId, ensureFundsInput)

Ensure funds for an invoice and apply them to it. If needed, capture authorized funds by sending a request to a payment provider. This method inserts a background operation into an asynchronous job queue and returns the ID of that operation so you can track its status. Payment gateway responses appear in the payment gateway log and do not affect the background operation status.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.EnsureFundsAsyncOutputRepresentation ensureFundsAsync(String orderSummaryId, ConnectApi.EnsureFundsAsyncInputRepresentation ensureFundsInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
ensureFundsInput
Type: ConnectApi.EnsureFundsAsyncInputRepresentation
The ID of the invoice.

Usage

This method checks the OrderPaymentSummaries associated with the specified OrderSummary for funds to apply to the invoice balance as follows:

If multiple OrderPaymentSummaries have the same amount, their order of selection is random.

Note

  1. Verify that the invoice balance doesn’t exceed the total amount of all the OrderPaymentSummaries.
  2. If an OrderPaymentSummary exists with an amount that matches the invoice balance, use it.
  3. Otherwise, if any OrderPaymentSummaries exist with an amount greater than the invoice balance, use the one with the smallest amount greater than the invoice balance.
  4. Otherwise, select OrderPaymentSummaries in order from largest amount to smallest until their amounts meet or exceed the invoice balance.
  5. If any selected funds are authorized, capture them.
  6. Apply the selected funds to the invoice.

ensureRefundsAsync(orderSummaryId, ensureRefundsInput)

Ensure refunds for a credit memo by sending a request to a payment provider. This method inserts a background operation into an asynchronous job queue and returns the ID of that operation so you can track its status. Payment gateway responses appear in the payment gateway log and do not affect the background operation status.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.EnsureRefundsAsyncOutputRepresentation ensureRefundsAsync(String orderSummaryId, ConnectApi.EnsureRefundsAsyncInputRepresentation ensureRefundsInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
ensureRefundsInput
Type: ConnectApi.EnsureRefundsAsyncInputRepresentation
Object that wraps the ID of the credit memo.

previewCancel(orderSummaryId, changeInput)

Retrieve the expected change order values for canceling one or more OrderItemSummaries from an OrderSummary, without actually executing the cancel.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.PreviewCancelOutputRepresentation previewCancel(String orderSummaryId, ConnectApi.ChangeInputRepresentation changeInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
changeInput
Type: ConnectApi.ChangeInputRepresentation
A list of changes to OrderItemSummaries that make up an order change, such as a cancel or return.

previewReturn(orderSummaryId, changeInput)

Retrieve the expected change order values for returning one or more OrderItemSummaries from an OrderSummary, without actually executing the return.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.PreviewReturnOutputRepresentation previewReturn(String orderSummaryId, ConnectApi.ChangeInputRepresentation changeInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
changeInput
Type: ConnectApi.ChangeInputRepresentation
A list of changes to OrderItemSummaries that make up an order change, such as a cancel or return.

submitCancel(orderSummaryId, changeInput)

Cancel one or more OrderItemSummaries from an OrderSummary, and create a corresponding change order.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.SubmitCancelOutputRepresentation submitCancel(String orderSummaryId, ConnectApi.ChangeInputRepresentation changeInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
changeInput
Type: ConnectApi.ChangeInputRepresentation
A list of changes to OrderItemSummaries that make up an order change, such as a cancel or return.

submitReturn(orderSummaryId, changeInput)

Return one or more OrderItemSummaries from an OrderSummary, and create a corresponding change order.

API Version

48.0

Requires Chatter

No

Signature

public static ConnectApi.SubmitReturnOutputRepresentation submitReturn(String orderSummaryId, ConnectApi.ChangeInputRepresentation changeInput)

Parameters

orderSummaryId
Type: String
ID of the OrderSummary.
changeInput
Type: ConnectApi.ChangeInputRepresentation
A list of changes to OrderItemSummaries that make up an order change, such as a cancel or return.

Usage

After submitting a return, process a refund. Pass the changeOrderId from the output representation to the createCreditMemo() method, then pass the credit memo to the ensureRefundsAsync() method.