Cancel Fulfillment Order Line Items

Cancels specific line items within a fulfillment order.

Line Item Status Requirements

Only items in pending status (open or allocated) can be cancelled:

  • open - Can be cancelled
  • allocated - Can be cancelled
  • fulfilled - Cannot be cancelled (use unfulfill first)
  • cancelled - Already cancelled
  • closed - Cannot be cancelled

Request Requirements (All Required)

  • cancellation_reason (required): One of the predefined enum values
  • line_items (required): Array of items to cancel with quantities

Cancellation Reason Values

  • CUSTOMER_CANCELLATION - Customer requested cancellation
  • AUTO_ALLOCATION_FAILED - Automatic fulfillment allocation failed
  • INVENTORY_OUT_OF_STOCK - Items are out of stock
  • STAFF_ERROR - Staff made an error
  • PAYMENT_ISSUE - Payment problem occurred
  • OTHER - Other reason

Cancellation Effects

When items are cancelled:

  1. Item status is updated to cancelled with the cancellation reason
  2. Order line item's removed_quantities is updated
  3. Order status is recalculated
  4. Webhooks are triggered

Inventory Impact

If inventory management is enabled and the FO has a location_id:

  • reserved is decreased by the cancelled quantity (releasing reserved stock)
SecurityOAuth2-Production or OAuth2-Demo
Request
path Parameters
orderReference
required
string

The order reference (order_id or partner_order_reference based on the key parameter).

fulfillmentOrderId
required
string

The unique identifier of the fulfillment order.

query Parameters
key
string
Default: "order_id"

Specifies which reference type is being used for the order reference.

Enum: "order_id" "partner_order_reference"
header Parameters
x-api-key
required
string

Your Carriyo API key for authentication.

tenant-id
required
string

Your unique tenant identifier in Carriyo.

Content-Type
string
Default: application/json
Request Body schema: application/json
optional
cancellation_reason
string (Cancellation Reason)

The reason for cancellation. Must be one of the following values:

  • CUSTOMER_CANCELLATION - Customer requested cancellation
  • AUTO_ALLOCATION_FAILED - Automatic fulfillment allocation failed
  • INVENTORY_OUT_OF_STOCK - Items are out of stock
  • STAFF_ERROR - Staff made an error
  • PAYMENT_ISSUE - Payment problem occurred
  • OTHER - Other reason
Enum: "CUSTOMER_CANCELLATION" "AUTO_ALLOCATION_FAILED" "INVENTORY_OUT_OF_STOCK" "STAFF_ERROR" "PAYMENT_ISSUE" "OTHER"
Array of objects (Fulfillment Order Line Item Request)

Specific line items to cancel. Omit to cancel all pending items.

Responses
200

Line items cancelled successfully.

400

Cannot cancel line items.

404

Order or fulfillment order not found.

post/orders/{orderReference}/fulfillment-orders/{fulfillmentOrderId}/cancel
Request samples
application/json
{
  • "cancellation_reason": "CUSTOMER_CANCELLATION",
  • "line_items": [
    ]
}
Response samples
application/json
{
  • "tenant": "string",
  • "order_id": "string",
  • "merchant": "string",
  • "partner_order_reference": "string",
  • "language": "string",
  • "order_date": "2019-08-24T14:15:22Z",
  • "sales_channel": "string",
  • "creation_source": {
    },
  • "update_source": {
    },
  • "carriyo_metadata": [
    ],
  • "status": "open",
  • "auto_allocation_failed": true,
  • "cancellation_reason": "CUSTOMER_CANCELLATION",
  • "shipping_address": {
    },
  • "billing_address": {
    },
  • "customer": {
    },
  • "payment": {
    },
  • "redacted": true,
  • "taxes_included": true,
  • "duties_included": true,
  • "discount_applications": [
    ],
  • "line_items": [
    ],
  • "fulfillment_orders": [
    ],
  • "shipping_lines": [
    ],
  • "error_details": [
    ],
  • "creation_date": "2019-08-24T14:15:22Z",
  • "update_date": "2019-08-24T14:15:22Z"
}