Update Inventory

Action types

Type

Description

increment

You'll use this when you receive stock from a supplier, making products available for purchase

decrement

You'll use this when you want to remove stock from product inventory

allocate

You'll use this when you want to allocate stock, normally to a reseller who will sell on the stock

deallocate

You'll use this when you want to deallocate any previously allocated stock

Create a Stock Transaction for a Product

POST https://api.moltin.com/v2/inventories/:productId/transactions

Path Parameters

NameTypeDescription

productId

string

The ID for the product you're performing this action on

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

Request Body

NameTypeDescription

quantity

integer

The amount of stock affected by this transaction

action

string

increment, decrement, allocate, deallocate

type

string

Always stock-transaction

{
  "data": {
    "id": "da9a0008-d2c4-4a17-bbc6-5e0b2f9430aa",
    "type": "stock-transaction",
    "action": "increment",
    "product_id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
    "quantity": 10,
    "timestamps": {
      "created_at": "2018-05-01 10:10:57 +0000 UTC"
    }
  }
}
curl -X POST https://api.moltin.com/v2/inventories/:productId/transactions \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
       "data": {
         "type": "stock-transaction",
         "action": "increment",
         "quantity": 10
       }
     }'

Last updated