API ReferenceVouchers

Availability

Check real-time product availability before placing an order

POST /api/v1/products/:id/availability

Check whether a product can be fulfilled at a given denomination and quantity. This is a real-time check against current inventory - use it before placing orders to avoid failures.

This endpoint is not cached. Each call checks live inventory.

Request

curl -X POST "https://api.octopuscards.io/api/v1/products/123/availability" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "denomination": 50.00,
    "quantity": 5
  }'

Request Parameters

KeyTypeRequiredDescription
idintegerYesProduct ID (path parameter)
denominationnumberYesFace value to check. Must be greater than 0.
quantityintegerYesNumber of vouchers to check. Must be greater than 0.

Response

{
  "is_available": true
}

Response Fields

KeyTypeDescription
is_availablebooleantrue if the product can be fulfilled at the requested denomination and quantity

How Availability is Determined

Octopus Cards checks whether there is sufficient inventory for the requested denomination and quantity. A product is available if inventory can fulfill the order.

Errors

400 Bad Request - Product ID is not valid.

{
  "error": {
    "name": "BadRequestError",
    "code": "BAD_REQUEST",
    "message": "Invalid product ID"
  }
}

On this page