Skip to main content
Purchasing digital assets through Erysta is an atomic process designed for high-reliability. This section explains how to handle the full procurement lifecycle, from placing a bulk order to retrieving your final digital content.

The Ordering Workflow

Unlike some APIs that return keys directly in the purchase response, Erysta uses a two-step fulfillment pattern to ensure data integrity and support asynchronous processing.
1

1. Place the Order (POST /place-order)

Initiate the procurement process by submitting your item list. Erysta performs an atomic check on your Balance + Credit Limit and verifies real-time stock availability.Request Body:
{
  "items": [
    {
      "id": "69ae19b4397b2e44c02853f6",
      "quantity": 1
    }
  ],
  "reference_id": "MY-SHOP-12345"
}
Response Example: If successful, the API returns a unique id. You will use this identifier in the next step to fetch your keys.
{
  "status": 200,
  "success": true,
  "details": {
    "data": {
      "id": "ABCD1234"
    },
    "extensions": {
      "trace_id": "req-7f8a9b2c...",
      "timestamp": "2026-03-09T15:30:00.000Z"
    }
  }
}
2

2. Retrieve Digital Assets (GET /orders/{id}/keys)

Use the id from the previous step to retrieve your digital content. Since fulfillment can be asynchronous depending on the supplier, you should monitor the status field.

Content Formats

The keys array returns the actual assets in two primary formats:
  • Text: Standard alphanumeric codes (e.g., Steam, Epic, PSN).
  • Image: A Base64 Data URL. This allows you to inject the value directly into an <img src="..." /> tag—ideal for QR codes or scanned vouchers.
Delivery Timing & Polling Strategy:
  • Performance: Most orders are fulfilled within seconds.
  • Edge Cases: Some sources may require 15 to 20 minutes for full processing.
  • Best Practice: We recommend a polling interval of 30 seconds until the order status reaches a terminal state (COMPLETED or FAILED).
Full Response Example:
{
  "status": 200,
  "success": true,
  "details": {
    "data": {
      "id": "ABCD1234",
      "status": "COMPLETED",
      "products": [
        {
          "id": "69ae2cb3a9a53ba2d777fe59",
          "title": "Test Product - TXT",
          "quantity": 1,
          "keys": [
            {
              "value": "AAAAA-BBBBB-CCCCC",
              "type": "text"
            }
          ]
        },
        {
          "id": "69ae2cb3a9a53ba2d777fe5a",
          "title": "Test Product - IMG",
          "quantity": 1,
          "keys": [
            {
              "value": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ...",
              "type": "image"
            }
          ]
        }
      ]
    },
    "extensions": {
      "trace_id": "req-7f8a9b2c...",
      "timestamp": "2026-03-09T15:30:00.000Z"
    }
  }
}

Fulfillment Statuses

When polling for keys, you should monitor the status field. Your integration should continue polling as long as the status is PENDING or PROCESSING.
StatusDescription
PENDINGThe order has been received and is currently in the queue for processing.
PROCESSINGOur stock controllers are actively fetching your keys from the source.
COMPLETEDAll requested items have been successfully delivered and are ready for retrieval.
PARTIAL_COMPLETEDSome items were delivered, but others failed.
FAILEDA critical error occurred; the order was not fulfilled. No funds deducted.
REFUNDEDThe order was cancelled after payment; funds were returned to your balance.