Python
import os, sodacards
config = sodacards.Configuration(host="https://api.sodacards.com")
config.api_key["ApiKeyAuth"] = os.environ["SODACARDS_API_KEY"]
client = sodacards.DefaultApi(sodacards.ApiClient(config))
order = client.get_order("ord_123")import { Sodacards } from "@sodacards/sdk";
const sodacards = new Sodacards({ apiKeyAuth: process.env.SODACARDS_API_KEY });
const order = await sodacards.getOrder({ id: "ord_123" });client := sodacards.NewAPIClient(sodacards.NewConfiguration())
auth := context.WithValue(context.Background(), sodacards.ContextAPIKeys,
map[string]sodacards.APIKey{"ApiKeyAuth": {Key: os.Getenv("SODACARDS_API_KEY")}})
order, _, err := client.DefaultAPI.GetOrder(auth, "ord_123").Execute()$config = Sodacards\Configuration::getDefaultConfiguration()
->setApiKey('X-API-Key', getenv('SODACARDS_API_KEY'));
$client = new Sodacards\Api\DefaultApi(new GuzzleHttp\Client(), $config);
$order = $client->getOrder("ord_123");curl --request GET \
--url https://api.sodacards.com/v1/orders/{id} \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.sodacards.com/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.sodacards.com/v1/orders/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sodacards.com/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"order": {
"id": "<string>",
"status": "<string>",
"total": {
"amount": 123,
"currency": "<string>"
},
"createdAt": "<string>",
"reference": "<string>",
"lines": [
{
"productId": "<string>",
"name": "<string>",
"unitPrice": {
"amount": 123,
"currency": "<string>"
},
"quantity": 123,
"lineTotal": {
"amount": 123,
"currency": "<string>"
},
"inputFields": {}
}
]
}
}API Reference
GetOrder
GetOrder returns one of the reseller’s orders by id, with its lines and current status. A live key reads live orders and a test key reads its own sandbox orders; an id that is not the caller’s is reported as not found.
GET
/
v1
/
orders
/
{id}
Python
import os, sodacards
config = sodacards.Configuration(host="https://api.sodacards.com")
config.api_key["ApiKeyAuth"] = os.environ["SODACARDS_API_KEY"]
client = sodacards.DefaultApi(sodacards.ApiClient(config))
order = client.get_order("ord_123")import { Sodacards } from "@sodacards/sdk";
const sodacards = new Sodacards({ apiKeyAuth: process.env.SODACARDS_API_KEY });
const order = await sodacards.getOrder({ id: "ord_123" });client := sodacards.NewAPIClient(sodacards.NewConfiguration())
auth := context.WithValue(context.Background(), sodacards.ContextAPIKeys,
map[string]sodacards.APIKey{"ApiKeyAuth": {Key: os.Getenv("SODACARDS_API_KEY")}})
order, _, err := client.DefaultAPI.GetOrder(auth, "ord_123").Execute()$config = Sodacards\Configuration::getDefaultConfiguration()
->setApiKey('X-API-Key', getenv('SODACARDS_API_KEY'));
$client = new Sodacards\Api\DefaultApi(new GuzzleHttp\Client(), $config);
$order = $client->getOrder("ord_123");curl --request GET \
--url https://api.sodacards.com/v1/orders/{id} \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.sodacards.com/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.sodacards.com/v1/orders/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sodacards.com/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"order": {
"id": "<string>",
"status": "<string>",
"total": {
"amount": 123,
"currency": "<string>"
},
"createdAt": "<string>",
"reference": "<string>",
"lines": [
{
"productId": "<string>",
"name": "<string>",
"unitPrice": {
"amount": 123,
"currency": "<string>"
},
"quantity": 123,
"lineTotal": {
"amount": 123,
"currency": "<string>"
},
"inputFields": {}
}
]
}
}⌘I