A capture must be made when the product or products are sent with the import of the total price of the sale. The amount of the capture must be the total amount of the order less total amount of the canceled items.
PUT /orders/:orderId HTTP/1.1Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyHost: api.aplazame.com
Content-Type: application/json{"order":{"shipping":{"first_name":"Django","last_name":"Reinhard","phone":"616123456","alt_phone":"+34917909930","street":"Plaza del Angel nº10","address_addition":"Cerca de la plaza Santa Ana","city":"Madrid","state":"Madrid","country":"ES","postcode":"28012","price":500,"tax_rate":2100,"name":"Planet Express","discount":100},"articles":[{"id":"59825349042875546873","name":"N°5 eau premiere spray","description":"A decidedly lighter, fresher...","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","quantity":1,"price":29000,"tax_rate":2100}],"discount":300,"currency":"EUR","total_amount":31080}}
import aplazame_sdk
payload ={"order":{"shipping":{"first_name":"Django","last_name":"Reinhard","phone":"616123456","alt_phone":"+34917909930","street":"Plaza del Angel nº10","address_addition":"Cerca de la plaza Santa Ana","city":"Madrid","state":"Madrid","country":"ES","postcode":"28012","price":500,"tax_rate":2100,"name":"Planet Express","discount":100},"articles":[{"id":"59825349042875546873","name":"N°5 eau premiere spray","description":"A decidedly lighter, fresher...","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","quantity":1,"price":29000,"tax_rate":2100}],"discount":300,"currency":"EUR","total_amount":31080}}
client = aplazame_sdk.Client('api_private_key')
response = client.update(':orderId', payload)
<?phpuseAplazame\Api\Clientas AplazameClient;$payload=["order"=>["shipping"=>["first_name"=>"Django","last_name"=>"Reinhard","phone"=>"616123456","alt_phone"=>"+34917909930","street"=>"Plaza del Angel nº10","address_addition"=>"Cerca de la plaza Santa Ana","city"=>"Madrid","state"=>"Madrid","country"=>"ES","postcode"=>"28012","price"=> Aplazame\Serializer\Decimal::fromFloat(5)->value,"tax_rate"=> Aplazame\Serializer\Decimal::fromFloat(21)->value,"name"=>"Planet Express","discount"=> Aplazame\Serializer\Decimal::fromFloat(1)->value,],"articles"=>[["id"=>"59825349042875546873","name"=>"N°5 eau premiere spray","description"=>"A decidedly lighter, fresher...","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","quantity"=>1,"price"=> Aplazame\Serializer\Decimal::fromFloat(290)->value,"tax_rate"=> Aplazame\Serializer\Decimal::fromFloat(21)->value,],],"discount"=> Aplazame\Serializer\Decimal::fromFloat(3)->value,"currency"=>"EUR","total_amount"=> Aplazame\Serializer\Decimal::fromFloat(310.80)->value,],];$aplazameClient=newAplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION,"api_private_key");$result=$aplazameClient->put("/orders/{$orderId}",$payload);
usingAplazame.Api;
use Aplazame\Api\Client asAplazameClient;dynamic payload =new{
order =new{
shipping =new{
first_name ="Django",
last_name ="Reinhard",
phone ="616123456",
alt_phone ="+34917909930",
street ="Plaza del Angel nº10",
address_addition ="Cerca de la plaza Santa Ana",
city ="Madrid",
state ="Madrid",
country ="ES",
postcode ="28012",
price = Aplazame.Serializer.DecimalType.FromDecimal(5),
tax_rate = Aplazame.Serializer.DecimalType.FromDecimal(21),
name ="Planet Express",
discount = Aplazame.Serializer.DecimalType.FromDecimal(1),},
articles =newdynamic[]{new{
id ="59825349042875546873",
name ="N°5 eau premiere spray",
description ="A decidedly lighter, fresher...",
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",
quantity =1,
price = Aplazame.Serializer.DecimalType.FromDecimal(290),
tax_rate = Aplazame.Serializer.DecimalType.FromDecimal(21),},},
discount = Aplazame.Serializer.DecimalType.FromDecimal(3),
currency ="EUR",
total_amount = Aplazame.Serializer.DecimalType.FromDecimal(310.80),},};Client client =newClient("https://api.aplazame.com", Client.EnvironmentProduction,"api_private_key");dynamic result = client.Put($"/orders/{orderId}", payload);
An order accepts several partial voids only if the sum of the amount does not exceed the total of the original order. If the total amount is void, the order will be canceled.
01. Check voids
GET /orders/:orderId/void HTTP/1.1Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyHost: api.aplazame.com
To make a refund, It will be done in one way or another depending on the type of operation
Check remaining amount
Refund online financing
An order accepts several partial returns only if the sum of the amount does not exceed the total of the original order. If the total amount is refunded, the order will be canceled.
Each partial refund operation affects the amount of future loan instalments. The amount of the refund will be reflected in the store’s commercial transactions and may include a refund of the amount to the buyer.
01. Check remaining amount
GET /orders/:orderId/refund HTTP/1.1Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyHost: api.aplazame.com
Once the order has been cancelled, it cannot be modified.
The cancellation amount will show up in the store’s commercial transactions and a full refund will be given for the amounts previously paid by the buyer.
POST /orders/:orderId/cancel HTTP/1.1Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyHost: api.aplazame.com
usingAplazame.Api;Client client =newClient("https://api.aplazame.com", Client.EnvironmentProduction,"api_private_key");dynamic result = client.Post($"/orders/{orderId}/cancel",new{});
Parameter
Type
Required
Description
:orderId
string
yes
Order ID.
Response
HTTP/1.1 204 No ContentX-Aplazame-Media-Type: aplazame.v1
History
It is recommended that this be sent asynchronously so as not to delay the loading of the template.
POST /orders/:orderId/history HTTP/1.1Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_keyHost: api.aplazame.com
Content-Type: application/json[{"id":"18857527248912279381","amount":12080,"due":"","status":"cancelled","type":"paypal","order_date":"2014-03-21T13:56:45+0000","currency":"EUR","billing":null,"shipping":{"first_name":"Django","last_name":"Reinhard","phone":"616123456","alt_phone":"+34917909930","street":"Plaza del Angel nº10","address_addition":"Cerca de la plaza Santa Ana","city":"Madrid","state":"Madrid","country":"ES","postcode":"28012","price":500,"tax_rate":2100,"name":"Planet Express","discount":100}}]
import aplazame_sdk
payload =[{"id":"18857527248912279381","amount":12080,"due":"","status":"cancelled","type":"paypal","order_date":"2014-03-21T13:56:45+0000","currency":"EUR","billing":None,"shipping":{"first_name":"Django","last_name":"Reinhard","phone":"616123456","alt_phone":"+34917909930","street":"Plaza del Angel nº10","address_addition":"Cerca de la plaza Santa Ana","city":"Madrid","state":"Madrid","country":"ES","postcode":"28012","price":500,"tax_rate":2100,"name":"Planet Express","discount":100}}]
client = aplazame_sdk.Client('api_private_key')
response = client.history(':orderId', payload)
<?phpuseAplazame\Api\Clientas AplazameClient;$payload=[["id"=>"18857527248912279381","amount"=> Aplazame\Serializer\Decimal::fromFloat(120.80)->value,"due"=>"","status"=>"cancelled","type"=>"paypal","order_date"=> Aplazame\Serializer\Date::fromDateTime(newDateTime("2014-03-21 13:56:45"))->value,"currency"=>"EUR","billing"=>null,"shipping"=>["first_name"=>"Django","last_name"=>"Reinhard","phone"=>"616123456","alt_phone"=>"+34917909930","street"=>"Plaza del Angel nº10","address_addition"=>"Cerca de la plaza Santa Ana","city"=>"Madrid","state"=>"Madrid","country"=>"ES","postcode"=>"28012","price"=> Aplazame\Serializer\Decimal::fromFloat(5)->value,"tax_rate"=> Aplazame\Serializer\Decimal::fromFloat(21)->value,"name"=>"Planet Express","discount"=> Aplazame\Serializer\Decimal::fromFloat(1)->value,],],];$aplazameClient=newAplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION,"api_private_key");$result=$aplazameClient->post("/orders/{$orderId}/history",$payload);
usingAplazame.Api;dynamic payload =[["id"=>"18857527248912279381","amount"=> Aplazame.Serializer.DecimalType.FromDouble(120.80),"due"=>"","status"=>"cancelled","type"=>"paypal","order_date"=> Aplazame.Serializer.DateType.FromDateTime(DateTime.Parse("2014-03-21 13:56:45")),"currency"=>"EUR","billing"=>null,"shipping"=>["first_name"=>"Django","last_name"=>"Reinhard","phone"=>"616123456","alt_phone"=>"+34917909930","street"=>"Plaza del Angel nº10","address_addition"=>"Cerca de la plaza Santa Ana","city"=>"Madrid","state"=>"Madrid","country"=>"ES","postcode"=>"28012","price"=> Aplazame.Serializer.DecimalType.FromDouble(5),"tax_rate"=> Aplazame.Serializer.DecimalType.FromDouble(21),"name"=>"Planet Express","discount"=> Aplazame.Serializer.DecimalType.FromDouble(1),],],];Client client =newClient("https://api.aplazame.com", Client.EnvironmentProduction,"api_private_key");dynamic result = client.Post($"/orders/{orderId}/history", payload);