Swap
A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products.
Properties
The details of the new products to send to the customer, represented as line items.
allow_backorder
booleanRequiredIf true, swaps can be completed with items out of stock
Default: false
canceled_at
DateRequiredThe date with timezone at which the Swap was canceled.
The details of the cart that the customer uses to complete the swap.
cart_id
stringRequiredThe ID of the cart that the customer uses to complete the swap.
confirmed_at
DateRequiredThe date with timezone at which the Swap was confirmed by the Customer.
created_at
DateRequiredThe date with timezone at which the resource was created.
deleted_at
null | DateRequiredThe date with timezone at which the resource was deleted.
difference_due
numberRequiredThe difference amount between the order’s original total and the new total imposed by the swap. If its value is negative, a refund must be issues to the customer. If it's positive, additional payment must be authorized by the customer. Otherwise, no payment processing is required.
The status of the Fulfillment of the Swap.
The details of the fulfillments that are used to send the new items to the customer.
id
stringRequiredThe swap's ID
idempotency_key
stringRequiredRandomly generated key used to continue the completion of the swap in case of failure.
metadata
Record<string, unknown>RequiredAn optional key-value map with additional details
no_notification
booleanRequiredIf set to true, no notification will be sent related to this swap
The details of the order that the swap belongs to.
order_id
stringRequiredThe ID of the order that the swap belongs to.
The details of the additional payment authorized by the customer when
difference\_due
is positive.The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.
The details of the return that belongs to the swap, which holds the details on the items being returned.
The details of the shipping address that the new items should be sent to.
shipping_address_id
stringRequiredThe Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order.
The details of the shipping methods used to fulfill the additional items purchased.
updated_at
DateRequiredThe date with timezone at which the resource was updated.
Was this section helpful?