Alokai

unreserveInventory

Remove reservations for canceled orders or carts. When using the unreserve/release endoint, the reservation counts are removed from the location or group using the details provided in the call instead of the details in a reservation document (which isn't provided as part of the call to this endpoint)

Calls the unreserveReservations endpoint exposed by SCAPI. *

Signature

export declare function unreserveInventory(
	props: ReservationUnreserveParams
): Promise<ReservationUnreserveResponse>;

Parameters

NameRequiredTypeDescription
propsRequiredReservationUnreserveParamsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.

Returns

Returns a representation of the un-reservation result.

Referenced Types

  • ReservationUnreserveParams
  • ReservationUnreserveResponse

Examples

Unreserve by group only.

import { sdk } from '~/sdk.config.ts';

const data: ReservationUnreserveParams = {
  "records": [
    {
      "id": "82251928-8863-488e-840b-2aebd10b57ba",
      "externalRefId": "7282822-9823-aaa",
      "group": "UnitedStates",
      "sku": "sku1234",
      "quantity": 1200.35
    }
  ]
};

const result = await sdk.commerce.unreserveInventory(data);

Unreserve by location only.

import { sdk } from '~/sdk.config.ts';

const data: ReservationUnreserveParams = {
  "records": [
    {
      "id": "82251928-8863-488e-840b-2aebd10b57ba",
      "externalRefId": "7282822-9823-aaa",
      "location": "warehouse5",
      "sku": "sku1234",
      "quantity": 1200.35
    }
  ]
};

const result = await sdk.commerce.unreserveInventory(data);

Unreserve by group and location.

import { sdk } from '~/sdk.config.ts';

const data: ReservationUnreserveParams = {
  "records": [
    {
      "id": "82251928-8863-488e-840b-2aebd10b57ba",
      "externalRefId": "7282822-9823-aaa"
      "location": "warehouse5",
      "sku": "sku1234",
      "quantity": 1200.35
    },
    {
      "id": "82251928-8863-488e-840b-2aebd10b6666",
      "externalRefId": "7282822-9823-bbb"
      "group": "UnitedStates",
      "sku": "sku5678",
      "quantity": 1.35
    }
  ]
};

const result = await sdk.commerce.unreserveInventory(data);

On this page