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

Response

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

cancelURLstring

Cancel URL.

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.

clientSecretstring

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

createdAtstring date-time required

Timestamp at which the checkout session was created.

currencystring

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

customerEmailstring

Customer's email address provided to Stripe.

customerIdstring required

The OpenMeter customer ID.

expiresAtstring date-time

Timestamp at which the checkout session will expire.

metadataobject

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

mode'setup' required

Stripe CheckoutSession.mode

returnURLstring

Return URL.

sessionIdstring required

The checkout session ID.

setupIntentIdstring required

The checkout session setup intent ID.

statusstring

The status of the checkout session.

stripeCustomerIdstring required

The Stripe customer ID.

successURLstring

Success URL.

urlstring

URL to show the checkout session.

Example response

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

Changes

No recorded changes to this endpoint across all 1 revision of this API.