Skip to main content
POST
/
api
/
commerce
/
checkouts
/
{id}
/
discount
Apply a discount code to a checkout
curl --request POST \
  --url https://app.vaultgraph.com/api/commerce/checkouts/{id}/discount \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "code": "<string>"
}
'
{
  "data": {
    "id": "<string>",
    "currency": "<string>",
    "line_items": [
      {
        "item": {
          "id": "<string>",
          "title": "<string>",
          "price": 123,
          "image_url": "<string>"
        },
        "quantity": 2,
        "id": "<string>",
        "parent_id": "<string>",
        "totals": [
          {
            "amount": 123,
            "display_text": "<string>"
          }
        ]
      }
    ],
    "totals": [
      {
        "amount": 123,
        "display_text": "<string>"
      }
    ],
    "links": [
      {
        "type": "<string>",
        "url": "<string>",
        "title": "<string>"
      }
    ],
    "payment": {
      "handlers": [
        {
          "config": {},
          "config_schema": "<string>",
          "id": "<string>",
          "instrument_schemas": [
            "<string>"
          ],
          "name": "<string>",
          "spec": "<string>",
          "version": "<string>"
        }
      ],
      "instruments": [
        {
          "handler_id": "<string>",
          "id": "<string>",
          "brand": "<string>",
          "last_digits": "<string>",
          "billing_address": {
            "address_country": "<string>",
            "address_locality": "<string>",
            "address_region": "<string>",
            "extended_address": "<string>",
            "first_name": "<string>",
            "full_name": "<string>",
            "last_name": "<string>",
            "phone_number": "<string>",
            "postal_code": "<string>",
            "street_address": "<string>"
          },
          "credential": {
            "type": "<string>",
            "cryptogram": "<string>",
            "cvc": "<string>",
            "eci_value": "<string>",
            "expiry_month": 123,
            "expiry_year": 123,
            "name": "<string>",
            "number": "<string>"
          },
          "expiry_month": 123,
          "expiry_year": 123,
          "rich_card_art": "<string>",
          "rich_text_description": "<string>"
        }
      ],
      "selected_instrument_id": "<string>"
    },
    "ucp": {
      "capabilities": [
        {
          "name": "<string>",
          "version": "<string>",
          "config": {},
          "extends": "<string>",
          "schema": "<string>",
          "spec": "<string>"
        }
      ],
      "version": "<string>"
    },
    "buyer": {
      "email": "<string>",
      "first_name": "<string>",
      "full_name": "<string>",
      "last_name": "<string>",
      "phone_number": "<string>"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.vaultgraph.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Path Parameters

id
string
required

Body

application/json
code
string
required

Response

200 - application/json

Updated checkout

data
object