Skip to main content

Create a session

POST 

/checkout/sessions

This endpoint creates a Session. Sessions can only be paid successfully once

Request

Body

required

    id uuidrequired

    Possible values: <= 36 characters, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

    UUID v4

    customer_id uuidnullable

    Possible values: <= 36 characters, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

    UUID v4

    payment_method_id uuidnullable

    Possible values: <= 36 characters, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

    UUID v4

    currency /[A-Z]{3}/required

    ISO 4217 representation of the currency

    client_reference_id stringnullable

    Possible values: <= 255 characters

    A reference set by the merchant. This can be the merchant's order ID or anything useful to associate this session

    success_url uri

    A URL the customer will be redirected in case of a successful payment

    cancel_url uri

    A URL the customer will be redirected when cancelling the checkout session

    expires_at int64

    Unix timestamp (seconds since epoch)

    description string

    A description set by the merchant regarding this session

    items

    object[]

    required

    Possible values: >= 1

  • Array [

  • description stringrequired

    Description of the item

    unit_amount MoneyAmount (integer)

    Possible values: <= 9999999999

    Amount expressed in cents. 1 USD should be submitted as 100 cents

    total_amount MoneyAmount (integer)

    Possible values: <= 9999999999

    Amount expressed in cents. 1 USD should be submitted as 100 cents

    quantity integerrequired

    Possible values: >= 1

    Quantity of the item

  • ]

  • metadata

    object

    A metadata object containing key-value pairs. Keys must be strings, and values are strings. The object can also be empty.

    property name* string

Responses

Session created successfully

Schema

    status string

    Possible values: [success]

    data

    object

    Create Session Response

    checkout_url uri

    Url to redirect the customer to complete the payment

    code integer

    Possible values: [201]

    message string

    Possible values: [Successful request]

Loading...