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.
Constructors
constructor
**new 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_backorderbooleanRequiredIf true, swaps can be completed with items out of stock
Default: false
canceled_atDateRequiredThe date with timezone at which the Swap was canceled.
The details of the cart that the customer uses to complete the swap.
cart_idstringRequiredThe ID of the cart that the customer uses to complete the swap.
confirmed_atDateRequiredThe date with timezone at which the Swap was confirmed by the Customer.
created_atDateRequiredThe date with timezone at which the resource was created.
deleted_atnull | DateRequiredThe date with timezone at which the resource was deleted.
difference_duenumberRequiredThe 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.
idstringRequiredThe swap's ID
idempotency_keystringRequiredRandomly generated key used to continue the completion of the swap in case of failure.
metadataRecord<string, unknown>RequiredAn optional key-value map with additional details
no_notificationbooleanRequiredIf set to true, no notification will be sent related to this swap
The details of the order that the swap belongs to.
order_idstringRequiredThe 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_idstringRequiredThe 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_atDateRequiredThe date with timezone at which the resource was updated.
Methods
beforeInsert
Private **beforeInsert**(): void
Returns
void
voidvoidWas this section helpful?