---
search:
  tags:
    - checkoutSessions
    - POST
seo:
  description: >-
    Reference for the POST /v1/checkout/sessions endpoint in the Vortex Payments
    API.
sidebar:
  label: POST /v1/checkout/sessions
  badge: POST
title: POST /v1/checkout/sessions
type: openapi-operation
---
`POST /v1/checkout/sessions`

**curl**

```bash
curl "https://api.vortex.nyc/v1/checkout/sessions?environment=sandbox&merchantAccountId=..." \
  -X POST \
  -H "Authorization: Bearer $VORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"subscription","customerId":"bcust_123","collectionMode":"automatic","items":[{"priceId":"price_core_monthly","quantity":1}],"createdByRef":"internal-integration"}'
```

**TypeScript**

```ts
import { createCheckoutSession, createVortex } from "@vortex-api/vortex/2026-09";

const vortex = createVortex({ apiKey: process.env.VORTEX_API_KEY });
const { data } = await createCheckoutSession({
  client: vortex,
  query: { environment: "sandbox", merchantAccountId: "..." },
  body: {"mode":"subscription","customerId":"bcust_123","collectionMode":"automatic","items":[{"priceId":"price_core_monthly","quantity":1}],"createdByRef":"internal-integration"},
});
```

**Request body** (`application/json`, required)

- `environment` (string | null)
- `merchantAccountId` (string | null)
- `mode` (string | null)
- `invoiceNumbers` (string[] | null)
- `invoiceNumber` (string | null)
- `amount` (number | null)
- `amountCents` (number | null)
- `currency` (string | null)
- `description` (string | null)
- `customerId` (string | null)
- `billingAccountId` (string | null)
- `customer` (object | null)
- `billingAccount` (object | null)
- `items` (object[] | null)
- `trialEndAt` (string | null)
- `testClockId` (string | null)
- `collectionMode` (string | null)
- `successUrl` (string | null)
- `cancelUrl` (string | null)
- `returnUrl` (string | null)
- `paymentMethodId` (string | null)
- `customerEmail` (string | null)
- `payerEmail` (string | null)
- `billingAddressCollection` (string | null)
- `dueAt` (string | null)
- `dueDate` (string | null)
- `expiresAt` (string | null)
- `metadata` (object | null)
- `idempotencyKey` (string | null)
- `createdByRef` (string | null)

Request body example:

```json
{
  "environment": "sandbox",
  "merchantAccountId": "string",
  "mode": "payment",
  "invoiceNumbers": [
    "string"
  ],
  "invoiceNumber": "string",
  "amount": 0,
  "amountCents": 0,
  "currency": "string",
  "description": "string",
  "customerId": "string",
  "billingAccountId": "string",
  "customer": {
    "customerId": "string",
    "externalCustomerRef": "string",
    "name": "string",
    "email": "string",
    "defaultCurrency": "string",
    "metadata": {
      "property1": "string",
      "property2": "string"
    }
  },
  "billingAccount": {
    "billingAccountId": "string",
    "invoiceDeliveryMode": "email",
    "collectionMode": "manual",
    "autoCollectionEnabled": true,
    "customerProfileId": "string",
    "defaultPaymentMethodId": "string",
    "renewalTiming": "advance",
    "netTermsDays": 0,
    "dunningCampaignId": "string",
    "metadata": {
      "property1": "string",
      "property2": "string"
    }
  },
  "items": [
    {
      "priceId": "string",
      "quantity": 0
    }
  ],
  "trialEndAt": "string",
  "testClockId": "string",
  "collectionMode": "manual",
  "successUrl": "string",
  "cancelUrl": "string",
  "returnUrl": "string",
  "paymentMethodId": "string",
  "customerEmail": "string",
  "payerEmail": "string",
  "billingAddressCollection": "auto",
  "dueAt": "string",
  "dueDate": "string",
  "expiresAt": "string",
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "idempotencyKey": "string",
  "createdByRef": "string"
}
```

**Responses**

- `201` — Success

Response example, 201:

```json
{
  "data": {
    "checkoutSession": {
      "checkoutSessionId": "string",
      "paymentRequestId": "string",
      "checkoutUrl": "string",
      "token": "string",
      "mode": "payment",
      "status": "open",
      "customerId": "string",
      "customerExternalId": "string",
      "billingAccountId": "string",
      "currency": "string",
      "amountTotal": 0,
      "amountRemaining": 0,
      "invoiceNumbers": [
        "string"
      ],
      "expiresAt": "string",
      "createdAt": "string",
      "subscriptionId": "string",
      "externalCustomerRef": "string",
      "successUrl": "string",
      "cancelUrl": "string",
      "returnUrl": "string",
      "paymentMethodId": "string",
      "customerEmail": "string",
      "billingAddressCollection": "auto"
    },
    "paymentRequest": {
      "paymentRequestId": "string",
      "customerId": "string",
      "billingAccountId": "string",
      "status": "open",
      "currency": "string",
      "amountRequested": 0,
      "amountPaid": 0,
      "amountRemaining": 0,
      "invoiceCount": 0,
      "attemptCount": 0,
      "createdByType": "system",
      "createdByRef": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "metadata": {
        "property1": "string",
        "property2": "string"
      },
      "lastAttemptStatus": "succeeded",
      "lastAttemptError": "string",
      "lastPaymentIntentId": "string",
      "lastPaymentId": "string",
      "dueAt": "string",
      "expiresAt": "string",
      "lastAttemptedAt": "string",
      "paidAt": "string",
      "canceledAt": "string"
    },
    "invoices": [
      {
        "invoiceId": "string",
        "customerId": "string",
        "billingAccountId": "string",
        "status": "draft",
        "currency": "string",
        "subtotal": 0,
        "discountTotal": 0,
        "taxTotal": 0,
        "total": 0,
        "amountPaid": 0,
        "amountRemaining": 0,
        "metadata": {
          "property1": "string",
          "property2": "string"
        },
        "subscriptionId": "string",
        "creditNoteTotal": 0,
        "customerBalanceAppliedTotal": 0,
        "periodStartAt": "string",
        "periodEndAt": "string",
        "issuedAt": "string",
        "dueAt": "string",
        "finalizedAt": "string",
        "voidedAt": "string",
        "createdAt": "string",
        "updatedAt": "string"
      }
    ],
    "replayed": true
  },
  "requestId": "string"
}
```
