Cancel Order
PATCH
/api/1.01/order/cancel/{trx}
Canceling an order after creation using the trx returned by the Create order endpoint. Orders that have not being confirmed will be deleted and return HTTP status 204, while orders that have been confirmed will be canceled instead and return a (partial) order.
info
Note: The response of this endpoint depends on the status of your order.
Requested Parameters
Field | Type | Required | Default | Description |
---|---|---|---|---|
trx | String | Yes | - | Trx of order |
Example Request
curl -X PATCH https://connect.relograde.com/api/1.01/order/cancel/RELO0TFQK8FXQXSPURM \
-H "Authorization: Bearer <token>"
Example Response
- Confirmed order
- Non-confirmed order
{
"trx": "RELO0TFQK8FXQXSPURM",
"priceCurrency": "eur",
"priceAmount": 58.14,
"priceVat": 0.23,
"priceInclVat": 58.37,
"priceFx": 1.0,
"dateCreated": "2025-01-24T11:30:20.000Z",
"paymentStatus": "paid",
"type": "api",
"reference": "test",
"state": "sandbox",
"orderStatus": "cancelled",
"isBalancePayment": true,
"downloaded": false,
"items": [
{
"product": {
"slug": "rewarble-ww-eur-5",
"name": "rewarble 5 EUR WW",
"brand": "rewarble",
"productType": "topup",
"region": "ww",
"faceValueAmount": 5.0,
"faceValueCurrency": "eur",
"mainCategory": "giftcard",
"redeemType": "currency",
"isStocked": true
},
"amount": 5,
"priceCurrency": "eur",
"singlePriceAmount": 5.1,
"totalPriceAmount": 25.5,
"totalPriceVat": 0.1,
"totalPriceInclVat": 25.6,
"priceFx": 1.0,
"paymentCurrency": "eur",
"singlePriceAmountInPaymentCurrency": 5.1,
"totalPriceAmountInPaymentCurrency": 25.5,
"totalPriceVatInPaymentCurrency": 0.1,
"totalPriceInclVatInPaymentCurrency": 25.6,
"orderLines": [
{
"tag": "TAG-189a9fe4-3a7e-40fd-a357-153e885481fd",
"status": "pending"
},
{
"tag": "TAG-1ee8f999-c47f-4cfb-9309-0912f62dcc49",
"status": "pending"
},
{
"tag": "TAG-faef041d-774e-4c0a-88ee-6ac3ae1261c3",
"status": "pending"
},
{
"tag": "TAG-6fa744d7-4a6b-415a-9833-d06274c73145",
"status": "pending"
},
{
"tag": "TAG-6823ef30-94cd-45d4-a23b-25e93ebb9145",
"status": "pending"
}
],
"linesCompleted": 0,
"productSlug": "rewarble-ww-eur-5",
"faceValueAmount": 5.0,
"faceValueCurrency": "eur",
"faceValueFx": 1.0
},
{
"product": {
"slug": "rewarble-variable-eur",
"name": "Rewarble Variable EUR",
"brand": "rewarble",
"productType": "topup",
"region": "ww",
"faceValueCurrency": "eur",
"faceValueMin": 5.0,
"faceValueMax": 500.0,
"mainCategory": "giftcard",
"redeemType": "currency",
"isStocked": true
},
"amount": 1,
"priceCurrency": "eur",
"singlePriceAmount": 32.64,
"totalPriceAmount": 32.64,
"totalPriceVat": 0.13,
"totalPriceInclVat": 32.77,
"priceFx": 1.0,
"paymentCurrency": "eur",
"singlePriceAmountInPaymentCurrency": 32.64,
"totalPriceAmountInPaymentCurrency": 32.64,
"totalPriceVatInPaymentCurrency": 0.13,
"totalPriceInclVatInPaymentCurrency": 32.77,
"orderLines": [
{
"tag": "TAG-f43c2cf3-bebc-4486-8dcb-c417c874db0b",
"status": "pending"
}
],
"linesCompleted": 0,
"productSlug": "rewarble-variable-eur",
"faceValueAmount": 32.0,
"faceValueCurrency": "eur",
"faceValueFx": 1.0
}
]
}
204 No content
Response Fields
Field name | Field type | Field description |
---|---|---|
trx | String | Trx of order (Identifier) |
priceCurrency | String | Currency of price |
priceAmount | Decimal | Price before VAT |
priceVat | Decimal | VAT amount |
priceInclVat | Decimal | Price including VAT |
priceFx | Decimal | Price calculation multiplier |
dateCreated | Date | Creation date of order |
paymentStatus | String | Status of payment |
type | String | Type of system used to create order (portal or api) |
reference | String | Reference of order |
state | String | Environment of order (live or sandbox) |
orderStatus | String | Status of order |
isBalancePayment | Boolean | Whether the order is a balance payment or not |
downloaded | Boolean | Whether the order has been downloaded or not |
items | Object | Item object |
product | Object | Product object |
slug | String | Slug of product |
name | String | Name of product |
brand | String | Brand of product |
productType | String | Type of product |
region | String | Region in which the product can be used |
faceValueAmount | Decimal | Value of product |
faceValueCurrency | String | Currency of faceValue |
mainCategory | String | Main category of product |
redeemType | String | Redeem type of product |
isStocked | Boolean | Whether the product is in stock or not |
amount | Integer | Amount of product |
priceCurrency | String | Currency of price |
singlePriceAmount | Decimal | Price for a single product |
totalPriceAmount | Decimal | Total price of all products |
totalPriceVat | Decimal | Total VAT amount |
totalPriceInclVat | Decimal | Total price including VAT |
paymentCurrency | String | Currency of payment price |
singlePriceAmountInPaymentCurrency | Decimal | Price of a single product in payment currency |
totalPriceAmountInpaymentCurrency | Decimal | Total price of all products in payment currency |
totalPriceVatInPaymentCurrency | Decimal | Total VAT amount in payment currency |
totalPriceInclVatInPaymentCurrency | Decimal | Total price including VAT in payment currency |
orderLines | Array | Array of codes ordered |
tag | String | Internal tag (id) of the code |
status | String | Status of product |
linesCompleted | Integer | Amount of orderLines with status finished |
productSlug | String | Slug of product |
faceValueAmount | Decimal | Value of product |
faceValueCurrency | String | Currency of faceValueAmount |
faceValuefx | Decimal | Price calculation multiplier for faceValueAmount |
Errors
Errors response
Endpoint | HTTP status code | HTTP status | Message | Reason |
---|---|---|---|---|
Cancel order | 404 | NOT_FOUND | order not found | Invalid order TRX |
Cancel order | 400 | BAD_REQUEST | Invalid order status | The order status is neither created or pending |
Notes
note
- Currency codes follow ISO 4217 standard
- Codes shown in example have been altered and made invalid
- Only orders with status “created” or “pending” can be canceled
- Price information may be provided either as fixed price or as fee.
- Price information may have been altered in the documentation
- Orders that are not confirmed will return 204 with no body
- Orders that are confirmed will return a 200 with a (partial) order inside the body