The creation of the checkout will be done by means of a POST request to the Aplazame server.
If you are starting the integration you may be interested in how to set the test mode as well as test data available for the integration.
Installment payment
POST https://api.aplazame.com/checkout
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyContent-Type: application/json{"merchant":{...},"order":{...},"customer":{...},"billing":{...},"shipping":{...}}
POST https://api.aplazame.com/checkout
Accept: application/vnd.aplazame.sandbox.v1+json
Authorization: Bearer api_private_keyContent-Type: application/json{"merchant":{...},"order":{...},"customer":{...},"billing":{...},"shipping":{...}}
$privateKey='api_private_key';$environment= Aplazame\Api\Client::ENVIRONMENT_SANDBOX;$apiBaseUri='https://api.aplazame.com';$aplazameApiClient=newAplazame\Api\Client($apiBaseUri,$environment,$privateKey);$order_created=$aplazameApiClient->post('/checkout',$payload);// checkout how to create the payload:// https://github.com/aplazame/php-sdk/blob/master/examples/step1_checkout_create.php#L39
POST https://api.aplazame.com/checkout
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyContent-Type: application/json{"merchant":{...},"order":{...},"customer":{...},"billing":{...},"shipping":{...},"product":{"type":"pay_later"}}
POST https://api.aplazame.com/checkout
Accept: application/vnd.aplazame.sandbox.v1+json
Authorization: Bearer api_private_keyContent-Type: application/json{"merchant":{...},"order":{...},"customer":{...},"billing":{...},"shipping":{...},"product":{"type":"pay_later"}}
$privateKey='api_private_key';$environment= Aplazame\Api\Client::ENVIRONMENT_SANDBOX;$apiBaseUri='https://api.aplazame.com';$aplazameApiClient=newAplazame\Api\Client($apiBaseUri,$environment,$privateKey);$order_created=$aplazameApiClient->post('/checkout',$payload);// checkout how to create the payload:// https://github.com/aplazame/php-sdk/blob/master/examples/step1_checkout_create.php#L39
Product type. If this parameter is not indicated, the type is installments by default
Pay in 4
POST https://api.aplazame.com/checkout
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyContent-Type: application/json{"merchant":{...},"order":{...},"customer":{...},"billing":{...},"shipping":{...},"product":{"type":"pay_in_4"}}
POST https://api.aplazame.com/checkout
Accept: application/vnd.aplazame.sandbox.v1+json
Authorization: Bearer api_private_keyContent-Type: application/json{"merchant":{...},"order":{...},"customer":{...},"billing":{...},"shipping":{...},"product":{"type":"pay_in_4"}}
$privateKey='api_private_key';$environment= Aplazame\Api\Client::ENVIRONMENT_SANDBOX;$apiBaseUri='https://api.aplazame.com';$aplazameApiClient=newAplazame\Api\Client($apiBaseUri,$environment,$privateKey);$order_created=$aplazameApiClient->post('/checkout',$payload);// checkout how to create the payload:// https://github.com/aplazame/php-sdk/blob/master/examples/step1_checkout_create.php#L39
URL (relating to the store) to which the user will be redirected when payment has been denied.
close_on_success
boolean
no
Indicates whether the checkout automatically redirects you to the success_url in case of success. ( by default: false )
timeout_checkout
integer
no
It establishes the maximum time, in minutes, that the user has to complete the checkout process. (by default 60; min. 1; max. 120 )
timeout_extra
integer
no
It establishes the additional time, in minutes, that the user has to complete the identity validation task once the checkout process is finished. ( by default 2880; min. 0; max. 2880 )
order
{"id":"28475648233786783165","articles":[{"id":"89793238462643383279","name":"18 ct white gold watch with diamonds","quantity":2,"price":402000,"tax_rate":2100,"discount_rate":200,"description":"High-precision quartz movement","url":"http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083","image_url":"http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg"},
...
],"discount":16000,"currency":"EUR","total_amount":462000,"options":{...},}
All order items must have a tax rate tax_rate. You can include this rate globally in order.tax_rate or you can choose to apply the rate to each individual item and shipping.
It allows defining the date on which the purchased product will be enjoyed, for example: date of a trip or start of a course.
article
{"id":"89793238462643383279","name":"18 ct white gold watch with diamonds","quantity":2,"price":402000,"tax_rate":2100,"discount_rate":200,"description":"High-precision quartz movement","url":"http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083","image_url":"http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg"}
{"id":"1618","email":"customer@address.com","type":"e","gender":0,"first_name":"John","last_name":"Coltrane","birthday":"1980-01-01","phone":"601234567","language":"en","date_joined":"2014-08-21T13:56:45+0000","last_login":"2020-08-27T19:57:56+0000","address":{"phone":"601234567","street":"Plaza del Valle Boreal nº10","address_addition":"Near Pontiff Sulyvahn's Plaza","city":"Madrid","state":"Madrid","country":"ES","postcode":"28080"}}
Parameter
Type
Required
Description
id
string
no
Customer ID
email
string
yes
Customer email
type
char
no
Customer type; the choices are g guest, n new, e existing.
gender
integer
no
Gender; the choices are 0 not known, 1 male, 2 female, 3 not applicable.
{"phone":"601234567","street":"Plaza del Valle Boreal nº10","address_addition":"Near Pontiff Sulyvahn's Plaza","city":"Madrid","state":"Madrid","country":"ES","postcode":"28080"}
{"first_name":"Bill","last_name":"Evans","phone":"601765432","street":"Calle Central Yharnam 92","address_addition":"Near Great Bridge","city":"Madrid","state":"Madrid","country":"ES","postcode":"28080"}
{"first_name":"Django","last_name":"Reinhard","phone":"601234567","street":"Plaza del Valle Boreal nº10","address_addition":"Near Pontiff Sulyvahn's Plaza","city":"Madrid","state":"Madrid","country":"ES","postcode":"28080","price":500,"tax_rate":2100,"name":"Planet Express","discount":100,"method":"postal"}