Skip to content

Cancel one of my orders before it ships​

POST
/orders/{orderId}/cancel

The authenticated customer cancels their OWN order (same ownership rule as GET /orders/{orderId}: another customer's order is a 404). The order becomes cancelled with the chosen reason, a « Client » event is added to its timeline, the customer receives the cancellation e-mail, reserved stock is released and every vendor on the order is notified.

Allowed only from pending, confirmed or processing AND while no vendor's part has shipped — otherwise 409 ORDER_NOT_CANCELLABLE with the current status. An order with any recorded payment or refund is refused with 409 ORDER_PAID_CONTACT_SUPPORT (money is handled by the marketplace). Already cancelled → 200 with the current order (idempotent).

Auth: Bearer JWT required; allowed realms: customer.

Authorizations​

bearerAuth

Jeton client obtenu par POST /auth/login (ou /auth/register), renouvelé par POST /auth/refresh.

Type
HTTP (bearer)

Parameters​

Path Parameters

orderId*
Type
string
Required

Request Body​

application/json
JSON
{
  
"reasonCode": "customer_request",
  
"note": "string"
}

Responses​

Order cancelled (or already cancelled) — the current order detail.

application/json
JSON
{
  
"ok": true,
  
"data": {
  
  
"orderId": "string",
  
  
"orderNumber": "string",
  
  
"status": "string",
  
  
"currency": "string",
  
  
"total": 0,
  
  
"paymentMethod": "string",
  
  
"paymentStatus": "string",
  
  
"itemCount": 0,
  
  
"placedAt": "2024-01-01T00:00:00Z",
  
  
"subtotal": 0,
  
  
"discountAmount": 0,
  
  
"shippingAmount": 0,
  
  
"customerNote": "string",
  
  
"items": [
  
  
  
{
  
  
  
  
"itemId": "string",
  
  
  
  
"productId": "string",
  
  
  
  
"vendorId": "string",
  
  
  
  
"vendorName": "string",
  
  
  
  
"vendorPhone": "string",
  
  
  
  
"vendorWhatsapp": "string",
  
  
  
  
"title": "string",
  
  
  
  
"quantity": 0,
  
  
  
  
"unitPrice": 0,
  
  
  
  
"lineTotal": 0
  
  
  
}
  
  
],
  
  
"vendors": [
  
  
  
{
  
  
  
  
"vendorId": "string",
  
  
  
  
"name": "string",
  
  
  
  
"phone": "string",
  
  
  
  
"email": "string",
  
  
  
  
"whatsapp": "string",
  
  
  
  
"whatsappSource": "vendor",
  
  
  
  
"waLink": "string",
  
  
  
  
"store": {
  
  
  
  
  
"storeId": "string",
  
  
  
  
  
"name": "string",
  
  
  
  
  
"address": "string",
  
  
  
  
  
"city": "string",
  
  
  
  
  
"phone": "string"
  
  
  
  
},
  
  
  
  
"address": "string"
  
  
  
}
  
  
],
  
  
"events": [
  
  
  
{
  
  
  
  
"eventId": "string",
  
  
  
  
"eventType": "string",
  
  
  
  
"fromStatus": "string",
  
  
  
  
"toStatus": "string",
  
  
  
  
"note": "string",
  
  
  
  
"occurredAt": "2024-01-01T00:00:00Z"
  
  
  
}
  
  
],
  
  
"fulfillmentMode": "full",
  
  
"deliveredBy": "marketplace",
  
  
"deliveredByName": "string",
  
  
"paymentCollectedBy": "marketplace",
  
  
"vendorParts": [
  
  
  
{
  
  
  
  
"vendorId": "string",
  
  
  
  
"vendorName": "string",
  
  
  
  
"fulfillmentMode": "full",
  
  
  
  
"deliveredBy": "marketplace",
  
  
  
  
"paymentCollectedBy": "marketplace"
  
  
  
}
  
  
]
  
}
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI

Tarifs : contactez-nous — contact@marketkit.ai