curl --request GET \
--url https://bouclay.com/api/v1/invoices \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://bouclay.com/api/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://bouclay.com/api/v1/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bouclay.com/api/v1/invoices",
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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "<string>",
"number": "<string>",
"status": "<string>",
"billingReason": "<string>",
"purpose": "card_verification",
"collectionMode": "automatic",
"currency": "<string>",
"subtotal": 1,
"grantApplied": 1,
"taxTotal": 1,
"taxes": [
{
"name": "VAT",
"rate": 7.5,
"reason": "<string>",
"inclusive": true,
"amount": 1
}
],
"total": 1,
"minimumCommitment": {
"amount": 123,
"counted": 123,
"shortfall": 123
},
"spendingCap": {
"amount": 123,
"counted": 123,
"takenBack": 123
},
"sellerTaxId": "<string>",
"sellerVatRegistered": true,
"billingAddress": {},
"reference": "<string>",
"amountPaid": 1,
"amountCredited": 1,
"balanceApplied": 0,
"amountDue": 1,
"paidAt": "2023-11-07T05:31:56Z",
"customer": {
"id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"taxId": "<string>"
},
"subscription": {
"id": "<string>",
"status": "<string>",
"pauseReason": "requested"
},
"payment": {
"id": "<string>",
"status": "pending",
"amount": 1,
"amountRefunded": 1,
"amountChargedBack": 1,
"currency": "<string>",
"failureCode": "<string>",
"failureReason": "<string>",
"attemptNumber": 123,
"manualMethod": "cash",
"reference": "<string>",
"processedAt": "2023-11-07T05:31:56Z",
"invoice": {
"id": "<string>"
},
"customer": {
"id": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
},
"dueAt": "2023-11-07T05:31:56Z",
"hostedUrl": "<string>",
"invoicePdfUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lines": [
{
"id": 123,
"description": "<string>",
"kind": "plan",
"quantity": 123,
"unitAmount": 1,
"quantityLabel": "<string>",
"tierBreakdown": "<string>",
"total": 1,
"billingTiming": "advance",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"usageQuantity": 123,
"taxCategory": "standard",
"revenueCode": "<string>",
"discountAmount": 1,
"grantApplied": 1,
"taxAmount": 1,
"taxRate": 7.5,
"taxName": "VAT",
"taxReason": "export of services",
"taxInclusive": true
}
]
}
],
"meta": {
"requestId": "req_550e8400-e29b-41d4-a716-446655440000",
"pagination": {
"hasMore": true,
"previous": "<string>",
"next": "<string>"
}
}
}List invoices
curl --request GET \
--url https://bouclay.com/api/v1/invoices \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://bouclay.com/api/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://bouclay.com/api/v1/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bouclay.com/api/v1/invoices",
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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "<string>",
"number": "<string>",
"status": "<string>",
"billingReason": "<string>",
"purpose": "card_verification",
"collectionMode": "automatic",
"currency": "<string>",
"subtotal": 1,
"grantApplied": 1,
"taxTotal": 1,
"taxes": [
{
"name": "VAT",
"rate": 7.5,
"reason": "<string>",
"inclusive": true,
"amount": 1
}
],
"total": 1,
"minimumCommitment": {
"amount": 123,
"counted": 123,
"shortfall": 123
},
"spendingCap": {
"amount": 123,
"counted": 123,
"takenBack": 123
},
"sellerTaxId": "<string>",
"sellerVatRegistered": true,
"billingAddress": {},
"reference": "<string>",
"amountPaid": 1,
"amountCredited": 1,
"balanceApplied": 0,
"amountDue": 1,
"paidAt": "2023-11-07T05:31:56Z",
"customer": {
"id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"taxId": "<string>"
},
"subscription": {
"id": "<string>",
"status": "<string>",
"pauseReason": "requested"
},
"payment": {
"id": "<string>",
"status": "pending",
"amount": 1,
"amountRefunded": 1,
"amountChargedBack": 1,
"currency": "<string>",
"failureCode": "<string>",
"failureReason": "<string>",
"attemptNumber": 123,
"manualMethod": "cash",
"reference": "<string>",
"processedAt": "2023-11-07T05:31:56Z",
"invoice": {
"id": "<string>"
},
"customer": {
"id": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
},
"dueAt": "2023-11-07T05:31:56Z",
"hostedUrl": "<string>",
"invoicePdfUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lines": [
{
"id": 123,
"description": "<string>",
"kind": "plan",
"quantity": 123,
"unitAmount": 1,
"quantityLabel": "<string>",
"tierBreakdown": "<string>",
"total": 1,
"billingTiming": "advance",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"usageQuantity": 123,
"taxCategory": "standard",
"revenueCode": "<string>",
"discountAmount": 1,
"grantApplied": 1,
"taxAmount": 1,
"taxRate": 7.5,
"taxName": "VAT",
"taxReason": "export of services",
"taxInclusive": true
}
]
}
],
"meta": {
"requestId": "req_550e8400-e29b-41d4-a716-446655440000",
"pagination": {
"hasMore": true,
"previous": "<string>",
"next": "<string>"
}
}
}Authorizations
Use a Bouclay secret key (sk_test_..., sk_live_...) or restricted key
(rk_test_..., rk_live_...).
A secret key can call every endpoint. A restricted key can only call the
endpoints its scopes cover. A scope is {resource}:{access}, for example
customers:read or refunds:write, and write includes read. GET
requests need read access and everything else needs write, except
POST /subscriptions/{id}/items/{item}/preview, which only needs
subscriptions:read. A request outside the key's scopes gets 403 permission_denied naming the missing scope, and its Idempotency-Key
is not used up.
| Resource | Endpoints | Access |
|---|---|---|
customers | customers, their addresses and payment methods | read, write |
entitlements | /customers/{id}/entitlements | read |
credits | /customers/{id}/credit-balance, credit purchases, credit grants, auto-reloads, credit holds (committing one records its usage) | read, write |
catalog | products, plans, prices | read, write |
meters | meters | read, write |
usage | meter events, /customers/{id}/usage | read, write |
discounts | discounts | read |
subscriptions | subscriptions | read, write |
invoices | invoices | read, write |
credit_notes | credit notes, POST /invoices/{id}/credit-notes (a refund to the card also needs refunds:write) | read, write |
payments | payments | read |
refunds | refunds, POST /payments/{id}/refunds, chargebacks and their outcome | read, write |
checkout_sessions | checkout sessions | read, write |
portal_sessions | portal sessions | write |
events | events | read |
webhook_endpoints | webhook endpoints | read, write |
metrics | metrics | read |
Publishable keys (pk_...) are rejected by server-side API endpoints. A
key's mode scopes what it can see and charge: a test key can never reach
a live card.
Query Parameters
1 <= x <= 100Return results after this public ID cursor.
Return results before this public ID cursor. Cannot be combined with after.