.. and press ENTER to ask a question on web5, how to write code and more.

Skip to main content

Processing Orders

After the Wallet app receives a Quote from your PFI, they are able to submit an Order. This guide covers how to use tbDEX to communicate progress on Orders you receive.

Receiving an Order​

When a Wallet application places an order, your server's onSubmitOrder() callback parameter will be invoked. This is where you should implement your business logic for handling these incoming orders.

As a best practice, store the Order message in your Exchanges database.

Accessing Hashed Data​

The payment details for the Order were specified in the RFQ message that was sent by the Wallet application.

Sensitive information such as payment details and claims are hashed and are accessible from the privateData section of the RFQ:

JavaScript
Kotlin
Swift

Using this information, you are free to use the logic of choice to fulfill the Order.

note

tbDEX is a messaging protocol that facilitates communication to enable transactions but does not actually provide the APIs to fulfill them. That responsibility lies with the transacting parties.

Provide Order Status​

As you deem appropriate for your customers, you can provide them with OrderStatus messages to keep them updated on the status of their Order:

JavaScript
Kotlin
Swift

If the Wallet application supplied a replyTo address, the tbDEX SDK will send the OrderStatus message there.

You should also write the OrderStatus to your database and the Wallet will poll for these updates.

Close the Order​

When the Order has reached a terminal state (e.g. order fulfilled, order rejected, etc), you can create a Close message, which will be the final message of the thread:

JavaScript
Kotlin
Swift

After writing the Close message to your database, the Wallet will be able to know that their transaction has closed via polling or callback.

Connect with us on Discord

Submit feedback: Open a GitHub issue

Edit this page: GitHub Repo

Contribute: Contributing Guide