Skip to main content
POST
/
v1
/
swaps
Create
curl --request POST \
  --url https://{defaultHost}/v1/swaps \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "swap": {
    "description": "Swap and save 20%!",
    "price": "5d12b073-82a9-4ab7-ab43-bceae8170494",
    "swap_price": "f94ce61c-6be4-4187-87e4-05226f1d6b8a"
  }
}
'
{
  "id": "0a308207-6a12-4c57-b9d2-54e081f96c7b",
  "object": "swap",
  "archived": false,
  "archived_at": null,
  "description": "Swap and save 20%!",
  "metadata": {},
  "price": "5d12b073-82a9-4ab7-ab43-bceae8170494",
  "swap_price": "f94ce61c-6be4-4187-87e4-05226f1d6b8a",
  "discarded_at": null,
  "created_at": 1782209313,
  "updated_at": 1782209313
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
swap
object

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

archived
boolean

Whether or not this swap is archived.

description
string | null

A description of this swap. This text will be visibile to customers in the checkout summary when offered the swap.

metadata
object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

archived_at
integer | null

Time at which the object was archived. Measured in seconds since the Unix epoch.

price

Expandable – The associated price ID.

swap_price

Expandable – The associated price ID.

discarded_at
integer | null

Time at which the object was discarded. Measured in seconds since the Unix epoch.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.