Cancel purchase order
Cancel a purchase order
POST
/
admin
/
api
/
v1
/
purchases
/
purchase-orders
/
{id}
/
cancel
Cancel purchase order
curl --request POST \
--url https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": 1,
"name": "PO/1",
"description": "<p></p>",
"priority": "0",
"origin": null,
"partner_reference": "EH-1234",
"state": "purchase",
"invoice_status": "invoiced",
"receipt_status": "full",
"untaxed_amount": 35000,
"tax_amount": 5250,
"total_amount": 40250,
"total_cc_amount": 40250,
"currency_rate": 0,
"mail_reminder_confirmed": true,
"mail_reception_confirmed": false,
"mail_reception_declined": false,
"invoice_count": 0,
"ordered_at": "2026-01-08T12:53:13.000000Z",
"approved_at": "2026-01-08T12:56:13.000000Z",
"planned_at": "2026-03-11T00:00:00.000000Z",
"calendar_start_at": "2026-01-08T12:53:13.000000Z",
"incoterm_location": null,
"effective_date": null,
"report_grids": false,
"requisition_id": null,
"purchases_group_id": null,
"partner_id": 41,
"currency_id": 1,
"fiscal_position_id": null,
"payment_term_id": null,
"incoterm_id": null,
"user_id": 1,
"company_id": 1,
"creator_id": 1,
"operation_type_id": 1,
"created_at": "2026-01-08T12:55:43.000000Z",
"updated_at": "2026-01-08T12:56:52.000000Z"
},
"message": "Purchase order canceled successfully."
}{
"message": "Unauthenticated."
}{
"message": "Resource not found."
}{
"message": "Only non-locked and non-canceled purchase orders can be canceled."
}Authorizations
An API token from Sign in, sent as Authorization: Bearer <token>. Tokens last 30 days.
Response
Success
⌘I
Cancel purchase order
curl --request POST \
--url https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://erp.arukz.com/admin/api/v1/purchases/purchase-orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": 1,
"name": "PO/1",
"description": "<p></p>",
"priority": "0",
"origin": null,
"partner_reference": "EH-1234",
"state": "purchase",
"invoice_status": "invoiced",
"receipt_status": "full",
"untaxed_amount": 35000,
"tax_amount": 5250,
"total_amount": 40250,
"total_cc_amount": 40250,
"currency_rate": 0,
"mail_reminder_confirmed": true,
"mail_reception_confirmed": false,
"mail_reception_declined": false,
"invoice_count": 0,
"ordered_at": "2026-01-08T12:53:13.000000Z",
"approved_at": "2026-01-08T12:56:13.000000Z",
"planned_at": "2026-03-11T00:00:00.000000Z",
"calendar_start_at": "2026-01-08T12:53:13.000000Z",
"incoterm_location": null,
"effective_date": null,
"report_grids": false,
"requisition_id": null,
"purchases_group_id": null,
"partner_id": 41,
"currency_id": 1,
"fiscal_position_id": null,
"payment_term_id": null,
"incoterm_id": null,
"user_id": 1,
"company_id": 1,
"creator_id": 1,
"operation_type_id": 1,
"created_at": "2026-01-08T12:55:43.000000Z",
"updated_at": "2026-01-08T12:56:52.000000Z"
},
"message": "Purchase order canceled successfully."
}{
"message": "Unauthenticated."
}{
"message": "Resource not found."
}{
"message": "Only non-locked and non-canceled purchase orders can be canceled."
}