CNaughtCNaught
PricingSign In

Cancel Order

When cancelling an order that has been fulfilled, a credit for the price of the order will be applied to the current invoice. This means that it is possible for the credit for a cancellation to appear on the invoice of the following billing period. For example, if a billing period ends between when the order was placed and when it is cancelled, then the credit will be applied to the latter billing period rather than the one during which the order was placed.

POST/orders/{id}/cancel

Authorizations#

Authorization

string

header

required

Bearer authentication header of the form Bearer <token>, where <token> is your CNaught API key.

Headers#

X-Subaccount-Id

string

If present, will only cancel the order if it belongs to the subaccount with given id.

Idempotency-Key

string

If present, a unique identifier that allows you to retry a request multiple times while only performing the action once. See Idempotency for more info.

Path Parameters#

id

string

required

ID of order to cancel

Response#

200

Order Details

Get Order By Id

Cancel Order

curl --request POST \
  --url https://api.cnaught.com/v1/orders/<id>/cancel \
  --header 'Authorization: Bearer <token>'
{
  "id": "Gre28Fc35bt3",
  "order_number": "47726-53238-46633-33562-7433",
  "created_on": "2022-08-01T18:00:00.000000Z",
  "metadata": "Customer metadata",
  "description": "On behalf of Jane Smith",
  "amount_kg": 10.5,
  "state": "cancelled",
  "price_usd_cents": 2350,
  "certificate_public_url": null,
  "certificate_download_public_url": null
}