Skip to main content
PATCH
/
api
/
v1
/
checkout-session
/
{checkoutSessionId}
Update Checkout Session
curl --request PATCH \
  --url https://demo.api.loopcrypto.xyz/api/v1/checkout-session/{checkoutSessionId} \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --header 'entity-id: <api-key>' \
  --data '{
  "active": false,
  "addPaymentTokens": [
    {
      "networkId": 1,
      "tokenSymbols": [
        "USDC",
        "USDT"
      ],
      "tokenAddresses": [
        "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "0x1234567890123456789012345678901234567890"
      ]
    }
  ],
  "removePaymentTokens": [
    {
      "networkId": 1,
      "tokenSymbols": [
        "USDC",
        "USDT"
      ],
      "tokenAddresses": [
        "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "0x1234567890123456789012345678901234567890"
      ]
    }
  ]
}'
{
  "id": "cs_12345",
  "active": "true",
  "elements": [
    {
      "itemId": "12334-55322-122-123314",
      "externalPriceId": "price_12345"
    }
  ],
  "externalSubscriptionId": "sub_12345",
  "externalCustomerId": "cus_12345",
  "externalInvoiceId": "in_12345",
  "referenceId": "ref_12345",
  "emailAddress": "info@loopcrypto.xyz",
  "freeTrialDays": 7,
  "couponCodeId": "12345",
  "payInvoiceImmediately": true,
  "cartEnabled": false,
  "billDate": 1746869711,
  "metadata": {},
  "expirationDate": "1746869711",
  "childTemplate": true,
  "suggestedAllowanceAmount": 1001,
  "minimumAllowanceAmount": 1001,
  "minimumBalanceAmount": 1001,
  "upgradeSubscription": true,
  "template": false,
  "successUrl": "https://www.loopcrypto.xyz/success",
  "tokens": [
    {
      "networkId": 1,
      "tokenSymbol": "USDC",
      "tokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174"
    }
  ],
  "resetBillingCycle": true
}

Authorizations

api-key
string
header
required
entity-id
string
header
required

Path Parameters

checkoutSessionId
string
required

Body

application/json
active
boolean

Flag to indicate that the checkout session is active and able to be used by a customer

Example:

false

addPaymentTokens
object[]

Add payment tokens to the checkout session

removePaymentTokens
object[]

Remove payment tokens from the checkout session

Response

Ok

id
string
required

Checkout session ID This is used in the URL to retrieve the checkout session

Example:

"cs_12345"

active
boolean
required

The checkout session is an active session

Example:

"true"

elements
object[] | null
required

Items and fees included in the checkout session

externalSubscriptionId
string | null
required

External subscription ID

Example:

"sub_12345"

externalCustomerId
string | null
required

External customer ID

Example:

"cus_12345"

externalInvoiceId
string | null
required

External invoice ID

Example:

"in_12345"

referenceId
string | null
required

External reference ID

Example:

"ref_12345"

emailAddress
string | null
required

Customer email address

Example:

"info@loopcrypto.xyz"

freeTrialDays
number | null
required

Number of free trial days

Example:

7

couponCodeId
string | null
required

Coupon code ID

Example:

"12345"

payInvoiceImmediately
boolean
required

Pay invoice immediately. Do not wait for the bill date to process the invoice

Example:

true

cartEnabled
boolean
required

Enable or disable cart on checkout page

Example:

false

billDate
number | null
required

The date the subscription will be started, expressed as a UNIX date in seconds

Example:

1746869711

metadata
object
required

Metadata info that will be included on the Agreement Created webhook Construct a type with a set of properties K of type T

expirationDate
number | null
required

Date the checkout session will expire in seconds as a UNIX date in seconds

Example:

"1746869711"

childTemplate
boolean
required

Indicates if this session was generated from a template

Example:

true

suggestedAllowanceAmount
number
required

Suggested allowance amount in cents

Example:

1001

minimumAllowanceAmount
number
required

Minimum required allowance amount in cents

Example:

1001

minimumBalanceAmount
number
required

Minimum required balance amount in cents

Example:

1001

upgradeSubscription
boolean
required

Upgrade flag to upgrade the subscription with a new item

Example:

true

template
boolean
required

Session is a template session that is ever green and can be used to create new sessions when the link is clicked

Example:

false

successUrl
string | null
required

URL to redirect the customer after a successful checkout.

Example:

"https://www.loopcrypto.xyz/success"

tokens
object[] | null
required

A list of the tokens and the networks they're on that are accepted as payment for this checkout session

resetBillingCycle
boolean
required

Reset billing cycle reset the subscription billing cycle to the current time.

Example:

true

I