Making a purchase with an invoice

This guide will lead you to buy a product and apply the promo once it is into the cart. We assume you have a promo configured properly for being applied to the product you bought.

Please make sure you read the Conventions before continuing with this guide.

Prerequisites

You will need an X-API-KEY and a username and password to authenticate.

You will need an invoice provider previosuly created and configured.

Steps to complete a purchase

Follow steps 1 to 10 on making a reservation purchase

11) Complete buyer's info

The invoiceProvider that is set into the cart will define the buyer's fields that are neccesary for invoicing. This info will be in the invoiceInfo Object in this way. The body for this endpoint should be like this:

{
        "transactionId": "transactionId",
        "invoiceProviderId": "invoiceProviderId",
        "invoiceInfo": {
            "buyer": {
                "name": "name", 
                "type": "type", 
                "taxNumber": "taxNumber", 
                "address": "address", 
                "country": "country", 
                "province": "province", 
                "city": "city", 
                "zip": "zip", 
                "canton": "canton", 
                "district": "district"
            }
        }
    }

This buyer example is for Infile providers, to see which are the required fields for each provider please take a look at API documentation. The providers are GTI, DLINK, System and Infile at this moment.

12) Download Tickets (optional)

Continue with step 11 from making a reservation purchase.

13) Postman resources

If you would like to use Postman to test the API, we have included a collection you can use as a starting point below.

This Postman Collection is a complement for Making a reservation Purchase, because this will be only the last step of a transaction.

After importing the collection, make sure your collection is using the environment of Making a reservation Purchase, and that you have set the values. Variables that start with "YOUR_" will need to be replaced with a value specific to your situation. If you are going to be using our API in sandbox, please change the {{basePath}} environment variable to https://sandbox-api.betterez.com.

Postman Collection