Skip to content

OR30 - Perform cancelations on order lines

Request

Call Frequency
Maximum usage: At each order (or order line) cancelation
Security
Shop-API-Key(Required scopes: ROLE_SHOP_ADMINROLE_PARTNER_ORDER_CANCEL)
Query
shop_idinteger, (int64)

Use this parameter when your user has access to several shops. If not specified, the shop_id from your default shop will be used.

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?shop_id=0' \
  -H 'Authorization: YOUR_API_KEY_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" }