Skip to main content

Create a Session

POST 

/v2/sessions

Creates a sessions object

Request

Body

required

    bank_code string

    A custom code provided by a bank you want to use for online banking payment methods

    branding

    object

    Details on branding elements to apply when rendering this Checkout Session.

    icon stringnullable

    A secure URL to an image icon

    logo stringnullable

    A secure URL to an image logo

    use_logo boolean

    Has the value of true if logo should be rendered in payment page or false if icon should be used.

    primary_color stringnullable

    A hex color code that will be used as background color of the payment page

    secondary_color stringnullable

    A hex color code that will be used as background color of the submit or PAY button

    billing_address_collection BillingAddressCollection (string)

    Possible values: [auto, required]

    Default value: auto

    Describes whether Checkout should collect the customer's billing address.

    cancel_url stringrequired

    Customers will be directed to this URL if they decide to cancel payment and return to your website.

    client_reference_id string

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

    currency stringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    customer string

    The ID of an existing customer that will be associated with this Checkout Session. This is used to prefill the customer-related fields like email address, name and phone on the payment page.

    customer_email string

    Email address of customer. This is used to prefill the email field on the payment page.

    customer_name string

    Name of customer. This is used to prefill the name field on the payment page.

    customer_name_collection boolean

    Describes whether Checkout should collect the customer's name.

    customer_phone string

    Phone number of customer. This is used to prefill the phone field on the payment page.

    description string

    If provided, Checkout will use this value as description of the charge.

    line_items

    object[]

    required

    A list of items the customer is purchasing. Each item is an object with the following properties.

  • Array [

  • amount integerrequired

    Unit amount of the product in cents represented as a whole integer.

    description stringnullable

    A description of the product

    image stringnullable

    A secure URL to an image of the product

    name stringrequired

    The name of the product

    quantity integerrequired

    The quantity of the products being purchased

  • ]

  • locale string

    Possible values: [en]

    The IETF language tag of the locale Checkout is displayed in. Defaults to en. As of current version, Checkout will not yet support other locales.

    metadata

    object

    A set of key-value pairs that you can attach to a Checkout Session object. It can be useful for storing additional information about the session in a structured format.

    property name* string
    mode string

    Possible values: [payment, setup, subscription, save_card]

    The mode of the Checkout Session. Required when creating a Checkout Session.

    payment_method_types PaymentMethod (string)[]required

    Possible values: [card, bpi, gcash, maya, alipay, unionpay, wechat]

    A list of the types of payment methods (e.g., card) this Checkout Session can accept.

    phone_number_collection boolean

    Describes whether Checkout should collect the customer's phone number.

    shipping_address_collection

    object

    Describes whether Checkout should collect the customer's shipping address.

    allowed_countries string[]required

    A list of two-letter ISO country codes. Checkout will only collect shipping address from customers in these countries.

    submit_type string

    Possible values: [pay, book, donate, send]

    Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Session in payment mode, but not on other modes.

    success_url stringrequired

    Customers will be directed to this URL after a successful payment.

Responses

Created

Schema

    id string

    Unique identifier for the Session object.

    object string

    String representing the object's type. Objects of the same type share the same value.

    amount_subtotal integer

    Total of all items before discounts or taxes are applied. Amount in cents represented as whole integer.

    amount_total integer

    Total of all items after discounts and taxes are applied. Amount in cents represented as whole integer.

    bank_code stringnullable

    A custom code provided by a bank you want to use for online banking payment methods

    branding

    object

    Details on branding elements to apply when rendering this Checkout Session.

    icon stringnullable

    A secure URL to an image icon

    logo stringnullable

    A secure URL to an image logo

    use_logo boolean

    Has the value of true if logo should be rendered in payment page or false if icon should be used.

    primary_color stringnullable

    A hex color code that will be used as background color of the payment page

    secondary_color stringnullable

    A hex color code that will be used as background color of the submit or PAY button

    billing

    Address

    nullable

    Address information collected from the customer.

    name string

    Customer name

    line1 string

    Address line 1 (e.g., house number, street, or company name).

    line2 string

    Address line 2 (e.g., apartment, suite, or building).

    barangay string

    Suburb, town, village, or district.

    city string

    City or municipality.

    state string

    State, county, province, or region.

    postal_code string

    ZIP or postal code.

    country string

    Two-letter ISO country code.

    billing_address_collection BillingAddressCollection (string)

    Possible values: [auto, required]

    Default value: auto

    Describes whether Checkout should collect the customer's billing address.

    cancel_url string

    The URL the customer will be directed to if they decide to cancel payment and return to your website.

    client_reference_id string

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

    created_at date-time

    The date and time the Checkout Session was created.

    currency string

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    customer string

    The ID of an existing customer that will be associated with this Checkout Session.

    customer_email string

    Email address of customer.

    customer_name string

    Name of customer.

    customer_name_collection boolean

    Describes whether Checkout should collect the customer's name.

    customer_phone string

    Phone number of customer.

    description string

    If provided, Checkout will use this value as description of the charge.

    expires_at date-time

    The date and time the Checkout Session will expire.

    last_updated date-time

    The date and time the Checkout Session was last updated.

    line_items

    object[]

    The line items purchased by the customer.

  • Array [

  • amount integerrequired

    Unit amount of the product in cents represented as a whole integer.

    description stringnullable

    A description of the product

    image stringnullable

    A secure URL to an image of the product

    name stringrequired

    The name of the product

    quantity integerrequired

    The quantity of the products being purchased

  • ]

  • livemode boolean

    Has the value of true if the object exists in live mode or the value of false if the object exists in test mode.

    locale string

    Possible values: [en]

    The IETF language tag of the locale Checkout is displayed in.

    merchant

    Merchant

    Contains the merchant details that created this Checkout Session

    name string

    Name of the merchant

    support_email stringnullable

    Email address of the merchant's support team

    support_phone stringnullable

    Phone number of the merchant's support team

    metadata

    object

    A set of key-value pairs that you can attach to a Checkout Session object.

    property name* string
    mode string

    Possible values: [payment]

    Default value: payment

    The mode of the Checkout Session.

    payment_details objectnullable

    The charge object details associated with the Checkout Session after successful payment.

    payment_method_types PaymentMethod (string)[]

    Possible values: [card, bpi, gcash, maya, alipay, unionpay, wechat]

    A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.

    payment_status
    payment_url string

    The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout.

    phone_number_collection boolean

    Describes whether Checkout should collect the customer's phone number.

    require_auth Require auth (boolean)

    Indicates whether 3D Secure authentication shall be required for card payments. Always have a value true.

    shipping

    Address

    nullable

    Address information collected from the customer.

    name string

    Customer name

    line1 string

    Address line 1 (e.g., house number, street, or company name).

    line2 string

    Address line 2 (e.g., apartment, suite, or building).

    barangay string

    Suburb, town, village, or district.

    city string

    City or municipality.

    state string

    State, county, province, or region.

    postal_code string

    ZIP or postal code.

    country string

    Two-letter ISO country code.

    shipping_address_collection

    object

    Describes whether Checkout should collect the customer's shipping address.

    allowed_countries string[]required

    A list of two-letter ISO country codes. Checkout will only collect shipping address from customers in these countries.

    submit_type string

    Possible values: [pay, book, donate, send]

    Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.

    success_url string

    The URL the customer will be directed to after a successful payment.

Loading...