• PXM Products/
    PXM Products Inventory API/
    Create Inventory

    Create Inventory

    Product Experience Manager (EP PXM) Only

    This endpoint works only with products that are created with the EP PXM Products API.

    POST Create Inventory

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

    Sets the inventory quantity for the specified product. When you take this action, you are choosing to manage the inventory for this product in Elastic Path Commerce Cloud.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    productIdRequiredstringThe unique identifier of the product.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token to grant access to the API.

    Body

    NameRequiredTypeDescription
    quantityRequiredintegerThe amount of inventory available.

    Request Example

    curl -X POST https://api.moltin.com/v2/inventories/f5bd4e59-a95f-4bda-bfe6-0f34f47ac94b \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
            "data": {
                "quantity": 1000
                }
            }
        }'
    

    Response Example

    200 OK

    {
        "data": {
           "quantity": 1000
            }
        }
    }
    

    Was this helpful?

    Previous
    Get Multiple Stocks