Cancel Order Request

View as Markdown

Note: This request is only used in full integration mode.

BRIJ sends this request to cancel an existing order.

Endpoint

POST https://api.yourplatform.com/cancel-order
Content-Type: application/json

Request Body

1{
2 "orderId": "order_abc123",
3 "externalOrderId": "partner_order_12345"
4}

Request Parameters

FieldTypeRequiredDescription
orderIdstringYesBRIJ’s unique identifier for this order
externalOrderIdstringYesYour platform’s unique identifier for this order

Response Body

Success Response

Return an empty JSON object on success:

1{}

Error Response

Return an error response when the order cannot be canceled:

1{
2 "error": {
3 "reason": "order_already_processed",
4 "customerFacingReason": "This order has already been completed and cannot be canceled."
5 }
6}

Error Fields

FieldTypeDescription
reasonstringInternal error reason (for logging and debugging)
customerFacingReasonstringUser-friendly message that can be shown to the customer

HTTP Status Codes

Status CodeDescription
400Invalid request parameters
404Order not found
422Order cannot be canceled (e.g., already processed)
503Service temporarily unavailable