Checkout

Create a checkout session

POST
/v1/checkouts/sessions

Authorization

selectkey<token>

API key para requisições autenticadas. Envie sua chave no cabeçalho selectkey (sandbox sk_test_…, produção sk_live_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/checkouts/sessions" \  -H "Content-Type: application/json" \  -d '{    "items": [],    "lineItems": [      {}    ],    "expiresAt": "2026-01-15T12:00:00.000Z",    "customer": {},    "address": {},    "client": {},    "cookies": {},    "coupons": [      "string"    ],    "paymentMethods": [      "string"    ],    "redirectUrls": {},    "shippingDelivery": {},    "source": "string",    "language": "string",    "timezone": "string",    "totalAmount": 5000,    "totalDiscount": 5000,    "totalShipping": 5000,    "totalTax": 5000,    "utm": {},    "metadata": {},    "integrationType": "string",    "integrationId": "string",    "externalTransactionId": "string",    "onBehalfOf": "id_0a1b2c3d4e5f60718293",    "ambient": "live"  }'
{
  "object": "checkout.session",
  "id": "sess_0a1b2c3d4e5f60718293",
  "url": "string",
  "status": "active",
  "ambient": "string",
  "source": "string",
  "currency": "BRL",
  "lineItems": [
    {
      "id": "string",
      "name": "Acme Ltda",
      "quantity": 0,
      "unitPrice": 5000,
      "currency": "BRL",
      "isOrderbump": true,
      "isUpsell": true,
      "metadata": {},
      "externalReference": "string"
    }
  ],
  "totals": {
    "amount": 5000,
    "discount": 0,
    "shipping": 0,
    "tax": 0
  },
  "coupons": [
    {
      "code": "string",
      "type": "string",
      "value": 5000
    }
  ],
  "customer": {},
  "address": {},
  "paymentMethods": [
    "string"
  ],
  "paymentSelection": {
    "method": "string"
  },
  "redirectUrls": {
    "paid": "string",
    "refused": "string",
    "pending": "string"
  },
  "utm": {},
  "metadata": {},
  "customInputs": "null",
  "integrationType": "string",
  "integrationId": "string",
  "externalTransactionId": "string",
  "firstInitialization": true,
  "online": true,
  "expiresAt": "string",
  "createdAt": "string",
  "updatedAt": "string"
}
{
  "error": {
    "status": "Bad Request",
    "statusCode": 400,
    "category": "validation",
    "code": "invalidParameters",
    "message": "Validation errors occurred.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Unauthorized",
    "statusCode": 401,
    "category": "authentication",
    "code": "unauthorized",
    "message": "Authentication is required to access this resource.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Forbidden",
    "statusCode": 403,
    "category": "authorization",
    "code": "forbidden",
    "message": "You do not have permission to perform this action.",
    "resource": "server"
  }
}
{
  "error": {
    "status": "Internal Server Error",
    "statusCode": 500,
    "category": "server",
    "code": "serverError",
    "message": "An unexpected error occurred. Please try again later.",
    "resource": "server",
    "details": "If the problem persists, contact support with the correlationId from the response headers."
  }
}