curl -X GET 'https://api.weir.ai/org/bill/history' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"bills": [
{
"billId": "bill_123456789",
"amount": 99.99,
"currency": "USD",
"status": "paid",
"billingDate": "2024-01-01T00:00:00Z",
"dueDate": "2024-01-15T00:00:00Z",
"paidDate": "2024-01-10T00:00:00Z",
"description": "Monthly subscription"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1
}
},
"message": "Billing history retrieved successfully",
"status": "success"
}
Retrieve organization billing history
curl -X GET 'https://api.weir.ai/org/bill/history' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"bills": [
{
"billId": "bill_123456789",
"amount": 99.99,
"currency": "USD",
"status": "paid",
"billingDate": "2024-01-01T00:00:00Z",
"dueDate": "2024-01-15T00:00:00Z",
"paidDate": "2024-01-10T00:00:00Z",
"description": "Monthly subscription"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1
}
},
"message": "Billing history retrieved successfully",
"status": "success"
}
curl -X GET 'https://api.weir.ai/org/bill/history' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"bills": [
{
"billId": "bill_123456789",
"amount": 99.99,
"currency": "USD",
"status": "paid",
"billingDate": "2024-01-01T00:00:00Z",
"dueDate": "2024-01-15T00:00:00Z",
"paidDate": "2024-01-10T00:00:00Z",
"description": "Monthly subscription"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1
}
},
"message": "Billing history retrieved successfully",
"status": "success"
}
const getBillingHistory = async (accessToken) => {
const response = await fetch('https://api.weir.ai/org/bill/history', {
headers: {
'Authorization': `Bearer ${accessToken}`,
'x-source': 'console'
}
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
Was this page helpful?