type StockType = "stock"; type StockTransactionType = "stock-transaction"; type Type = "stock"; type MultipleProducts = { type?: "stock"; /** * The unique identifier of the product. */ id: string; }; type TransactionResponse = { id: Uuid; type: StockTransactionType; attributes: TransactionResponseAttributes; meta?: Meta; }; /** * The type of action performed by this transaction. * * - **increment** - use this when you want to make products available for purchase, for example, when you have received stock from a supplier. * * - **decrement** - Use this when you want to remove stock from product inventory. * * - **allocate** - Use this when you want to allocate stock, normally to a reseller who sells on the stock. * * - **deallocate** - Use this when you want to deallocate any previously allocated stock. * */ type Action = "increment" | "decrement" | "allocate" | "deallocate"; type TransactionResponseAttributes = { /** * The type of action performed by this transaction. * * - **increment** - use this when you want to make products available for purchase, for example, when you have received stock from a supplier. * * - **decrement** - Use this when you want to remove stock from product inventory. * * - **allocate** - Use this when you want to allocate stock, normally to a reseller who sells on the stock. * * - **deallocate** - Use this when you want to deallocate any previously allocated stock. * */ action: "increment" | "decrement" | "allocate" | "deallocate"; product_id: Uuid; /** * The amount of stock affected by the stock transaction. */ quantity: BigInt; /** * The slug of the location that the transaction should act on. */ location?: string; }; type StockCreate = { id?: Uuid; type: StockType; attributes: StockCreateAttributes; }; type StockUpdateRequest = { id: Uuid; type: StockType; attributes: StockUpdateAttributes; }; type StockUpdateAttributes = { locations?: NullableLocations; }; type NullableLocation = { available: BigInt; } | null; type NullableLocations = { [key: string]: NullableLocation; }; type StockCreateAttributes = { available?: BigInt; locations?: { [key: string]: { available: BigInt; }; }; }; type StockResponse = { id: Uuid; type: StockType; attributes: StockResponseAttributes; meta: StockMeta; }; type StockResponseAttributes = { available: BigInt; allocated: BigInt; total: BigInt; locations?: StockLocations; }; type StockLocations = { [key: string]: { available: BigInt; allocated: BigInt; total: BigInt; }; }; type TransactionCreate = { type: StockTransactionType; attributes: TransactionCreateAttributes; }; type TransactionCreateAttributes = { product_id?: Uuid; /** * The type of action being performed by this transaction. * * - **increment** - use this when you want to make products available for purchase, for example, when you have received stock from a supplier. * * - **decrement** - Use this when you want to remove stock from product inventory. * * - **allocate** - Use this when you want to allocate stock, normally to a reseller who sells on the stock. * * - **deallocate** - Use this when you want to deallocate any previously allocated stock. * * - **set** - Use this when you want to set total stock to a specific value. * */ action: "increment" | "decrement" | "allocate" | "deallocate" | "set"; /** * The amount of stock affected by the stock transaction. */ quantity: BigInt; /** * The slug of the location that the transaction should act on. */ location?: string; }; type Location = { id: Uuid; type: InventoryLocationType; attributes: LocationAttributes; meta?: Meta; }; type LocationAttributes = { name: string; external_ref?: string; slug: string; description?: string; address?: Array; geolocation?: GeolocationDetails; }; type LocationUpdateAttributes = { name?: string; external_ref?: string | null; slug?: string; description?: string | null; address?: Array | null; geolocation?: GeolocationDetails; }; /** * The longitude and latitude of a location. */ type GeolocationDetails = { lat: number; lon: number; } | null; type LocationRequest = { type?: InventoryLocationType; attributes: LocationAttributes; }; type LocationUpdateRequest = { id: Uuid; type: InventoryLocationType; attributes: LocationUpdateAttributes; }; type InventoryLocationType = "inventory_location"; /** * The unique identifier. */ type Uuid = string; type Timestamps = { /** * The date and time a resource was updated. */ updated_at?: string; /** * The date and time a resource was created. */ created_at: string; }; type StockMeta = { stock_id: Uuid; timestamps: Timestamps; }; type Meta = { timestamps: Timestamps; }; type ErrorResponse = { errors: Array<_Error>; }; type _Error = { /** * The HTTP response code of the error. */ status: string; /** * A brief summary of the error. */ title: string; /** * Optional additional detail about the error. */ detail?: string; /** * Additional supporting meta data for the error. */ meta?: { [key: string]: unknown; }; }; type Links = { [key: string]: Link; }; type Link = LinkUri | LinkObject; type LinkUri = string | null; type LinkObject = { href?: string; title?: string; describedby?: string; }; /** * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ type PageOffset = number; /** * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ type PageLimit = number; /** * Some Inventories API endpoints support filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. * */ type Filter = string; type ListStockData = { body?: never; path?: never; query?: { /** * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ "page[offset]"?: number; /** * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ "page[limit]"?: number; /** * Some Inventories API endpoints support filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. * */ filter?: string; }; url: "/inventories"; }; type ListStockErrors = { /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type ListStockError = ListStockErrors[keyof ListStockErrors]; type ListStockResponses = { /** * Success. All products and their stock values are returned */ 200: { data: Array; links: Links; }; }; type ListStockResponse = ListStockResponses[keyof ListStockResponses]; type CreateStockData = { body?: { data: StockCreate; }; path?: never; query?: never; url: "/inventories"; }; type CreateStockErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type CreateStockError = CreateStockErrors[keyof CreateStockErrors]; type CreateStockResponses = { /** * Success. Stock was successfully created for product */ 201: { data: StockResponse; }; }; type CreateStockResponse = CreateStockResponses[keyof CreateStockResponses]; type GetStockForProductsData = { body?: { data: Array; }; path?: never; query?: never; url: "/inventories/multiple"; }; type GetStockForProductsErrors = { /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type GetStockForProductsError = GetStockForProductsErrors[keyof GetStockForProductsErrors]; type GetStockForProductsResponses = { /** * Success. Multiple products and their stock values are returned. */ 200: { data?: Array; }; }; type GetStockForProductsResponse = GetStockForProductsResponses[keyof GetStockForProductsResponses]; type DeleteStockData = { body?: never; path: { /** * The unique identifier of the product. */ product_uuid: Uuid; }; query?: never; url: "/inventories/{product_uuid}"; }; type DeleteStockErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type DeleteStockError = DeleteStockErrors[keyof DeleteStockErrors]; type DeleteStockResponses = { /** * Success. Removes the stock information about the product */ 204: void; }; type DeleteStockResponse = DeleteStockResponses[keyof DeleteStockResponses]; type GetStockData = { body?: never; path: { /** * The unique identifier of the product. */ product_uuid: Uuid; }; query?: never; url: "/inventories/{product_uuid}"; }; type GetStockErrors = { /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type GetStockError = GetStockErrors[keyof GetStockErrors]; type GetStockResponses = { /** * Success. Returns the stock for the given product UUID */ 200: { data: StockResponse; }; }; type GetStockResponse = GetStockResponses[keyof GetStockResponses]; type UpdateStockData = { body?: { data: StockUpdateRequest; }; path: { /** * The unique identifier of the product. */ product_uuid: Uuid; }; query?: never; url: "/inventories/{product_uuid}"; }; type UpdateStockErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type UpdateStockError = UpdateStockErrors[keyof UpdateStockErrors]; type UpdateStockResponses = { /** * Success. The stock item was updated successfully. */ 200: { data: StockResponse; }; }; type UpdateStockResponse = UpdateStockResponses[keyof UpdateStockResponses]; type ListTransactionsData = { body?: never; path: { /** * The unique identifier of the product. */ product_uuid: Uuid; }; query?: { /** * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ "page[offset]"?: number; /** * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ "page[limit]"?: number; /** * Some Inventories API endpoints support filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. * */ filter?: string; }; url: "/inventories/{product_uuid}/transactions"; }; type ListTransactionsErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type ListTransactionsError = ListTransactionsErrors[keyof ListTransactionsErrors]; type ListTransactionsResponses = { /** * Success. Returns the stock for the given product */ 200: { data?: Array; links?: Links; }; }; type ListTransactionsResponse = ListTransactionsResponses[keyof ListTransactionsResponses]; type CreateTransactionData = { body?: { data: TransactionCreate; }; path: { /** * The unique identifier of the product. */ product_uuid: Uuid; }; query?: never; url: "/inventories/{product_uuid}/transactions"; }; type CreateTransactionErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * The request was understood, but could not be processed by the server */ 422: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type CreateTransactionError = CreateTransactionErrors[keyof CreateTransactionErrors]; type CreateTransactionResponses = { /** * Success. Stock was successfully created for product */ 201: { data?: TransactionResponse; }; }; type CreateTransactionResponse = CreateTransactionResponses[keyof CreateTransactionResponses]; type GetTransactionData = { body?: never; path: { /** * The unique identifier of the product. */ product_uuid: Uuid; /** * The unique identifier of the transaction. */ transaction_uuid: Uuid; }; query?: never; url: "/inventories/{product_uuid}/transactions/{transaction_uuid}"; }; type GetTransactionErrors = { /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; /** * Internal server error. There was a system failure in the platform. */ 500: ErrorResponse; }; type GetTransactionError = GetTransactionErrors[keyof GetTransactionErrors]; type GetTransactionResponses = { /** * Success. Returns the stock transaction for the given product */ 200: { data?: TransactionResponse; }; }; type GetTransactionResponse = GetTransactionResponses[keyof GetTransactionResponses]; type ListLocationsData = { body?: never; path?: never; query?: { /** * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ "page[offset]"?: number; /** * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. */ "page[limit]"?: number; /** * Some Inventories API endpoints support filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. * */ filter?: string; }; url: "/inventories/locations"; }; type ListLocationsErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; }; type ListLocationsError = ListLocationsErrors[keyof ListLocationsErrors]; type ListLocationsResponses = { /** * Success. A list of locations is returned */ 200: { data?: Array; links?: Links; }; }; type ListLocationsResponse = ListLocationsResponses[keyof ListLocationsResponses]; type CreateLocationData = { body?: { data: LocationRequest; }; path?: never; query?: never; url: "/inventories/locations"; }; type CreateLocationErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; }; type CreateLocationError = CreateLocationErrors[keyof CreateLocationErrors]; type CreateLocationResponses = { /** * Success. The location was created successfully */ 201: { data?: Location; }; }; type CreateLocationResponse = CreateLocationResponses[keyof CreateLocationResponses]; type DeleteLocationData = { body?: never; path: { /** * The unique identifier of the location. */ location_uuid: Uuid; }; query?: never; url: "/inventories/locations/{location_uuid}"; }; type DeleteLocationResponses = { /** * Success. The location is deleted */ 204: void; }; type DeleteLocationResponse = DeleteLocationResponses[keyof DeleteLocationResponses]; type GetLocationData = { body?: never; path: { /** * The unique identifier of the location. */ location_uuid: Uuid; }; query?: never; url: "/inventories/locations/{location_uuid}"; }; type GetLocationErrors = { /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; }; type GetLocationError = GetLocationErrors[keyof GetLocationErrors]; type GetLocationResponses = { /** * Success. The location is returned */ 200: { data?: Location; }; }; type GetLocationResponse = GetLocationResponses[keyof GetLocationResponses]; type UpdateLocationData = { body?: { data: LocationUpdateRequest; }; path: { /** * The unique identifier of the location. */ location_uuid: Uuid; }; query?: never; url: "/inventories/locations/{location_uuid}"; }; type UpdateLocationErrors = { /** * Bad request. The request failed validation. */ 400: ErrorResponse; /** * Not found. The requested entity does not exist. */ 404: ErrorResponse; }; type UpdateLocationError = UpdateLocationErrors[keyof UpdateLocationErrors]; type UpdateLocationResponses = { /** * Success. The location was updated successfully */ 200: { data?: Location; }; }; type UpdateLocationResponse = UpdateLocationResponses[keyof UpdateLocationResponses]; export type { Action, CreateLocationData, CreateLocationError, CreateLocationErrors, CreateLocationResponse, CreateLocationResponses, CreateStockData, CreateStockError, CreateStockErrors, CreateStockResponse, CreateStockResponses, CreateTransactionData, CreateTransactionError, CreateTransactionErrors, CreateTransactionResponse, CreateTransactionResponses, DeleteLocationData, DeleteLocationResponse, DeleteLocationResponses, DeleteStockData, DeleteStockError, DeleteStockErrors, DeleteStockResponse, DeleteStockResponses, ErrorResponse, Filter, GeolocationDetails, GetLocationData, GetLocationError, GetLocationErrors, GetLocationResponse, GetLocationResponses, GetStockData, GetStockError, GetStockErrors, GetStockForProductsData, GetStockForProductsError, GetStockForProductsErrors, GetStockForProductsResponse, GetStockForProductsResponses, GetStockResponse, GetStockResponses, GetTransactionData, GetTransactionError, GetTransactionErrors, GetTransactionResponse, GetTransactionResponses, InventoryLocationType, Link, LinkObject, LinkUri, Links, ListLocationsData, ListLocationsError, ListLocationsErrors, ListLocationsResponse, ListLocationsResponses, ListStockData, ListStockError, ListStockErrors, ListStockResponse, ListStockResponses, ListTransactionsData, ListTransactionsError, ListTransactionsErrors, ListTransactionsResponse, ListTransactionsResponses, Location, LocationAttributes, LocationRequest, LocationUpdateAttributes, LocationUpdateRequest, Meta, MultipleProducts, NullableLocation, NullableLocations, PageLimit, PageOffset, StockCreate, StockCreateAttributes, StockLocations, StockMeta, StockResponse, StockResponseAttributes, StockTransactionType, StockType, StockUpdateAttributes, StockUpdateRequest, Timestamps, TransactionCreate, TransactionCreateAttributes, TransactionResponse, TransactionResponseAttributes, Type, UpdateLocationData, UpdateLocationError, UpdateLocationErrors, UpdateLocationResponse, UpdateLocationResponses, UpdateStockData, UpdateStockError, UpdateStockErrors, UpdateStockResponse, UpdateStockResponses, Uuid, _Error };