curl --request GET \
--url https://api.sandbox.sardine.ai/v1/orders/{orderId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.sandbox.sardine.ai/v1/orders/{orderId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.sandbox.sardine.ai/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.sardine.ai/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.sardine.ai/v1/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.sardine.ai/v1/orders/{orderId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sardine.ai/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "<string>",
"confirmedAt": "<string>",
"referenceId": "<string>",
"status": "<string>",
"fiatCurrency": "<string>",
"transactionId": "<string>",
"walletAddress": "<string>",
"expiresAt": "<string>",
"userId": "<string>",
"total": 123,
"subtotal": 123,
"processingFees": {
"transactionFee": 123,
"networkFee": 123
},
"payment": {
"amountCents": 123,
"currency": "<string>",
"paymentMethodId": "<string>",
"paymentMethodType": "<string>"
},
"withdrawal": {
"txHash": "<string>",
"walletAddress": "<string>",
"quantity": 123
},
"withdrawals": [
{
"walletAddress": "<string>",
"holdAmount": 123,
"holdUntil": "<string>",
"quantity": 123,
"isHold": true,
"status": "<string>",
"txHash": "<string>",
"withdrawnAt": "<string>"
}
]
}Get an Order by ID
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
curl --request GET \
--url https://api.sandbox.sardine.ai/v1/orders/{orderId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.sandbox.sardine.ai/v1/orders/{orderId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.sandbox.sardine.ai/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.sardine.ai/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.sardine.ai/v1/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.sardine.ai/v1/orders/{orderId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sardine.ai/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "<string>",
"confirmedAt": "<string>",
"referenceId": "<string>",
"status": "<string>",
"fiatCurrency": "<string>",
"transactionId": "<string>",
"walletAddress": "<string>",
"expiresAt": "<string>",
"userId": "<string>",
"total": 123,
"subtotal": 123,
"processingFees": {
"transactionFee": 123,
"networkFee": 123
},
"payment": {
"amountCents": 123,
"currency": "<string>",
"paymentMethodId": "<string>",
"paymentMethodType": "<string>"
},
"withdrawal": {
"txHash": "<string>",
"walletAddress": "<string>",
"quantity": 123
},
"withdrawals": [
{
"walletAddress": "<string>",
"holdAmount": 123,
"holdUntil": "<string>",
"quantity": 123,
"isHold": true,
"status": "<string>",
"txHash": "<string>",
"withdrawnAt": "<string>"
}
]
}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
Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Sample
Show child attributes
Show child attributes