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
Processed
* - The payment has been completed.
Declined
* - The transacation was declined, due to payment method issues
UserCustody
- Crypto purchased for user but is in Sardine’s custodied wallet
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.
Expired
- Order expired before execution
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
1. Filtering by order_id
If a redirect_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 an order_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
E.g. /v1/orders/491c113c-4485-47cd-b011-252068b753dc
2. Filtering by referenceId
If a referenceId
was passed in the call to create the clientToken
for this call, it can now be used to filter for Orders that were created then.
E.g. /v1/orders?referenceId=42ead95db5aeb6c
3. Filtering by externalUserId
If a externalUserId
was passed in /auth/client-tokens, it can be used to filter for Orders with that ID. This is useful for associating transactions with a user
3. Filtering by startDate
and endDate
If startDate
or endDate
are passed in YYYY-MM-DD format, the list of Orders will be filtered to those that were created in this range
E.g. /v1/orders?startDate=2022-08-01&endDate=2022-08-15
paymentStatus
field within the payment
object in the response can be
- Draft
- Pending
For bank transfers, the value could be
- Sent
- Complete
- Returned
- Failed
For card transactions, the value can be
- Authorized
- Captured
- Declined
- Pending3DS
- Failure3DS
- Voided
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
ID of Order
Query Parameters
If a referenceId
is passed when creating the clientToken
, it can be used as a filter
Number of results returned
Date in YYYY-MM-DD
Date in YYYY-MM-DD
Filter using externalUserId
to obtain all Orders associated with a particular user