Skip to main content

Payment

The Payment object

idId (string)

Unique identifier for the object.

tenantTenantMode (string)

Has the value "live" if the object exists in live mode, or "sand" if it exists in test mode.

Possible values: [sand, live]

referenceIdnullable

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

modePayments.PaymentMode (string)

Mode of this Payment.

Possible values: [Payment, Wallet, Setup]

parentPaymentIdstringnullable

The ID of the parent Payment, if this Payment is a child payment (e.g., a wallet).

companyIdstringnullable

The ID of the Company this Payment is associated with.

customerIdstring

The ID of the Customer of this Payment.

customerEmailstring

The email address of the customer associated with this Payment.

customerFirstNamestring

The first name of the customer associated with this Payment.

customerLastNamestring

The last name of the customer associated with this Payment.

customerPhoneNumberstring

The phone number of the customer associated with this Payment.

customerPaymentMethodIdstringnullable

The ID of the Customer's PaymentMethod to attach to this Payment.

selectedPaymentGatewayIdstringnullable

Default PaymentGateway used for the first transaction.

checkoutUrlstringnullable

The URL where the customer should be redirected to complete the payment. This URL is provided after creating a Payment and should be used to redirect the customer to the Voucherly checkout page.

closeCheckout object

Information about when and whether the checkout was closed by the customer.

successboolean

Indicates whether the checkout was closed successfully (true) or cancelled (false).

datestring<date-time>

The UTC timestamp when the checkout was closed.

callback object

Information about the last callback sent to your callbackUrl endpoint.

successboolean

Indicates whether the callback was sent successfully (true) or failed (false).

datestring<date-time>

The UTC timestamp when the last callback was sent.

totalAmountinteger<int64>

The total amount of the payment before discounts, in cents. This is the sum of all line items.

discountAmountinteger<int64>

The total amount of discounts applied to the payment, in cents. This is the sum of all discount amounts.

finalAmountinteger<int64>

The final amount to be paid after applying all discounts, in cents. This is calculated as totalAmount - discountAmount.

paidAmountinteger<int64>

The total amount that has been paid so far, in cents. This includes both regular payments and voucher payments.

paidVoucherAmountinteger<int64>

The amount that has been paid using vouchers, in cents.

amountinteger<int64>

The remaining amount to be paid, in cents. This is calculated as finalAmount - paidAmount.

statusPayments.PaymentStatus (string)

Current status of the Payment.

Possible values: [Requested, Paid, Confirmed, Refunded, Cancelled, Voided, Expired]

metadata objectnullable

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. It can contain up to 10 key-value items with a maximum length of 40 for the key and of 400 chars for the value.

property name*string
transactions object[]

An array of Transaction objects representing all payment attempts and transactions associated with this Payment.

  • Array [
  • idstring<uuid>

    Unique identifier for the transaction.

    paymentGatewayIdstring

    The ID of the PaymentGateway used for this transaction.

    paymentGateway object

    Detailed information about the PaymentGateway used for this transaction.

    idstringnullable

    Unique identifier for the payment gateway.

    namestringnullable

    The display name of the payment gateway (e.g., "Visa", "Mastercard", "Edenred").

    typeinteger<int32>

    The type of payment gateway (0 = Card, 1 = Voucher, 2 = Other).

    Possible values: [0, 1, 2]

    paymentActionPaymentGateways.CheckoutAction (string)

    The type of checkout action required by this payment gateway.

    Possible values: [OTP, REDIRECT, DROPIN]

    imagestringnullable

    URL of the image to display for this payment gateway in the checkout.

    checkoutImagestringnullable

    URL of the image to display for this payment gateway in the checkout page.

    iconstringnullable

    URL of the icon to display for this payment gateway.

    minimumAmountinteger<int32>

    The minimum payment amount required for this payment gateway, in cents.

    isRefundablePartiallyboolean

    Indicates whether partial refunds are supported by this payment gateway.

    isTokenizableboolean

    Indicates whether payment methods can be saved (tokenized) for future use with this payment gateway.

    paymentGatewayParameters object[]nullable

    An array of configuration parameters for this payment gateway.

  • Array [
  • paymentGatewayIdstringnullable

    The ID of the payment gateway this parameter belongs to.

    parameterIdstringnullable

    The unique identifier of this parameter.

    friendlyNamestringnullable

    A human-readable name for this parameter.

    isMerchantboolean

    Indicates whether this parameter is configured at the merchant level.

    isFormboolean

    Indicates whether this parameter should be displayed as a form field.

    isVisibleboolean

    Indicates whether this parameter should be visible in the UI.

    isRequiredboolean

    Indicates whether this parameter is required.

    tenantDefaultValuestringnullable

    The default value for this parameter at the tenant level.

    options object[]nullable

    An array of available options for this parameter, if it's a select/dropdown type.

  • Array [
  • idstringnullable

    The unique identifier of this option.

    textstringnullable

    The display text for this option.

  • ]
  • ]
  • externalId1string

    The primary external transaction ID from the payment gateway provider.

    externalId2stringnullable

    An additional external transaction ID or reference from the payment gateway provider.

    externalId3stringnullable

    A third external transaction ID or reference from the payment gateway provider.

    isWalletboolean

    Indicates whether this transaction was paid using the customer's wallet balance.

    error object

    Error information if the transaction failed.

    codePayments.TransactionErrorCode (string)

    The type of error returned.

    Possible values: [Generic, Cancelled, NotCompleted, MissingPaymentMethod, Declined, System]

    externalError object

    Error information returned by an external payment gateway provider.

    messagestringnullable

    A human-readable error message from the payment gateway.

    codestringnullable

    An error code from the payment gateway provider.

    requestedAmountinteger<int32>

    The amount that was requested for this transaction, in cents.

    amountinteger<int64>

    The actual amount processed in this transaction, in cents.

    voucherAmountinteger<int64>

    The amount paid using vouchers in this transaction, in cents.

    noOfVouchersinteger<int32>nullable

    The number of vouchers used in this transaction.

    confirmedAmountinteger<int64>

    The amount that has been confirmed (captured) from this transaction, in cents.

    refundedAmountinteger<int64>

    The amount that has been refunded from this transaction, in cents.

    currencystring

    The currency code for this transaction (e.g., "EUR", "USD").

    creditCard object

    If this is a card PaymentMethod, this contains the user’s card details.

    brandstring

    Card brand

    panstring

    Card masked PAN

    expirationstring

    The card's expiration date, typically in MM/YY format.

    expirationMonthinteger<int32>

    Two-digit number representing the card’s expiration month.

    expirationYearinteger<int32>

    Four-digit number representing the card’s expiration year.

    productstring

    The card product type (e.g., "Visa Classic", "Mastercard Gold").

    directDebit object

    If this is a sepa_debit PaymentMethod, this contains the user’s card details.

    accountIdstring

    ID of the bank account.

    accountBicstring

    BIC of the bank account.

    accountIbanstring

    IBAN of the bank account.

    holderEmailstringnullable

    The email address of the payment method holder for this transaction.

    holderNamestringnullable

    The name of the payment method holder for this transaction.

    statusPayments.TransactionStatus (string)

    The current status of this transaction.

    Possible values: [Requested, Paid, Confirmed, Refunded, RefundedPartially, Cancelled, Failed, Voided, Expired, Reversed, ImpossibleRefund, NextAction]

    request object

    Information about the payment request, including any redirect URL or action required.

    actionPaymentGateways.CheckoutAction (string)

    The type of checkout action required to complete the payment.

    Possible values: [OTP, REDIRECT, DROPIN]

    externalTransactionIdstring

    The unique identifier of the transaction in the external payment gateway system.

    urlstringnullable

    The URL to redirect the customer to, if the action is REDIRECT. This URL is provided by the payment gateway.

    property name*any

    Information about the payment request, including any redirect URL or action required.

  • ]
  • lines object[]

    An array of PaymentLine objects representing the line items (products or services) included in this Payment.

  • Array [
  • quantityinteger<int32>

    The quantity of the line item being purchased.

    productIdstringnullable

    The ID of the Product that this PaymentLine will belong to. One of productId or productName is required. When productId is provided, all other product-related fields will be ignored, as their values will be automatically loaded from the Product.

    productNamestringnullable

    The product’s name, meant to be displayable to the customer. One of productId or productName is required.

    productVariantstringnullable

    The product’s variant description, meant to be displayable to the customer.

    productImagestringnullable

    The product’s image, meant to be displayable to the customer.

    unitAmountinteger<int32>

    A non-negative integer in cents representing how much to charge for each individual unit.

    unitDiscountAmountinteger<int32>

    A non-negative integer in cents representing the discount applied to each individual unit. This field is mutually exclusive with discountAmount — only one of the two may be specified.

    discountAmountinteger<int32>

    A non-negative integer in cents representing the total discount applied to the entire line. This field is mutually exclusive with unitDiscountAmount — only one of the two may be specified.

    finalAmountinteger<int64>

    A non-negative integer in cents representing how much to charge.

    taxRatenumber<double>nullable

    The product's applicable tax rate.

    isFoodboolean

    Indicates whether this payment line refers to a food item. This flag is used to determine eligibility for meal vouchers or similar benefits.

    modifiers object[]nullable
  • Array [
  • modifierIdstring

    The ID of the Modifier that this customization will belong to.

    productIdstring

    The ID of the Product that this customization will belong to.

    productNamestring

    The name of the modifier product, automatically loaded from the Product.

    quantityinteger

    The quantity of this modifier.

    priceinteger

    The price of this modifier, in cents.

  • ]
  • ]
  • discounts object[]

    An array of PaymentDiscount objects representing all discounts applied to this Payment.

  • Array [
  • discountNamestring

    The discount’s name, meant to be displayable to the customer.

    discountDescriptionstringnullable

    The discount’s description. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.

    amountinteger<int32>

    A non-negative integer in cents representing how much to subtract from the total. Must be specified when both type and value are null.

    typePayments.DiscountType (string)

    Defines how the discount is calculated:

    • DOLLAROFF: A fixed amount in cents is subtracted from the total.
    • PERCENOFF: A percentage of the total amount is subtracted.
    • FIXED: The final price is set to a fixed amount, overriding the original total.

    Possible values: [DOLLAROFF, PERCENOFF, FIXED]

    valueinteger<int32>nullable

    The value of the discount, contextual to the selected type. Must be specified when type is provided and amount is null.

    indexinteger<int32>nullable

    Defines the application order of this discount relative to others.

  • ]
  • property name*any

    The Payment object

    Payment
    {
    "id": "string",
    "tenant": "sand",
    "mode": "Payment",
    "parentPaymentId": "string",
    "companyId": "string",
    "customerId": "string",
    "customerEmail": "string",
    "customerFirstName": "string",
    "customerLastName": "string",
    "customerPhoneNumber": "string",
    "customerPaymentMethodId": "string",
    "selectedPaymentGatewayId": "string",
    "checkoutUrl": "string",
    "closeCheckout": {
    "success": true,
    "date": "2024-07-29T15:51:28.071Z"
    },
    "callback": {
    "success": true,
    "date": "2024-07-29T15:51:28.071Z"
    },
    "totalAmount": 0,
    "discountAmount": 0,
    "finalAmount": 0,
    "paidAmount": 0,
    "paidVoucherAmount": 0,
    "amount": 0,
    "status": "Requested",
    "metadata": {},
    "transactions": [
    {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "paymentGatewayId": "string",
    "paymentGateway": {
    "id": "string",
    "name": "string",
    "type": 0,
    "paymentAction": "OTP",
    "image": "string",
    "checkoutImage": "string",
    "icon": "string",
    "minimumAmount": 0,
    "isRefundablePartially": true,
    "isTokenizable": true,
    "paymentGatewayParameters": [
    {
    "paymentGatewayId": "string",
    "parameterId": "string",
    "friendlyName": "string",
    "isMerchant": true,
    "isForm": true,
    "isVisible": true,
    "isRequired": true,
    "tenantDefaultValue": "string",
    "options": [
    {
    "id": "string",
    "text": "string"
    }
    ]
    }
    ]
    },
    "externalId1": "string",
    "externalId2": "string",
    "externalId3": "string",
    "isWallet": true,
    "error": {
    "code": "Generic",
    "externalError": {
    "message": "string",
    "code": "string"
    }
    },
    "requestedAmount": 0,
    "amount": 0,
    "voucherAmount": 0,
    "noOfVouchers": 0,
    "confirmedAmount": 0,
    "refundedAmount": 0,
    "currency": "string",
    "creditCard": {
    "brand": "string",
    "pan": "string",
    "expiration": "string",
    "expirationMonth": 0,
    "expirationYear": 0,
    "product": "string"
    },
    "directDebit": {
    "accountId": "string",
    "accountBic": "string",
    "accountIban": "string"
    },
    "holderEmail": "string",
    "holderName": "string",
    "status": "Requested",
    "request": {
    "action": "OTP",
    "externalTransactionId": "string",
    "url": "string"
    }
    }
    ],
    "lines": [
    {
    "quantity": 0,
    "productId": "string",
    "productName": "string",
    "productVariant": "string",
    "productImage": "string",
    "unitAmount": 0,
    "unitDiscountAmount": 0,
    "discountAmount": 0,
    "finalAmount": 0,
    "taxRate": 0,
    "isFood": true,
    "modifiers": [
    {
    "modifierId": "string",
    "productId": "string",
    "productName": "string",
    "quantity": 0,
    "price": 0
    }
    ]
    }
    ],
    "discounts": [
    {
    "discountName": "string",
    "discountDescription": "string",
    "amount": 0,
    "type": "DOLLAROFF",
    "value": 0,
    "index": 0
    }
    ]
    }