# v2-cancelOrderLines - Cancel order lines

Description

Use this API to cancel order lines (all or part) of an order.


Call Frequency

Recommended usage: At each cancel request
Maximum usage: At each cancel request

Endpoint: POST /v2/orders/{order_id}/cancel
Security: Bearer

## Path parameters:

  - `order_id` (string, required)
    Order identifier in Mirakl Connect
    Example: "0024_COMMERCIAL_ID-A"

## Request fields (application/json):

  - `cancelations` (array, required)
    Cancelations details related to an order

  - `cancelations.order_line_id` (string)
    Unique order line identifier used by Mirakl Connect. ID of the order line to cancel.

  - `cancelations.price` (object, required)
    Product price to cancel, excluding taxes and shipping price

  - `cancelations.price.amount` (number, required)
    Price amount

  - `cancelations.price.currency` (string, required)
    Currency ISO code

  - `cancelations.product_id` (string)
    Seller product identifier on the channel

  - `cancelations.quantity` (integer, required)
    Product quantity to cancel

  - `cancelations.reason` (string, required)
    The reason why the order line is canceled
    Enum: "CUSTOMER_CANCELATION", "OUT_OF_STOCK", "RETURN", "ITEM_NOT_RECEIVED", "AGREEMENT", "DEFECT", "UNABLE_TO_DELIVER"

  - `cancelations.shipping_price` (object, required)
    Shipping price to cancel, excluding shipping taxes

  - `cancelations.shipping_price.amount` (number, required)
    Price amount

  - `cancelations.shipping_price.currency` (string, required)
    Currency ISO code

  - `cancelations.shipping_taxes` (array)
    Shipping taxes to cancel

  - `cancelations.shipping_taxes.amount` (object, required)
    Canceled tax amount

  - `cancelations.shipping_taxes.amount.amount` (number, required)
    Price amount

  - `cancelations.shipping_taxes.amount.currency` (string, required)
    Currency ISO code

  - `cancelations.shipping_taxes.code` (string, required)
    Tax code on the sales channel

  - `cancelations.taxes` (array)
    Taxes to cancel

  - `cancelations.taxes.amount` (object, required)
    Canceled tax amount

  - `cancelations.taxes.amount.amount` (number, required)
    Price amount

  - `cancelations.taxes.amount.currency` (string, required)
    Currency ISO code

  - `cancelations.taxes.code` (string, required)
    Tax code on the sales channel

## Response 202 fields (application/json):

  - `action_id` (string, required)
    The unique identifier for the asynchronous action. It should be used with the [v2-getActionStatus API](#operation/v2-getActionStatus) to retrieve current action status and potential errors.

  - `tracking_id` (string)
    Deprecated: This field was previously used to obtain the action ID. It has been replaced by action_id and contains the same value. It is retained for backward compatibility.

## Response 400 fields (application/json):

  - `code` (string, required)
    Error code (immutable)

  - `errors` (array)

  - `errors.extensions` (object)
    Free map where you find additional context data to better describe the error

  - `errors.field` (string)
    JsonPath to the field where the error occurred

  - `errors.message` (string, required)
    Literal string error item description (Please do not base your error handling on this field since it is subject to change)

  - `extensions` (object)
    Free map where you find additional context data to better describe the error

  - `message` (string, required)
    Literal string error description (Please do not base your error handling on this field since it is subject to change)

## Response 404 fields (application/json):

  - `code` (string, required)
    Error code (immutable)

  - `errors` (array)

  - `errors.extensions` (object)
    Free map where you find additional context data to better describe the error

  - `errors.field` (string)
    JsonPath to the field where the error occurred

  - `errors.message` (string, required)
    Literal string error item description (Please do not base your error handling on this field since it is subject to change)

  - `extensions` (object)
    Free map where you find additional context data to better describe the error

  - `message` (string, required)
    Literal string error description (Please do not base your error handling on this field since it is subject to change)


