Working with Orders

The overall operation consists in the following steps:

1. Creating orders

At the first stage, it is necessary to create a new order with one of the types above, once your customer wants to do cash-in or cash-out. Depending on your agreement, after creating the order, it is also needed to send the user KYC data. Optionally, this can also be done on the same request.

Once an order is created, the endpoint returns the full order information. It includes a link (where you can send your user to), but it also includes the full order information (i.e. banking information for depositing, if it is a cash-in order). This means that if you prefer to run all the user flow on your own UI, this is completely possible, and the entire communication to our servers happen only from your servers, in the backyards.

For cash-out, at this stage, you may either deduct the funds from your customer's balance, but keep in mind that it might be needed to refund such balance back if the order fails (i.e. the user has entered incorrect details or the remote bank account has limits issues). Therefore, if your application has a funds locking system, it might be advisable to use such feature for locking the funds until the cash-out order is set to a final status.

2. Listening for updates

After creating the order, it is needed to listen to the various events that each order is subject to. There are several ways to keep track of the orders status changes:

  • Through real-time securely signed webhooks calls (Instant Payment Notification)
  • Using the Notifications endpoint, which returns only the latest updated orders in a list
  • By polling at the Get Order endpoint for each order until a final status is returned

Keep in mind that you must keep track of each order status and validate whether the new status is valid for preventing double crediting users if a webhooks call is repeated or delayed in a processing queue.

3. Finalizing the order

Once a final status is received, you may apply the related changes on your system, which could mean the confirmation of a deduction or a balance addition. More details about what to do (and what not to do) in each case is available on "Possible order statuses", on this documentation.