Create order

To authenticate your requests see our authentication

URL: /pos/order/create

Method: POST

Data constraints

Total amount of the purchase to finance

Boolean parameter to specify whether aCuotaz is responsible for sending the credit assessment application link to the customer after the order is created.

Order id generated by your store which will be used to identify the order when we send information back to you

Format: YYYY-MM-DD hh:mm:ss.mmm

Exact date on which the order will no longer be valid.

IMPORTANT: Make sure that the timezone is UTC-0. To get the correct time, you can reduce 5 hours to peru timezone.

Client id provided by us to identify your store

Field to specify what is being purchased in this order.

URL of your store to redirect when the aCuotaz application is canceled so the customer can select another payment method

URL of your store to redirect when the aCuotaz application is rejected so the customer can select another payment method

URL of your store to redirect when the aCuotaz application is successful. This is usually the order paid details.

Merchant URL to redirect the customer when he wants to pay the down payment in the e-commerce.

Merchant URL to redirect the customer when he wants to see the purchased order details. This is usually the profile tab that shows paid orders.

Success Response:

Code: 200 OK
{
    redirect_to: "https://apurata.com/pos?client={client_id}&acuotaz_order={ObjectId()}",
    status: "new_order"|"already_created"
}

If a new id is sent, the order will be created and the "new_order" status will be returned. In case you try to create an order with an existing id, the status "already_created" will be returned. In both cases the "redirect_to" field will be returned.

Sample curl:

curl -X POST 'https://apurata.com/pos/order/create' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {secret_token}' \
    --data-raw $'{
        "amount": 123.30,
        "order_id": "001",
        "pos_client_id": "tecno-tiendaz",
        "description": "name:product x, total:200",
        "url_redir_on_canceled": "https://tecnotiendaz.com/checkout",
        "url_redir_on_rejected": "https://tecnotiendaz.com/checkout",
        "url_redir_on_success": "https://tecnotiendaz.com/order_paid",
        "customer_data":{
            "address": "Dir. 123",
            "dni": "14159265",
            "email": "example@example.com",
            "name": "Example ",
            "phone": "99999999",
            "billing_city": "Lima"
        },
        "customer_6m_payment":{
            [
                    {
                        "dni": "14159265",
                        "amount": 200,
                        "payment_due_date": "2021-09-30",
                        "payment_date": "2021-09-30",
                        "payment_detail": "what is that payment?",
                        "subscription_plan": True/False
                    },{
                        "dni": "14159265",
                        "amount": 200,
                        "payment_due_date": "2021-08-30",
                        "payment_date": "2021-08-30",
                        "payment_detail": "what is that payment?",
                        "subscription_plan": True/False
                    },{
                        "dni": "14159265",
                        "amount": 200,
                        "payment_due_date": "2021-07-30",
                        "payment_date": "2021-07-30",
                        "payment_detail": "what is that payment?",
                        "subscription_plan": True/False
                    },...
            ]
        }
    }'

Error Responses:

Code: 401 UNAUTHORIZED
{ error: "Wrong or missing client token" }

Code: 400 BAD REQUEST
{ error: "Validation error, field XXXX required, etc." }

Code: 400 BAD REQUEST
{ error: "Client not registered" }

Code: 400 BAD REQUEST
{ error: "Cannot modify order" }