Create order
To authenticate your requests see our authentication
URL: /pos/order/create
Method: POST
Data constraints
amount
(Float/Required)
Total amount of the purchase to finance
acuotaz_send_sms
(Bool/Optional/Default=False)
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
(String/Required/Unique)
Order id generated by your store which will be used to identify the order when we send information back to you
expiration_ts
(String(offset=utc0)/Optional)
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.
pos_client_id
(String/Required)
Client id provided by us to identify your store
description
(String/Optional)
Field to specify what is being purchased in this order.
url_redir_on_canceled
(URL/Required)
URL of your store to redirect when the aCuotaz application is canceled so the customer can select another payment method
url_redir_on_rejected
(URL/Required)
URL of your store to redirect when the aCuotaz application is rejected so the customer can select another payment method
url_redir_on_success
(URL/Required)
URL of your store to redirect when the aCuotaz application is successful. This is usually the order paid details.
url_redir_on_downpayment
(URL/Required)
Merchant URL to redirect the customer when he wants to pay the down payment in the e-commerce.
url_redir_on_order_detail
(URL/Optional)
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.
-
customer_6m_payment
(List of Dict/Optional)
Here you must send the customer’s last 6 month payments to your store. Each item has the following parameters:-
dni
(String/Required) -
amount
(String/Required) -
payment_time
(String(offset=utc0)/Required) -
payment_detail
(String/Required) -
subscription_plan
(Bool/Required)
-
-
customer_data
(Dict/Optional)
Dictionary with user data. The fields available to use are described below.
NOTE: The following parameters are to facilitate data entry in the steps of our funnel. It is important to send all the fields you have available.-
address
(String/Optional) -
dni
(String/Optional) -
email
(String/Optional) -
name
(String/Optional) -
phone
(String/Optional) -
billing_address_1
(String/Optional) -
billing_address_2
(String/Optional) -
billing_city
(String/Optional) -
billing_company
(String/Optional) -
billing_first_name
(String/Optional) -
billing_last_name
(String/Optional) -
shipping_address_1
(String/Optional) -
shipping_address_2
(String/Optional) -
shipping_city
(String/Optional) -
shipping_company
(String/Optional) -
shipping_first_name
(String/Optional) -
shipping_last_name
(String/Optional)
-
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" }