Billing
Get purchase
One of your purchases, with its settlement status.
GET
/
v1
/
account
/
payments
/
{purchase_id}
Get purchase
curl --request GET \
--url https://api.sqwish.ai/v1/account/payments/{purchase_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/account/payments/{purchase_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sqwish.ai/v1/account/payments/{purchase_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "<string>",
"origin": "manual",
"amount_usd": "<string>",
"tax_usd": "<string>",
"reversed_usd": "<string>",
"checkout_url": "<string>",
"receipt_url": "<string>",
"created_at": 123,
"credited_at": 123,
"expires_at": 123,
"expired_usd": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Authorizations
Create an API key in the console. Required when accounts are enabled.
Path Parameters
Response
Successful Response
Available options:
manual, automatic The tax added on top of the credit when it was paid; null until the payment is seen, and for payments made before tax was charged.
The hosted checkout page, for the console's session. Null to an API key, which may not complete a payment.
The payment's invoice once it is paid, or its Stripe receipt, for the console's session. Null to an API key, since an invoice shows the billing address and VAT number.
When the purchase's credit expires; null if it never does.
What expired of it, once its expiry has been recorded; null until then.
Get purchase
curl --request GET \
--url https://api.sqwish.ai/v1/account/payments/{purchase_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/account/payments/{purchase_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sqwish.ai/v1/account/payments/{purchase_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "<string>",
"origin": "manual",
"amount_usd": "<string>",
"tax_usd": "<string>",
"reversed_usd": "<string>",
"checkout_url": "<string>",
"receipt_url": "<string>",
"created_at": 123,
"credited_at": 123,
"expires_at": 123,
"expired_usd": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}