curl --request POST \
--url https://api-v2.riqra.com/public/v1/orders/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "INVENTORY",
"note": "<string>",
"restock": true,
"notifyCustomer": true
}
'import requests
url = "https://api-v2.riqra.com/public/v1/orders/{id}/cancel"
payload = {
"reason": "INVENTORY",
"note": "<string>",
"restock": True,
"notifyCustomer": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'INVENTORY', note: '<string>', restock: true, notifyCustomer: true})
};
fetch('https://api-v2.riqra.com/public/v1/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://api-v2.riqra.com/public/v1/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_POSTFIELDS => json_encode([
'reason' => 'INVENTORY',
'note' => '<string>',
'restock' => true,
'notifyCustomer' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.riqra.com/public/v1/orders/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"INVENTORY\",\n \"note\": \"<string>\",\n \"restock\": true,\n \"notifyCustomer\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-v2.riqra.com/public/v1/orders/{id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"INVENTORY\",\n \"note\": \"<string>\",\n \"restock\": true,\n \"notifyCustomer\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.riqra.com/public/v1/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"INVENTORY\",\n \"note\": \"<string>\",\n \"restock\": true,\n \"notifyCustomer\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": "<string>",
"status": "AWAITING_REVIEW",
"paymentStatus": "UNPAID",
"fulfillmentStatus": "UNFULFILLED",
"source": "STOREFRONT",
"createdAt": "2026-06-30T14:12:00Z",
"updatedAt": "2026-06-30T14:12:00Z",
"placedAt": "2026-06-30T14:12:00Z",
"cancelledAt": "2026-06-30T14:12:00Z",
"placedAsGuest": true,
"comment": "<string>",
"purchaseOrderNumber": "<string>",
"currencyCode": "USD",
"subtotal": "1234.56",
"taxTotal": "1234.56",
"taxLines": [
{
"name": "<string>",
"code": "<string>",
"ratePercent": "19.00",
"base": "1234.56",
"amount": "1234.56"
}
],
"shippingTotal": "1234.56",
"shippingTaxTotal": "1234.56",
"discountTotal": "1234.56",
"total": "1234.56",
"priceList": {
"id": "<string>",
"name": "<string>"
},
"segment": {
"id": "<string>",
"name": "<string>"
},
"location": {
"id": "<string>",
"name": "<string>"
},
"shippingMethod": {
"id": "<string>",
"type": "DELIVERY",
"label": "<string>",
"payment": "PREPAID"
},
"courier": {
"id": "<string>",
"name": "<string>"
},
"courierBranch": {
"id": "<string>",
"name": "<string>",
"addressLine": "<string>",
"geoLevel1": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel2": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel3": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel4": {
"name": "Miraflores",
"code": "150122"
}
},
"buyer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"code": "<string>",
"customerId": "<string>",
"documentType": "<string>",
"documentNumber": "<string>"
},
"billing": {
"documentType": "<string>",
"documentNumber": "<string>",
"legalName": "<string>",
"businessActivity": "<string>",
"geoDivisionId": "<string>",
"geoDivisionName": "<string>",
"geoDivisionCode": "<string>",
"geoDivisionDisplayPath": "<string>",
"addressLine": "<string>"
},
"shippingAddress": {
"addressLine1": "<string>",
"addressLine2": "<string>",
"geoLevel1": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel2": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel3": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel4": {
"name": "Miraflores",
"code": "150122"
},
"coordinates": {
"latitude": -12.046374,
"longitude": -77.042793
},
"recipientName": "<string>",
"recipientPhone": "<string>",
"instructions": "<string>",
"customerAddressId": "<string>"
},
"payment": {
"methodKind": "MANUAL",
"methodName": "<string>",
"paidVia": "CARD",
"installments": 12,
"installmentsInterest": "WITH_INTEREST",
"reference": "<string>",
"paidAt": "2026-06-30T14:12:00Z",
"amountPaid": "1234.56"
},
"cancellation": {
"reason": "<string>",
"note": "<string>",
"byMemberId": "<string>",
"byName": "<string>"
},
"fulfillments": [
{
"carrier": "<string>",
"trackingNumber": "<string>",
"trackingUrl": "<string>",
"preparingAt": "2026-06-30T14:12:00Z",
"fulfilledAt": "2026-06-30T14:12:00Z",
"deliveredAt": "2026-06-30T14:12:00Z"
}
],
"invoiceStatus": "NOT_INVOICED",
"invoices": [
{
"id": "<string>",
"number": "<string>",
"issuedAt": "2026-06-30T14:12:00Z",
"registeredAt": "2026-06-30T14:12:00Z"
}
],
"promotions": [
{
"id": "<string>",
"code": "<string>",
"title": "<string>",
"class": "GOODS",
"amount": "1234.56"
}
],
"items": [
{
"id": "<string>",
"variantId": "<string>",
"variantSku": "<string>",
"productId": "<string>",
"productName": "<string>",
"productImageUrl": "<string>",
"quantity": 2,
"price": "1234.56",
"listPrice": "1234.56",
"discountTotal": "1234.56",
"discountAllocations": [
{
"promotionId": "<string>",
"amount": "1234.56"
}
],
"taxName": "<string>",
"taxCode": "<string>",
"taxRatePercent": "18.00",
"subtotal": "1234.56",
"taxTotal": "1234.56",
"total": "1234.56",
"components": [
{
"id": "<string>",
"variantId": "<string>",
"variantSku": "<string>",
"productId": "<string>",
"productName": "<string>",
"quantityPerBundle": 3
}
]
}
],
"transactions": [
{
"id": "<string>",
"kind": "AUTHORIZATION",
"status": "PENDING",
"amount": "1234.56",
"provider": "OPENPAY",
"gatewayTransactionId": "<string>",
"cardBrand": "<string>",
"cardLast4": "<string>",
"cardType": "CREDIT",
"installments": 12,
"installmentsInterest": "WITH_INTEREST",
"authorizationCode": "<string>",
"gatewayResultCode": "<string>",
"errorCode": "<string>",
"test": true,
"processedAt": "2026-06-30T14:12:00Z",
"createdAt": "2026-06-30T14:12:00Z"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Cancel an order
Cancel an order that has not been dispatched yet. Records the reason, the optional internal note, and returns committed stock unless told otherwise. The buyer is not emailed unless notifyCustomer is true. Send no body to accept every default. Requires the orders:write scope.
curl --request POST \
--url https://api-v2.riqra.com/public/v1/orders/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "INVENTORY",
"note": "<string>",
"restock": true,
"notifyCustomer": true
}
'import requests
url = "https://api-v2.riqra.com/public/v1/orders/{id}/cancel"
payload = {
"reason": "INVENTORY",
"note": "<string>",
"restock": True,
"notifyCustomer": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'INVENTORY', note: '<string>', restock: true, notifyCustomer: true})
};
fetch('https://api-v2.riqra.com/public/v1/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://api-v2.riqra.com/public/v1/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_POSTFIELDS => json_encode([
'reason' => 'INVENTORY',
'note' => '<string>',
'restock' => true,
'notifyCustomer' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.riqra.com/public/v1/orders/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"INVENTORY\",\n \"note\": \"<string>\",\n \"restock\": true,\n \"notifyCustomer\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-v2.riqra.com/public/v1/orders/{id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"INVENTORY\",\n \"note\": \"<string>\",\n \"restock\": true,\n \"notifyCustomer\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.riqra.com/public/v1/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"INVENTORY\",\n \"note\": \"<string>\",\n \"restock\": true,\n \"notifyCustomer\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": "<string>",
"status": "AWAITING_REVIEW",
"paymentStatus": "UNPAID",
"fulfillmentStatus": "UNFULFILLED",
"source": "STOREFRONT",
"createdAt": "2026-06-30T14:12:00Z",
"updatedAt": "2026-06-30T14:12:00Z",
"placedAt": "2026-06-30T14:12:00Z",
"cancelledAt": "2026-06-30T14:12:00Z",
"placedAsGuest": true,
"comment": "<string>",
"purchaseOrderNumber": "<string>",
"currencyCode": "USD",
"subtotal": "1234.56",
"taxTotal": "1234.56",
"taxLines": [
{
"name": "<string>",
"code": "<string>",
"ratePercent": "19.00",
"base": "1234.56",
"amount": "1234.56"
}
],
"shippingTotal": "1234.56",
"shippingTaxTotal": "1234.56",
"discountTotal": "1234.56",
"total": "1234.56",
"priceList": {
"id": "<string>",
"name": "<string>"
},
"segment": {
"id": "<string>",
"name": "<string>"
},
"location": {
"id": "<string>",
"name": "<string>"
},
"shippingMethod": {
"id": "<string>",
"type": "DELIVERY",
"label": "<string>",
"payment": "PREPAID"
},
"courier": {
"id": "<string>",
"name": "<string>"
},
"courierBranch": {
"id": "<string>",
"name": "<string>",
"addressLine": "<string>",
"geoLevel1": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel2": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel3": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel4": {
"name": "Miraflores",
"code": "150122"
}
},
"buyer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"code": "<string>",
"customerId": "<string>",
"documentType": "<string>",
"documentNumber": "<string>"
},
"billing": {
"documentType": "<string>",
"documentNumber": "<string>",
"legalName": "<string>",
"businessActivity": "<string>",
"geoDivisionId": "<string>",
"geoDivisionName": "<string>",
"geoDivisionCode": "<string>",
"geoDivisionDisplayPath": "<string>",
"addressLine": "<string>"
},
"shippingAddress": {
"addressLine1": "<string>",
"addressLine2": "<string>",
"geoLevel1": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel2": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel3": {
"name": "Miraflores",
"code": "150122"
},
"geoLevel4": {
"name": "Miraflores",
"code": "150122"
},
"coordinates": {
"latitude": -12.046374,
"longitude": -77.042793
},
"recipientName": "<string>",
"recipientPhone": "<string>",
"instructions": "<string>",
"customerAddressId": "<string>"
},
"payment": {
"methodKind": "MANUAL",
"methodName": "<string>",
"paidVia": "CARD",
"installments": 12,
"installmentsInterest": "WITH_INTEREST",
"reference": "<string>",
"paidAt": "2026-06-30T14:12:00Z",
"amountPaid": "1234.56"
},
"cancellation": {
"reason": "<string>",
"note": "<string>",
"byMemberId": "<string>",
"byName": "<string>"
},
"fulfillments": [
{
"carrier": "<string>",
"trackingNumber": "<string>",
"trackingUrl": "<string>",
"preparingAt": "2026-06-30T14:12:00Z",
"fulfilledAt": "2026-06-30T14:12:00Z",
"deliveredAt": "2026-06-30T14:12:00Z"
}
],
"invoiceStatus": "NOT_INVOICED",
"invoices": [
{
"id": "<string>",
"number": "<string>",
"issuedAt": "2026-06-30T14:12:00Z",
"registeredAt": "2026-06-30T14:12:00Z"
}
],
"promotions": [
{
"id": "<string>",
"code": "<string>",
"title": "<string>",
"class": "GOODS",
"amount": "1234.56"
}
],
"items": [
{
"id": "<string>",
"variantId": "<string>",
"variantSku": "<string>",
"productId": "<string>",
"productName": "<string>",
"productImageUrl": "<string>",
"quantity": 2,
"price": "1234.56",
"listPrice": "1234.56",
"discountTotal": "1234.56",
"discountAllocations": [
{
"promotionId": "<string>",
"amount": "1234.56"
}
],
"taxName": "<string>",
"taxCode": "<string>",
"taxRatePercent": "18.00",
"subtotal": "1234.56",
"taxTotal": "1234.56",
"total": "1234.56",
"components": [
{
"id": "<string>",
"variantId": "<string>",
"variantSku": "<string>",
"productId": "<string>",
"productName": "<string>",
"quantityPerBundle": 3
}
]
}
],
"transactions": [
{
"id": "<string>",
"kind": "AUTHORIZATION",
"status": "PENDING",
"amount": "1234.56",
"provider": "OPENPAY",
"gatewayTransactionId": "<string>",
"cardBrand": "<string>",
"cardLast4": "<string>",
"cardType": "CREDIT",
"installments": 12,
"installmentsInterest": "WITH_INTEREST",
"authorizationCode": "<string>",
"gatewayResultCode": "<string>",
"errorCode": "<string>",
"test": true,
"processedAt": "2026-06-30T14:12:00Z",
"createdAt": "2026-06-30T14:12:00Z"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Autorizaciones
Cuerpo
Respuesta
The cancelled order.
Lifecycle status: PLACED, CANCELLED, or AWAITING_REVIEW — a credit order that exceeded the customer's available credit, held until the merchant approves it (then PLACED) or rejects it (then CANCELLED). An AWAITING_REVIEW order cannot be fulfilled, paid or invoiced.
AWAITING_REVIEW, PLACED, CANCELLED Channel the order came from: STOREFRONT (buyer checkout), PURCHASE_ORDER (a buyer's purchase order document confirmed by the merchant), ASSISTED (a draft the merchant built for the buyer), POS (a sale rung up at a register in a physical store, paid and handed over on the spot), or MIGRATION (imported from a previous platform). Treat unknown values as opaque — the set grows.
STOREFRONT, PURCHASE_ORDER, MIGRATION, ASSISTED, POS