Purchase a credit package
curl --request POST \
--url https://api.urltodata.ai/v1/credits/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"package_id": "<string>"
}
'import requests
url = "https://api.urltodata.ai/v1/credits/purchase"
payload = { "package_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({package_id: '<string>'})
};
fetch('https://api.urltodata.ai/v1/credits/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"checkout_url": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": "<string>",
"documentationUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": "<string>",
"documentationUrl": "<string>"
}API Reference
Purchase a credit package
POST
/
v1
/
credits
/
purchase
Purchase a credit package
curl --request POST \
--url https://api.urltodata.ai/v1/credits/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"package_id": "<string>"
}
'import requests
url = "https://api.urltodata.ai/v1/credits/purchase"
payload = { "package_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({package_id: '<string>'})
};
fetch('https://api.urltodata.ai/v1/credits/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"checkout_url": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": "<string>",
"documentationUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": "<string>",
"documentationUrl": "<string>"
}Authorizations
API key as Bearer token (e.g. Bearer mp_abc123_secret)
Body
application/json
Response
Checkout session created