# OR30 - Perform cancelations on order lines

Description

If the Shop partial cancelation feature is enabled by Mirakl Support Team:    for PAY_ON_DELIVERY, PAY_ON_DUE_DATE or PAY_ON_SHIPMENT  workflows: shop can only cancel a non-debited order.    for NO_CUSTOMER_PAYMENT_CONFIRMATION workflow: shop can only cancel an unshipped order.


Call Frequency

Recommended usage: At each order (or order line) cancelation
Maximum usage: At each order (or order line) cancelation

Endpoint: PUT /api/orders/cancel

## Request fields (application/json):

  - `cancelations` (array, required)
    List of representations of cancellations to be created

  - `cancelations.amount` (number, required)
    The offer part amount to be canceled

  - `cancelations.currency_iso_code` (string)
    The currency (iso format) used by the shop (the field is required if the shop is not using the default Operator platform currency)
    Enum: "AED", "ARS", "AUD", "BAM", "BGN", "BHD", "BRL", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "GEL", "GTQ", "HKD", "HRK", "HUF", "IDR", "ILS", "INR", "IQD", "JOD", "JPY", "KES", "KRW", "KWD", "LKR", "MAD", "MGA", "MXN", "MYR", "NGN", "NOK", "NZD", "OMR", "PEN", "PHP", "PKR", "PLN", "QAR", "RON", "RSD", "RUB", "SAR", "SEK", "SGD", "TND", "TRY", "THB", "TWD", "UAH", "USD", "UYU", "UZS", "VND", "ZAR"

  - `cancelations.fees` (array)
    The fees to be canceled

  - `cancelations.fees.amount` (number)
    Order Fee amount

  - `cancelations.fees.code` (string)
    Order Fee code

  - `cancelations.order_line_id` (string, required)
    Order line's identifier that must be canceled

  - `cancelations.quantity` (integer, required)
    The quantity of goods to cancel

  - `cancelations.reason_code` (string, required)
    Cancellation's reason code

  - `cancelations.shipping_amount` (number, required)
    The shipping charges part amount to be canceled

  - `cancelations.shipping_taxes` (array)
    The taxes to be canceled on the shipping price (this field is required if the order has shipping taxes).
When feature 'order level tax calculation' is enabled and used with TAX_EXCLUDED tax mode, field must not be provided.

  - `cancelations.shipping_taxes.amount` (number)
    Tax amount

  - `cancelations.shipping_taxes.code` (string)
    Tax code

  - `cancelations.taxes` (array)
    The taxes to be canceled on the product price (this field is required if the order has taxes).
When feature 'order level tax calculation' is enabled and used with TAX_EXCLUDED tax mode, field must not be provided.

  - `cancelations.taxes.amount` (number)
    Tax amount

  - `cancelations.taxes.code` (string)
    Tax code

  - `order_tax_mode` (string)
    Please note: If the taxes are not specified, the prices with mode TAX_EXCLUDED and with mode TAX_INCLUDED will return the same amounts.

Possible values:
- TAX_EXCLUDED: the price fields (price, unit price, shipping price and order total prices) do not include taxes.
- TAX_INCLUDED: the price fields include the tax amounts.
- If not specified, the default order tax mode of the platform is used.

When the feature 'order level tax calculation' is enabled, the order_tax_mode provided must be the same as defined for the platform.
    Enum: "TAX_INCLUDED", "TAX_EXCLUDED"

## Response 200 fields (application/json):

  - `cancelations` (array, required)
    List of representations of created cancellations

  - `cancelations.amount` (number, required)
    The offer part amount of the cancellation

  - `cancelations.amount_breakdown` (object)
    The breakdown of the offer part amount to be canceled, only available when advanced features are enabled

  - `cancelations.amount_breakdown.parts` (array, required)
    The parts which constitute the total amount. Each part can have different invoicing rules. The sum of the amount of each part is equal to the total amount. Multiple parts can be returned in tax mode TAX_INCLUDED.

  - `cancelations.amount_breakdown.parts.amount` (number, required)
    Part's amount. The sum of each part's amount is equal to the total amount.

  - `cancelations.amount_breakdown.parts.commissionable` (boolean)
    Should this amount be applied to the sellers commissions calculation.

  - `cancelations.amount_breakdown.parts.debitable_from_customer` (boolean)
    Should this amount be debited to the customer. If true, the amount is taken into account when generating the debit file.If false, the amount is not taken into account when generating the debit file.

  - `cancelations.amount_breakdown.parts.payable_to_shop` (boolean)
    Should this amount be paid to the shop. If true, the amount is taken into account when generating the shop payment voucher.If false, the amount is not taken into account when generating the shop payment voucher.

  - `cancelations.cancelation_id` (string, required)
    The identifier of the created cancellation

  - `cancelations.currency_iso_code` (string)
    The currency (iso format) used by the shop (the field is required if the shop is not using the default Operator platform currency)
    Enum: "AED", "ARS", "AUD", "BAM", "BGN", "BHD", "BRL", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "GEL", "GTQ", "HKD", "HRK", "HUF", "IDR", "ILS", "INR", "IQD", "JOD", "JPY", "KES", "KRW", "KWD", "LKR", "MAD", "MGA", "MXN", "MYR", "NGN", "NOK", "NZD", "OMR", "PEN", "PHP", "PKR", "PLN", "QAR", "RON", "RSD", "RUB", "SAR", "SEK", "SGD", "TND", "TRY", "THB", "TWD", "UAH", "USD", "UYU", "UZS", "VND", "ZAR"

  - `cancelations.eco_contributions` (array)
    List of eco-contribution amounts and corresponding producer identifiers, if applicable
Only available if the operator activates the circular economy information collection.

  - `cancelations.eco_contributions.epr_category_code` (string, required)
    Extended Producer Responsibility category

  - `cancelations.eco_contributions.producer_id` (string, required)
    Producer identifier of the eco-contribution.

  - `cancelations.eco_contributions.producer_id_owner` (string, required)
    Owner of the producerId

  - `cancelations.eco_contributions.total_amount` (number)
    Total amount of the eco-contribution

  - `cancelations.eco_contributions.unit_amount` (number)
    Unit amount of the eco-contribution

  - `cancelations.fees` (array)
    List of fees canceled on the order line

  - `cancelations.fees.amount` (number)
    Order Fee amount

  - `cancelations.fees.code` (string)
    Order Fee code

  - `cancelations.order_line_id` (string, required)
    Order line's identifier on which the cancellation has been created

  - `cancelations.purchase_information` (object)
    Cancelation’s purchase information
Only available for One Creditor offers

  - `cancelations.purchase_information.purchase_commission_on_fees` (object)
    Cancelation’s purchase commission total amount on fees

  - `cancelations.purchase_information.purchase_commission_on_fees.total_amount` (number, required)
    Cancelation’s purchase commission total amount on fees

  - `cancelations.purchase_information.purchase_commission_on_price` (number, required)
    Cancelation’s purchase commission amount

  - `cancelations.purchase_information.purchase_commission_on_shipping` (number, required)
    Cancelation’s purchase commission amount on shipping

  - `cancelations.purchase_information.purchase_fee_amount` (object)
    Cancelation’s purchase fees

  - `cancelations.purchase_information.purchase_fee_amount.total_amount` (number, required)
    Cancelation’s purchase fee total amount

  - `cancelations.purchase_information.purchase_price` (number, required)
    Cancelation’s purchase price excluding shipping charges and fees

  - `cancelations.purchase_information.purchase_shipping_price` (number, required)
    Cancelation’s purchase shipping charges

  - `cancelations.quantity` (integer)
    The quantity of canceled goods

  - `cancelations.reason_code` (string, required)
    Cancellation's reason code

  - `cancelations.shipping_amount` (number, required)
    The shipping charges part amount of the cancellation

  - `cancelations.shipping_amount_breakdown` (object)
    The breakdown of the shipping charges to be canceled, only available when advanced features are enabled

  - `cancelations.shipping_amount_breakdown.parts` (array, required)
    The parts which constitute the total amount. Each part can have different invoicing rules. The sum of the amount of each part is equal to the total amount. Multiple parts can be returned in tax mode TAX_INCLUDED.

  - `cancelations.shipping_amount_breakdown.parts.amount` (number, required)
    Part's amount. The sum of each part's amount is equal to the total amount.

  - `cancelations.shipping_amount_breakdown.parts.commissionable` (boolean)
    Should this amount be applied to the sellers commissions calculation.

  - `cancelations.shipping_amount_breakdown.parts.debitable_from_customer` (boolean)
    Should this amount be debited to the customer. If true, the amount is taken into account when generating the debit file.If false, the amount is not taken into account when generating the debit file.

  - `cancelations.shipping_amount_breakdown.parts.payable_to_shop` (boolean)
    Should this amount be paid to the shop. If true, the amount is taken into account when generating the shop payment voucher.If false, the amount is not taken into account when generating the shop payment voucher.

  - `cancelations.shipping_taxes` (array)
    List of taxes canceled on shipping charges

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

  - `cancelations.shipping_taxes.amount_breakdown` (object)
    The breakdown of the tax amount, only available when advanced features are enabled

  - `cancelations.shipping_taxes.amount_breakdown.parts` (array, required)
    The parts which constitute the total amount. Each part can have different invoicing rules. The sum of the amount of each part is equal to the total amount. Multiple parts can be returned in tax mode TAX_INCLUDED.

  - `cancelations.shipping_taxes.amount_breakdown.parts.amount` (number, required)
    Part's amount. The sum of each part's amount is equal to the total amount.

  - `cancelations.shipping_taxes.amount_breakdown.parts.commissionable` (boolean)
    Should this amount be applied to the sellers commissions calculation.

  - `cancelations.shipping_taxes.amount_breakdown.parts.debitable_from_customer` (boolean)
    Should this amount be debited to the customer. If true, the amount is taken into account when generating the debit file.If false, the amount is not taken into account when generating the debit file.

  - `cancelations.shipping_taxes.amount_breakdown.parts.payable_to_shop` (boolean)
    Should this amount be paid to the shop. If true, the amount is taken into account when generating the shop payment voucher.If false, the amount is not taken into account when generating the shop payment voucher.

  - `cancelations.shipping_taxes.code` (string, required)
    Tax code

  - `cancelations.shipping_taxes.purchase_tax` (object)
    Purchase tax information

  - `cancelations.shipping_taxes.purchase_tax.purchase_amount` (number, required)
    Purchase tax amount

  - `cancelations.shipping_taxes.purchase_tax.purchase_rate` (number)
    Purchase tax rate

  - `cancelations.shipping_taxes.rate` (number)
    Tax rate

  - `cancelations.taxes` (array)
    List of taxes canceled on product price

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

  - `cancelations.taxes.amount_breakdown` (object)
    The breakdown of the tax amount, only available when advanced features are enabled

  - `cancelations.taxes.amount_breakdown.parts` (array, required)
    The parts which constitute the total amount. Each part can have different invoicing rules. The sum of the amount of each part is equal to the total amount. Multiple parts can be returned in tax mode TAX_INCLUDED.

  - `cancelations.taxes.amount_breakdown.parts.amount` (number, required)
    Part's amount. The sum of each part's amount is equal to the total amount.

  - `cancelations.taxes.amount_breakdown.parts.commissionable` (boolean)
    Should this amount be applied to the sellers commissions calculation.

  - `cancelations.taxes.amount_breakdown.parts.debitable_from_customer` (boolean)
    Should this amount be debited to the customer. If true, the amount is taken into account when generating the debit file.If false, the amount is not taken into account when generating the debit file.

  - `cancelations.taxes.amount_breakdown.parts.payable_to_shop` (boolean)
    Should this amount be paid to the shop. If true, the amount is taken into account when generating the shop payment voucher.If false, the amount is not taken into account when generating the shop payment voucher.

  - `cancelations.taxes.code` (string, required)
    Tax code

  - `cancelations.taxes.purchase_tax` (object)
    Purchase tax information

  - `cancelations.taxes.purchase_tax.purchase_amount` (number, required)
    Purchase tax amount

  - `cancelations.taxes.purchase_tax.purchase_rate` (number)
    Purchase tax rate

  - `cancelations.taxes.rate` (number)
    Tax rate

  - `order_tax_mode` (string, required)
    Please note: In case there is no tax, the prices will show the same amount in TAX_EXCLUDED and TAX_INCLUDED mode. The tax mode is only useful if taxes are specified in the cancelation.Possible values: TAX_EXCLUDED: the price fields (amount, shipping amount) are expressed without tax (taxes should be added to these prices in order to get the full amount including taxes).TAX_INCLUDED: the price fields include the tax amount.
    Enum: "TAX_INCLUDED", "TAX_EXCLUDED"


