Skip to content

OR30 - Perform cancelations on order lines

Request

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
Maximum usage: At each order (or order line) cancelation
Security
Front-Bearer-Token or OAuth-2
Bodyapplication/json
cancelationsArray of objectsrequired

List of representations of cancellations to be created

order_tax_modestring

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"

curl -i -X PUT \
  https://your-instance.mirakl.net/api/orders/cancel \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "cancelations": [
      {
        "amount": 2,
        "currency_iso_code": "USD",
        "fees": [
          {
            "amount": 0.5,
            "code": "CARD_FEE"
          },
          {
            "amount": 0.25,
            "code": "EU_DRS"
          }
        ],
        "order_line_id": "Order_00013-A-1",
        "quantity": 0,
        "reason_code": 34,
        "shipping_amount": 0,
        "shipping_taxes": [
          {
            "amount": "1",
            "code": "tax1"
          },
          {
            "amount": "1",
            "code": "tax2"
          }
        ],
        "taxes": [
          {
            "amount": 1,
            "code": "tax1"
          },
          {
            "amount": 1,
            "code": "tax2"
          }
        ]
      }
    ],
    "order_tax_mode": "TAX_EXCLUDED"
  }'

Responses

OK

Bodyapplication/json
cancelationsArray of objectsrequired

List of representations of created cancellations

order_tax_modestringrequired

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"

Response
{ "cancelations": [ { … } ], "order_tax_mode": "TAX_EXCLUDED" }