Skip to main content
GET
/
inventory
Get inventory
curl --request GET \
  --url https://api.merchant.example/opencharge/inventory
{
  "ocid": 500,
  "currency": "USD",
  "items": [
    {
      "id": "item_001",
      "name": "Coca-Cola",
      "description": "330ml can",
      "price": "2.50",
      "quantity": 15,
      "min_qty": 1,
      "max_qty": 5,
      "images": [
        "https://merchant.example/images/coke.jpg"
      ],
      "url": "https://merchant.example/products/coca-cola"
    },
    {
      "id": "item_002",
      "name": "Snickers Bar",
      "description": "52g chocolate bar",
      "price": "1.75",
      "quantity": 8,
      "min_qty": 1,
      "max_qty": 10,
      "images": [
        "https://merchant.example/images/snickers.jpg"
      ],
      "url": "https://merchant.example/products/snickers"
    }
  ]
}
This endpoint is designed for merchants with small, fixed inventories such as vending machines, kiosks, or simple storefronts.

Use Cases

  • Vending machines - Display available snacks and drinks
  • Kiosks - Show menu items with prices
  • Mobile top-up - List available recharge amounts
  • Simple stores - Present a catalog of products

Item Fields

FieldRequiredDescription
idYesUnique item identifier
nameYesDisplay name
priceYesUnit price as decimal string
descriptionNoItem description
quantityNoAvailable stock
min_qtyNoMinimum order quantity (default: 1)
max_qtyNoMaximum order quantity
imagesNoArray of image URLs
urlNoLink to item details page

Example Response

{
  "ocid": 500,
  "currency": "USD",
  "items": [
    {
      "id": "item_001",
      "name": "Coca-Cola",
      "description": "330ml can",
      "price": "2.50",
      "quantity": 15,
      "min_qty": 1,
      "max_qty": 5,
      "images": ["https://merchant.example/images/coke.jpg"]
    },
    {
      "id": "item_002",
      "name": "Snickers Bar",
      "description": "52g chocolate bar",
      "price": "1.75",
      "quantity": 8,
      "images": ["https://merchant.example/images/snickers.jpg"]
    }
  ]
}
For larger catalogs or dynamic inventory, consider implementing a paginated endpoint or directing users to your web store.

Response

200 - application/json

Inventory retrieved successfully

Your merchant's full inventory listing

ocid
integer
required

Your merchant's OCID

items
object[]
required

Available inventory items

currency
string

Default ISO 4217 currency code for item prices