Purchase prepaid funds for the caller.
curl --request POST \
--url https://api.example.com/v1/billing/top-ups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount_usd": "<string>"
}
'import requests
url = "https://api.example.com/v1/billing/top-ups"
payload = { "amount_usd": "<string>" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_usd: '<string>'})
};
fetch('https://api.example.com/v1/billing/top-ups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"ok": true
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Billing
Create a top-up
Purchase prepaid evaluation funds.
POST
/
v1
/
billing
/
top-ups
Purchase prepaid funds for the caller.
curl --request POST \
--url https://api.example.com/v1/billing/top-ups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount_usd": "<string>"
}
'import requests
url = "https://api.example.com/v1/billing/top-ups"
payload = { "amount_usd": "<string>" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_usd: '<string>'})
};
fetch('https://api.example.com/v1/billing/top-ups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"ok": true
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Purchase
The response is
$5.00–$500.00 of prepaid funds by sending a decimal USD string:
{
"amount_usd": "25.00"
}
200 if payment has already completed or 202 while it is
pending. Funds are not spendable until the status is paid.
Authorizations
droydApiKeyBearerdroydApiKeyHeader
A Droyd API key in the Authorization Bearer slot.
Headers
Required string length:
8 - 120Pattern:
^[A-Za-z0-9][A-Za-z0-9._:-]{7,119}$Body
application/json
Pattern:
^(?:[5-9]|[1-9][0-9]|[1-4][0-9]{2}|500)(?:\.[0-9]{1,2})?$Response
Successful response.
Was this page helpful?
