Skip to content

Quickstart

See each step of a sandbox order with real responses, then place your first order from your own server in five minutes.

This page helps you place your first order in the sandbox. The sandbox is a test mode: it returns fixed answers and spends no money.

First you see each request and its real sandbox response: list products, place an order, and poll it until it reaches a final status. Polling means asking the API for the order again until its status changes. Then you send the same requests from your terminal with your own API key.

Before you start

  • A Cardzone store. Sign in at cardzone.ai/b2b.
  • A Sandbox API key. Create it on the Developers page in the dashboard. Sandbox API keys work right away. You don’t need business verification first.

Steps

  1. List the catalog

    The catalog is the list of products you can sell. Each product is one item at one fixed amount. To order a product, send its id as product_id. With a sandbox API key, each product id gives a fixed test result, called a scenario.

    GET /productsRecorded sandbox response
    GET
    Response
  2. Create an order

    Send the product, a quantity, and your own merchant_order_ref. merchant_order_ref is your own ID for the order. It makes retries safe: if you send the same merchant_order_ref again, you get 409 and no second order is created. Pick a scenario to see its response.

    POST /ordersRecorded sandbox response
    POST
    Response
  3. Poll until the status is final

    processing and action_required are not final. Keep polling until the status is fulfilled, failed, or canceled. In the example above, the Poll button switches to this request.

    GET /orders/{id}Recorded sandbox response
    GET
    Response
  4. Call it from your server

    Save your sandbox API key in the CARDZONE_API_KEY environment variable. Then copy any example request with Copy cURL, or start from these samples:

Check the result

You get a 201 Created response. Its status is fulfilled, and codes holds SANDBOX-CODE-123:

{
  "order_id": "1CAYVN8V9qVvrLwnnSZsPE",
  "merchant_order_ref": "shop-order-1001",
  "product_code": "sandbox-success-voucher",
  "status": "fulfilled",
  "code": "SANDBOX-CODE-123",
  "codes": ["SANDBOX-CODE-123"],
  "actions": []
}

Sandbox orders return their final status at once. A live order (a real order made with a live API key) can return processing first and reach its final status later. That is why you poll or listen for webhooks.

Next steps

Cardzone
Back to Cardzone

Type to search…

↑↓ navigate↵ selectEsc close