Skip to main content
Placing a card order is a three-step process: you verify that enough stock is available, reserve the cards against a transaction, and then confirm payment to unlock the card codes. Splitting the flow this way lets you check inventory before charging the customer and gives you a clear transaction record at every stage. Follow the steps below in order — skipping any one of them will result in an error.
Always check the available balance for a card_id before initiating an order. If you proceed without enough stock, the API will return error code 10006 (Insufficient Balance) and your order will fail without generating card codes.

Step 1 — Check available balance

Before you initiate any order, confirm that Wasl holds enough units of the card your customer wants. Endpoint

Required headers

Request body fields

Response

Response
If balance is less than the quantity your customer wants to purchase, show an out-of-stock message and do not proceed to the initiate step.

Step 2 — Initiate the card request

Once you have confirmed sufficient stock, reserve the cards by calling the Initiate Card Request endpoint. This creates a pending transaction and returns a transaction_id that you must use in the confirm step. Endpoint

Required headers

Request body fields

The quantiry field name is spelled this way in the Wasl API itself. You must pass the key exactly as quantiry — using the correct spelling (quantity) will cause the request to fail silently or be ignored.
Save the transaction_id returned in this response to durable storage immediately. You cannot confirm the order, retrieve card codes, or raise a support request without it. If your process crashes between the initiate and confirm steps, the transaction ID is your only recovery handle.

Step 3 — Confirm the order and receive card codes

After you have collected payment from your customer, call the Confirm Order endpoint to finalize the transaction. Wasl will verify the amount and release the card codes. Endpoint

Required headers

Request body fields

Response

A successful response returns an array of card objects — one per unit ordered. Each object contains a card_code and a card_number to deliver to the customer.
Response

Response fields

Deliver the card_code and card_number to your customer and persist the complete order record in your system.

Error code reference