API Reference

Single Payment object

A Single Payment is a service that your customers can purchase once, not like a subscription that is recurring over time. There are two ways to create a Single Payment, assign products that were already created or create the product(s) within the request. For the first option, the existant Product's ID's must be sent, alongside the quantity of each of them. For the second option, all the information of the product must be sent in order to create the product. This information is the same as required on the product object. The quantity of each product is required as well. Examples of both cases can be found below. You can also assign different payment options to the Single Payment which are mentioned below in the attributes.

A Single Payment may have extra fields that are data that are requested from the customer when buying the Single Payment, in addition to their name and email, which are always requested.

{
    "single_payment": {
        "name": "SummerFest pack",
        "extra_fields": [
            {
                "question": "Age",
                "mandatory": "true"
            }
        ]
    },
    "products": [
        {
            "id": "0d27afe0-7a02-41e1-9494-a955c21c0a3a",
            "quantity": 1
        }
    ]
}
{
    "single_payment": {
        "name": "December concert",
        "extra_fields": [
            {
                "question": "Age",
                "mandatory": "true"
            }
        ]
    },
    "products": [
        {
            "name": "Concert Ticket",
            "description": "Common ticket for concerts",
            "value": 20000,
            "external_id": "001",
            "quantity": 1
        }
    ]
}

Attributes

The attributes available to a Single Payment object are:

NameTypeDescriptionRequired
idstringSingle Payment unique identifier.false
namestringName of the Single Payment you want to create.true
descriptionstringA description for the Single Payment.false
stock_limitnumberIf the Single Payment is single you can define a stock limit for purchases.false
limit_datedatetimeIf the Single Payment is single you can define a date for stop accepting purchases for the Product (in ISO 8601 format).false
statusstringThe status of the Single Payment. It can be "active" (default) or "inactive".false
is_basketablebooleanIf you want your customers to be able to buy more than one Single Payment at the same time (default false).false
success_urlstringA URL to redirect your clients when the payment of the Single Payment is successful.false
failure_urlstringA URL to redirect your clients when the payment of the Single Payment fails.false
imagefileAn image for the Single Payment you want to create.false
extra_fieldsarray of jsonExtra fields that your customers can fill out when buying or subscribing to the Single Payment (Independent of these extra fields, the email and the name are always requested). The json has scpecific values:
- question (string): The name of the extra field.
- mandatory (boolean): If the extra field is mandatory to answer (default false).
false
external_idstringAn external id to identify the Single Payment.false