Vtex API

Authentication

To authenticate your requests, you must include the following header in all your requests:

client_id: [client_id],
secret_token: [secret_token]

To test, you must request a key and token from the aCuotaz team.

It is mandatory to use https, to avoid sending your credentials in clear text through the web. If you don't, you will be redirected to the https version of Apurata, but your credentials will have already been compromised on the web.

Get payment-methods

It includes payment methods that we allow in our process.

URL: /payment-methods

Method: GET

Success Response:

Code: 200 OK
{
    "paymentMethods": [
        "aCuotaz",
        "CreditCard"
    ]
}

Sample curl:

curl 'https://apurata.com/payment-methods'

Get manifest

It includes the payment methods manifest that we allow in our process.

URL: /manifest

Method: GET

Success Response:

Code: 200 OK
{
    "paymentMethods": [
        {
            "name": "aCuotaz ",
            "allowSplit": "disabled "
        }
    ],
    "customFields": [
        {
            "name":"Client ID",
            "type":"text"
        },
        {
            "name":"Secret Token",
            "type":"text"
        },
        {
            "name":"Currency",
            "type":"select",
            "options":[
                {
                    "text":"PEN",
                    "value":"1"
                }
            ]
        }
    ]
}

Sample curl:

curl 'https://apurata.com/manifest'

To create an order

With this option, you create an order and receive a URL that redirects to the Apurata website to continue the process.

URL: /payments

Method: POST

Request body:

{
    paymentId: [string|required],
    reference: [string],
    orderId: [string],
    shopperInteraction: [string],
    transactionId: [string],
    paymentMethod: [string],
    paymentMethodCustomCode: [string],
    merchantName: [string],
    card: [dictionary],
    value: [float|required],
    currency: [string],
    installments: [integer],
    deviceFingerprint: [string],
    ipAddress: [string],
    miniCart: [dictionary],
    url: [string|valid url],
    callbackUrl: [string|valid url],
    returnUrl: [string|valid url],
}

Success Response:

Code: 200 OK
{
    "paymentId": [string],
    "status": "undefined",
    "authorizationId": [string],
    "nsu": [string],
    "tid": [string],
    "returnURL": "http://apurata.com/pos?client=[client_id]&order=[paymentId]",
}

To cancel an order

URL: /payments/[payment_id]/cancellations

Method: POST

Request body:

{
    "paymentId": [string],
    "requestId": [integer],
}

Success Response:

Code: 200 OK
{
    'paymentId': [string],
    'status': 'cancelled',
    'message': 'Successfully cancelled',
    'cancellationId': [string],
    'requestId': [integer],
    'code': 'refund-manually|SUCCESSFUL',
}

To capture an order

URL: /payments/[payment_id]/settlements

Method: POST

Request body:

{
    "paymentId": [string],
    "transactionId": [string],
    "requestId": [integer],
    "value": [integer],
}

Success Response:

Code: 200 OK
{
    'paymentId': [string],
    'settleId': [string]',
    'value': [integer],
    'requestId': [integer],
}

To refund an order

URL: /payments/[payment_id]/refunds

Method: POST

Request body:

{
    "paymentId": [string],
    "transactionId": [string],
    "settleId": [string],
    "requestId": [integer],
    "value": [integer],
}

Success Response:

Code: 200 OK
{
    'paymentId': [string],
    'status': 'cancelled',
    'message': 'Successfully refund',
    'requestId': [integer],
    'refundId': [string]
}