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
id
stringRequiredThe swap's ID
created_at
DateRequiredThe date with timezone at which the resource was created.
updated_at
DateRequiredThe date with timezone at which the resource was updated.
deleted_at
null | DateRequiredThe date with timezone at which the resource was deleted.
The status of the Fulfillment of the Swap.
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.
order_id
stringRequiredThe ID of the order that the swap belongs to.
The details of the order that the swap belongs to.
The details of the new products to send to the customer, represented as line items.
The details of the return that belongs to the swap, which holds the details on the items being returned.
The details of the fulfillments that are used to send the new items to the customer.
The details of the additional payment authorized by the customer when
difference\_due
is positive.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.
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 address that the new items should be sent to.
The details of the shipping methods used to fulfill the additional items purchased.
cart_id
stringRequiredThe ID of the cart that the customer uses to complete the swap.
The details 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.
canceled_at
DateRequiredThe date with timezone at which the Swap was canceled.
no_notification
booleanRequiredIf set to true, no notification will be sent related to this swap
allow_backorder
booleanRequiredIf true, swaps can be completed with items out of stock
Default: false
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
Was this section helpful?