curl --request POST \
  --url https://api.dots.dev/api/v2/checkout-sessions \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "line_items": [
    {
      "price_data": {
        "currency": "usd",
        "amount": 123,
        "product_data": {
          "name": "<string>",
          "description": "<string>",
          "images": [
            "<string>"
          ],
          "metadata": {}
        }
      },
      "quantity": 123
    }
  ],
  "customer_email": "jsmith@example.com",
  "client_reference_id": "<string>",
  "success_url": "<string>",
  "cancel_url": "<string>",
  "mode": "payment",
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "expires_in": 5400,
  "metadata": {}
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "open",
  "payment_intent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "success_url": "<string>",
  "cancel_url": "<string>",
  "checkout_session_url": "<string>",
  "client_reference_id": "<string>",
  "expiry": "2023-11-07T05:31:56Z",
  "metadata": {},
  "line_items": [
    {
      "quantity": 123,
      "price_id": "<string>"
    }
  ],
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z",
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "customer_email": "jsmith@example.com",
  "amount_total": 123
}

Authorizations

Authorization
string
headerrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
line_items
object[]
required
customer_email
string
client_reference_id
string
success_url
string
required
cancel_url
string
mode
enum<string>
required
Available options:
payment
user_id
string

Supply a Dots user ID in place of a customer ID

customer_id
string
expires_in
integer
default: 10800
metadata
object

Response

200 - application/json
id
string
status
enum<string>
Available options:
open,
complete,
expired
payment_intent_id
string
success_url
string
cancel_url
string
checkout_session_url
string
client_reference_id
string
expiry
string
metadata
object
line_items
object[]
created
string
updated
string
customer_id
string

payment-customer ID

customer_email
string
amount_total
integer