v51

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2026-08-011534301009.2 KB
App: Stripe

Create checkout session

Create checkout session.

post/api/v1/stripe/checkout/sessions

Request body

appIdstring

If not provided, the default Stripe app is used if any.

stripeCustomerIdstring

Stripe customer ID. If not provided OpenMeter creates a new Stripe customer or uses the OpenMeter customer's default Stripe customer ID.

Example request

{
  "customer": {
    "name": "ACME, Inc.",
    "currency": "USD",
    "usageAttribution": {
      "subjectKeys": [
        "my-identifier"
      ]
    }
  },
  "options": {
    "currency": "USD",
    "successURL": "http://example.com",
    "billingAddressCollection": "required",
    "taxIdCollection": {
      "enabled": true,
      "required": "if_supported"
    },
    "customerUpdate": {
      "name": "auto",
      "address": "auto"
    }
  }
}

Response

The request has succeeded and a new resource has been created as a result.

customerIdstring required

The OpenMeter customer ID.

stripeCustomerIdstring required

The Stripe customer ID.

sessionIdstring required

The checkout session ID.

setupIntentIdstring required

The checkout session setup intent ID.

clientSecretstring

The client secret of the checkout session. This can be used to initialize Stripe.js for your client-side implementation.

clientReferenceIdstring

A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.

customerEmailstring

Customer's email address provided to Stripe.

currencystring

Three-letter ISO4217 currency code. Custom three-letter currency codes are also supported for convenience.

createdAtstring date-time required

Timestamp at which the checkout session was created.

expiresAtstring date-time

Timestamp at which the checkout session will expire.

metadataobject

Set of key-value pairs attached to the checkout session.

statusstring

The status of the checkout session.

urlstring

URL to show the checkout session.

mode'setup' required

Stripe CheckoutSession.mode

cancelURLstring

Cancel URL.

successURLstring

Success URL.

returnURLstring

Return URL.

Example response

{
  "customerId": "01G65Z755AFWAKHE12NY0CQ9FH",
  "currency": "USD",
  "createdAt": "2023-01-01T01:01:01.001Z",
  "expiresAt": "2023-01-01T01:01:01.001Z"
}