Aller au contenu principal

Products, Delivery Types & Purchases

Browsing Products & Checking Prices​

Always read product availability and current pricing directly from:

Only products in ACTIVE status appear in catalog endpoints. Requesting a missing, draft, or archived product ID returns 409 Conflict (PRODUCT_UNAVAILABLE).

Stock Representation​

  • availableUnits: null indicates unlimited delivery stock (e.g., reusable unlimited license keys, static digital files, course/link/text products).
  • availableUnits: integer (0, 1, 25, ...) shows exact sellable units remaining. Attempting to buy more than available stock fails atomically with 409 Conflict (OUT_OF_STOCK), charging $0.

Delivery Types​

Delivery TypeItem Payload StructureAccess Method
LICENSE_KEY{ "type": "LICENSE_KEY", "key": "..." } (one OrderItem per unit)Synchronous JSON in POST /api/v1/purchases and GET /api/v1/orders/{orderId}
ACCOUNT{ "type": "ACCOUNT", "account": "..." } (one OrderItem per unit)Synchronous JSON payload
FILEFile metadata referenceBinary stream via GET /api/v1/orders/{orderId}/items/{itemId}/file
LINK / TEXT / COURSE / MANUALPayload URL/text/instructionsSynchronous JSON payload + resolved instructions

Purchasing & Idempotency​

POST /api/v1/purchases uses strict schema validation (additionalProperties: false). Passing any unaccepted field (such as a client-chosen price) immediately returns 400 VALIDATION_ERROR.

Required idempotencyKey Behavior​

Every purchase requires an idempotencyKey (8–128 characters, e.g., UUID v4 or your internal order ID):

  • First attempt: Debits balance atomically, consumes inventory, sets order status to DELIVERED, and responds 201 Created ("created": true).
  • Safe retry with same idempotencyKey & same owning user: Returns 200 OK ("created": false) with the previously fulfilled order without charging balance a second time or tripping purchase velocity guards.
  • Collision with another user's idempotencyKey: Rejected with 403 FORBIDDEN ("That order belongs to another account"). Never reuse predictable sequential IDs like "order-001" across tenants; include a UUID or your platform-unique order identifier.

Checking Order Status​

Orders execute synchronously inside one transaction (PENDING -> DELIVERED). To reconcile timed-out HTTP requests or fetch deliverables later, poll idempotently with GET /api/v1/orders/{orderId} or retry POST /api/v1/purchases with the exact same idempotencyKey.

Metered API Actions (POST /api/v1/actions)​

Non-order paid platform actions use server-defined fixed prices:

  • BULK_CATALOG_EXPORT: 0.500000 USDT
  • STOCK_RESERVATION_PING: 0.100000 USDT

Idempotency for /api/v1/actions is automatically namespaced per user (userId:idempotencyKey), and uses the same 402 balance checks, spend caps, and ledger recording (referenceType: "API_ACTION").