--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # 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 `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "no_notification", "type": "`boolean`", "description": "If set to true, no notification will be sent related to this swap", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "order", "type": "[Order](Order.mdx)", "description": "The details of the order that the swap belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "order_id", "type": "`string`", "description": "The ID of the order that the swap belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "payment", "type": "[Payment](Payment.mdx)", "description": "The details of the additional payment authorized by the customer when `difference\\_due` is positive.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "payment_status", "type": "[SwapPaymentStatus](../enums/SwapPaymentStatus.mdx)", "description": "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.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "return_order", "type": "[Return](Return.mdx)", "description": "The details of the return that belongs to the swap, which holds the details on the items being returned.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "shipping_address", "type": "[Address](Address.mdx)", "description": "The details of the shipping address that the new items should be sent to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "shipping_address_id", "type": "`string`", "description": "The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_methods", "type": "[ShippingMethod](ShippingMethod.mdx)[]", "description": "The details of the shipping methods used to fulfill the additional items purchased.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> ## Methods ### beforeInsert `Private **beforeInsert**(): void` #### Returns `void`