Skip to main content
Cancel a pending one-time order. Only orders in pending status can be canceled.
POST /v1/actions/onetime-order/cancel-order
Authentication: Session Token — see Customer Endpoints (customer or buyer role)

Cancellation Behavior

Current StatusActionResult Status
pendingImmediate cancelcanceled
completedRejectedunchanged (terminal)
canceledRejectedunchanged (terminal)
  • pending: The order is canceled immediately and its status becomes canceled
  • The underlying PSP checkout session expires automatically — there is no separate PSP cancel call to make
  • completed and canceled are terminal states and cannot be canceled again

Request Body

FieldTypeRequiredDescription
orderIdstringYesOne-time order ID (Short ID format ORD_xxx)

Example Request

import { WaffoPancake } from "@waffo/pancake-ts";

const client = new WaffoPancake({
  sessionToken: window.WAFFO_SESSION_TOKEN, // injected by the merchant's portal
  environment: "prod",
});

const result = await client.orders.cancelOnetime({
  orderId: "ORD_2aUyqjCzEIiEcYMKj7TZtw",
});

console.log(result.orderId); // "ORD_2aUyqjCzEIiEcYMKj7TZtw"
console.log(result.status);  // "canceled"

Success Response (200)

{
  "data": {
    "orderId": "ORD_2aUyqjCzEIiEcYMKj7TZtw",
    "status": "canceled"
  }
}

Response Fields

FieldTypeDescription
orderIdstringOrder ID (Short ID)
statusstringNew order status (always canceled on success)

Errors

Retry policy: Never retry 4xx — fix the request and resubmit. Retry 5xx with exponential backoff (start 5s, max 3 attempts).
Statuserrors[0].messageWhat it meansRecommended handling
400Missing required field: orderIdorderId was not provided in the bodyFix the request body, then resubmit
400Expected format: ORD_xxx, got "..."orderId Short ID could not be decodedFix the orderId format, then resubmit
400Order cannot be canceled, current status: XOrder status is not pending (e.g. already completed or canceled)The order is no longer cancellable
401Authentication failedSession token invalid, expired, or malformedRe-mint the session token via Issue Session Token
403Order does not belong to userOwnership check failedVerify the caller owns the order
404Order not foundOrder does not existVerify the order ID
500Internal server errorUnexpected server-side failureRetry with exponential backoff (start 5s, max 3 attempts)