Skip to main content

Documentation Portal

Out of Stock

The Out of Stock (OOS) feature allows merchants to indicate products as out-of-stock through the CreateOrderRefund API without specifying the refund amount.

This feature enabled the following actions:

  • Modification of the product quantity.

  • Recalculation of duties and taxes.

  • Adjustment of shipping costs (if there are no flat rates).

  • The update of associated documents.

  • The Issuing of a product refund.

  • If all the products within an order are indicated as out of stock, the order status is changed to 'Cancelled by Merchant'.

Mapping

Out-of-stock products must be assigned a pre-mapped refund reason in order to be recognized by the system.

Mapping is established between the merchant's refund reasons and Global-e's internal reasons, as specified in the MapMerchantOrderRefundReasons table,

Examples of codes in the MapMerchantOrderRefundReasons table

Code

Refund Reason

5

Out of Stock

14

Out-of-Stock Item

23

Product out of stock

Refunds

  • The out-of-stock quantities are indicated by using the product quantity field.

  • Any provided amount associated with a product with an out-of-stock refund reason is ignored.

  • If out-of-stock is provided for a product that a product appeasement is made for, only the remaining amounts are refunded.

Validation Errors

The following situations cause the amend and refund operation to fail and return an error in the CreateOrderRefund response.

Situation

Error Message

Combining various refund reasons, including out-of-stock and non-out-of-stock reasons, within a single CreateOrderRefund request.

"Issuing a refund for out-of-stock products alongside other refund reasons is not permitted. Please include any out-of-stock products in a separate call without other refund reasons."

If the quantity of out-of-stock products exceeds the quantity of remaining products.

"The number of out-of-stock products exceeds the number of remaining products."

If the quantity of out-of-stock products is zero or not provided.

"Out-of-stock quantity missing or zero. Please provide a valid quantity."

If a product is declared as out-of-stock for an order in a not allowed status.

Note: Out-of-stock products can only be declared for pre-shipped products.

“The current order status %Order status name% does not permit the declaration of out-of-stock products”.

Example (partial payload):

[
   {
      "CartItemId":"39493377065032-0",
      "RefundQuantity":1,
      "RefundAmount":79.00,
      "RefundReason":{
         "OrderRefundReasonCode":"Out of stock",
         "Name":"Out of stock"
      }
   },
   {
      "CartItemId":"39638402039880-1",
      "RefundQuantity":1,
      "RefundAmount":0.00,
      "RefundReason":{
         "OrderRefundReasonCode":"Out of stock",
         "Name":"Out of stock"
      }
   }
]