Get Order(s)
Fetch information about an Order once its completed
The status
of an Order can be one of the following
Draft
- This is an open or ongoing order
Expired
* - The user didn’t complete the transaction within the expiration
time
Processed
* - The payment has been completed.
Declined
* - The transacation was declined, due to payment method issues
Cancelled
* - The transaction did not complete, which could be for a number of reasons, as outlined in the reason codes below.
Complete
* - The payment is complete and the crypto has been delivered to the user’s wallet. A txHash
will be present to denote successful on chain settlement.
Refunded
- The User’s payment has been refunded to their original payment method
For Smart Contract Integrations
Orders might end up in Cancelled
state, due to a number of reasons, which Sardine will share through a reasonCode
parameter as part of an error
object in the Order. After an Order has been Cancelled, it will move to the Refunded
state
The following reason codes might appear
NETF
- Network Failure
PRCC
- Price Change beyond threshold
RISD
- Risk Decline
NA
- NFT Not Available
Events marked with an * can also be captured via event handlers on the frontend
Fetching Orders
Full list of Orders is obtained by making a call to the endpoint with no filters.
You have multiple options of filtering orders
- Filtering by
orderId
If aredirect_url
was passed to the Sardine checkout (e.g. https://crytpoapp.com”), when then transaction is completed, Sardine will redirect the user to this url with anorder_id
appended i.e. https://cryptoapp.com?order_id=73103-erhed-317313
This order_id
can then be used as a filter on this endpoint, this form
https://api.sandbox.sardine.ai/v1/orders/3103-erhed-317313
-
Filtering by
referenceId
If areferenceId
was passed in the call to create theclientToken
for this call, it can now be used to filter for Orders that were created then. -
Filtering by
startDate
andendDate
IfstartDate
orendDate
are passed in YYYY-MM-DD format, the list of Orders will be filtered to those that were created in this range -
Filtering by
externalUserId
Query Parameters
Unique ID that was passed when creating the order
Date in YYYY-MM-DD format that can be used to filter by time, starting with this date
Date in YYYY-MM-DD format that can be used to filter by time, ending with this date
Unique ID created by developer that is passed when creating the client token. Non unique