Saltar al contenido principal

CheckoutSession

idstring<uuid>required

Unique identifier for the checkout session.

Example: 4b1f7c2e-9d3a-4e6b-8f05-1a2c3d4e5f60
urlstring<uri>required

The page where the buyer pays the session. Send the buyer to it.

Example: https://secure.monei.com/checkout/4b1f7c2e-9d3a-4e6b-8f05-1a2c3d4e5f60
livemodebooleanrequired

Whether the session is in live mode.

Example: false
statusCheckoutSession-Statusrequired

The status of the session:

  • OPEN: the buyer can pay it at url.
  • COMPLETE: the buyer paid it. paymentId is the payment, and subscriptionId the subscription of a SUBSCRIPTION session.
  • EXPIRED: it reached expiresAt unpaid. Its subscription, if any, is canceled.

Possible values: [OPEN, COMPLETE, EXPIRED]

Example: OPEN
modeCheckoutSession-Moderequired

What paying the session creates: a payment only (PAYMENT), or a payment and a subscription (SUBSCRIPTION, when a line has a RECURRING price).

Possible values: [PAYMENT, SUBSCRIPTION]

Example: SUBSCRIPTION
currencystringrequired

Three-letter ISO currency code, in uppercase: the currency of every price of the session.

Example: EUR
lineItems object[]required

The lines of the session, in the order you sent them.

  • Array [
  • priceIdstring<uuid>required

    The price of the line.

    Example: 3c5a1f8e-2b7d-4e9a-9c41-7d2e6b0f5a13
    productIdstring<uuid>required

    The product of the price.

    Example: 8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60
    productNamestringrequired

    The product name.

    Example: Gold plan
    descriptionstring

    The product description.

    Example: Unlimited access to every course
    quantityinteger<int32>required

    The number of units.

    Example: 1
    unitAmountinteger<int32>required

    The amount of one unit, in the smallest currency unit. Without tax for an EXCLUSIVE price.

    Example: 1653
    typePrice-Typerequired

    How the price bills: RECURRING (the default) or ONE_TIME. Only a RECURRING price can start or switch a subscription. Treat the set as open: more values can be added later.

    Default value: RECURRING
    Example: RECURRING
    recurring object

    The billing period of a RECURRING price. Absent on a ONE_TIME price. A subscription created from the price copies these values.

    intervalPrice-Intervalrequired

    The unit of the billing period. minute and hour are accepted in test mode only.

    Possible values: [minute, hour, day, week, month, year]

    Example: month
    intervalCountinteger<int32>required

    Number of intervals between payments. The billing period cannot be longer than one year.

    Possible values: >= 1

    Example: 1
    trialPeriodDaysinteger<int32>

    Number of trial days of a subscription created from the price.

    Possible values: >= 1 and <= 1825

    Example: 7
    tax object

    The tax of a subscription, copied from the tax rate of its product when priceId was set. A later change of the product's tax rate does not change it: only a switch to a price does.

    taxRateIdstring<uuid>required

    Unique identifier for the tax rate.

    Example: 9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d
    displayNameTaxRate-DisplayNamerequired

    The name of the tax shown to the buyer.

    Possible values: non-empty and <= 50 characters

    Example: IVA
    percentageTaxRate-Percentagerequired

    The rate in percent, with up to 4 decimals. It cannot change after the tax rate is created.

    Possible values: >= 0 and <= 100

    Example: 21
    taxTypeTaxRate-TaxTyperequired

    The kind of tax: VAT, IGIC (Canary Islands) or IPSI (Ceuta and Melilla). It cannot change after the tax rate is created. Treat the set as open: more values can be added later.

    Default value: VAT
    Example: VAT
    behaviorTaxBehaviorrequired

    How the tax of the product's tax rate applies to unitAmount:

    • INCLUSIVE: unitAmount holds the tax.
    • EXCLUSIVE: the tax is added to unitAmount.

    No value means INCLUSIVE. Treat the set as open: more values can be added later.

    Example: EXCLUSIVE
    amountinteger<int32>required

    The tax part of the subscription amount, in the smallest currency unit. 0 for a 0% rate.

    Possible values: >= 0

    Example: 210
    billedInFirstPaymentbooleanrequired

    Whether the first payment charges the line. A recurring price with a trial is charged when the trial ends, so its line has false.

    Example: true
    amountSubtotalinteger<int32>required

    The line amount without tax, in the smallest currency unit.

    Example: 1653
    amountTaxinteger<int32>required

    The tax of the line, in the smallest currency unit.

    Example: 347
    amountTotalinteger<int32>required

    The line amount with tax, in the smallest currency unit.

    Example: 2000
  • ]
  • amountSubtotalinteger<int32>required

    The amount of the first payment without tax, in the smallest currency unit.

    Example: 3653
    amountTaxinteger<int32>required

    The tax of the first payment, in the smallest currency unit.

    Example: 767
    amountTotalinteger<int32>required

    The amount of the first payment, in the smallest currency unit. A recurring line with a trial is not charged in it: see billedInFirstPayment of the line.

    Example: 4420
    recurringAmountTotalinteger<int32>

    The amount of each renewal of the subscription, with tax, in the smallest currency unit. Absent on a PAYMENT session.

    Example: 2000
    orderIdCheckoutSession-OrderIdrequired

    The order ID of the payment. Up to 40 characters: ASCII letters, digits and _ @ . / # & + - (no spaces). When you omit it, MONEI generates 12 characters from A-Z and 0-9.

    Example: K7Q2M9XB4T1A
    descriptionCheckoutSession-Descriptionrequired

    The description of the payment. When you omit it, the product names.

    Example: Starter kit, Gold plan
    customerIdCheckoutSession-CustomerId

    A customer of your account. Without it, MONEI creates a customer for the buyer when they pay, with the details they type.

    Example: 9f1e2d3c-4b5a-4968-8776-655443322110
    billingAddressCollectionCheckoutSession-BillingAddressCollectionrequired

    Whether the checkout page asks the buyer for a billing address.

    Possible values: [OPTIONAL, REQUIRED]

    Default value: OPTIONAL
    Example: OPTIONAL
    businessPurchaseCheckoutSession-BusinessPurchaserequired

    Whether the buyer can pay as a company, with legal name, tax ID and full address:

    • DISABLED: only as an individual.
    • OPTIONAL: the buyer chooses.
    • REQUIRED: only as a company.

    A Spanish tax ID is checked.

    Possible values: [DISABLED, OPTIONAL, REQUIRED]

    Default value: DISABLED
    Example: OPTIONAL
    purchaserTypestring

    Who paid the session: a person (INDIVIDUAL) or a company with legal name and tax ID (BUSINESS). Set when the session is COMPLETE.

    Possible values: [INDIVIDUAL, BUSINESS]

    Example: BUSINESS
    successUrlstring<uri>required

    The page the buyer goes to after paying.

    Example: https://example.com/checkout/success
    cancelUrlstring<uri>

    The page the buyer goes to after leaving without paying.

    Example: https://example.com/cart
    paymentIdstring

    The latest payment the buyer started. A buyer can start a new payment after a failed one, so this changes until the session is COMPLETE.

    Example: af6029f80f5fc73a8ad2753eea0b1be0
    subscriptionIdstring<uuid>

    The subscription of a SUBSCRIPTION session. It exists once the buyer opens the url.

    Example: 575bcd84-09fc-4a6e-8c4c-f88b8eb90bfa
    expiresAtinteger<int64>required

    Time the session expires if it is not paid, from 30 minutes to 24 hours from now. The default is 24 hours from now. Measured in seconds since the Unix epoch.

    Example: 1794564000
    completedAtinteger<int64>

    Time the session became COMPLETE. Measured in seconds since the Unix epoch.

    Example: 1794478200
    expiredAtinteger<int64>

    Time the session became EXPIRED. Measured in seconds since the Unix epoch.

    Example: 1794564000
    metadataobject

    A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.

    Example: {"systemId":"12345"}
    createdAtinteger<int64>required

    Time at which the resource was created. Measured in seconds since the Unix epoch.

    Example: 1636366897
    updatedAtinteger<int64>

    Time at which the resource updated last time. Measured in seconds since the Unix epoch.

    Example: 1636366897
    CheckoutSession
    {
    "id": "4b1f7c2e-9d3a-4e6b-8f05-1a2c3d4e5f60",
    "url": "https://secure.monei.com/checkout/4b1f7c2e-9d3a-4e6b-8f05-1a2c3d4e5f60",
    "livemode": false,
    "status": "OPEN",
    "mode": "SUBSCRIPTION",
    "currency": "EUR",
    "lineItems": [
    {
    "priceId": "3c5a1f8e-2b7d-4e9a-9c41-7d2e6b0f5a13",
    "productId": "8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60",
    "productName": "Gold plan",
    "description": "Unlimited access to every course",
    "quantity": 1,
    "unitAmount": 1653,
    "type": "RECURRING",
    "recurring": {
    "interval": "month",
    "intervalCount": 1,
    "trialPeriodDays": 7
    },
    "tax": {
    "taxRateId": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
    "displayName": "IVA",
    "percentage": 21,
    "taxType": "VAT",
    "behavior": "EXCLUSIVE",
    "amount": 210
    },
    "billedInFirstPayment": true,
    "amountSubtotal": 1653,
    "amountTax": 347,
    "amountTotal": 2000
    }
    ],
    "amountSubtotal": 3653,
    "amountTax": 767,
    "amountTotal": 4420,
    "recurringAmountTotal": 2000,
    "orderId": "K7Q2M9XB4T1A",
    "description": "Starter kit, Gold plan",
    "customerId": "9f1e2d3c-4b5a-4968-8776-655443322110",
    "billingAddressCollection": "OPTIONAL",
    "businessPurchase": "OPTIONAL",
    "purchaserType": "BUSINESS",
    "successUrl": "https://example.com/checkout/success",
    "cancelUrl": "https://example.com/cart",
    "paymentId": "af6029f80f5fc73a8ad2753eea0b1be0",
    "subscriptionId": "575bcd84-09fc-4a6e-8c4c-f88b8eb90bfa",
    "expiresAt": 1794564000,
    "completedAt": 1794478200,
    "expiredAt": 1794564000,
    "metadata": {
    "systemId": "12345"
    },
    "createdAt": 1636366897,
    "updatedAt": 1636366897
    }