curl https://api.settlx.io/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/settlement \
-H "Authorization: Bearer pk_live_your_api_key"
const invoiceId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(`https://api.settlx.io/api/v1/invoices/${invoiceId}/settlement`, {
headers: { 'Authorization': 'Bearer pk_live_your_api_key' }
});
if (response.status === 404) {
console.log('Invoice not yet settled');
} else {
const { data } = await response.json();
console.log(`Settlement status: ${data.status}`);
}
{
"data": {
"id": "d4e5f6a7-b8c9-0123-def0-456789012345",
"invoiceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "98.49",
"grossAmount": "99.99",
"currency": "USDT",
"chain": "ethereum",
"transactionHash": "0xdeadbeef1234567890...",
"merchantWallet": "0xYourWallet...",
"status": "completed",
"initiatedAt": "2024-01-15T10:05:00.000Z",
"completedAt": "2024-01-15T10:06:30.000Z",
"failedAt": null,
"createdAt": "2024-01-15T10:04:30.000Z",
"updatedAt": "2024-01-15T10:06:30.000Z"
}
}
{
"error": "Not Found",
"message": "No settlement found for this invoice"
}
{
"error": "Forbidden",
"message": "Invoice not accessible"
}
Settlements
Get Invoice Settlement
Retrieve the settlement for a specific invoice
GET
/
api
/
v1
/
invoices
/
{id}
/
settlement
curl https://api.settlx.io/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/settlement \
-H "Authorization: Bearer pk_live_your_api_key"
const invoiceId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(`https://api.settlx.io/api/v1/invoices/${invoiceId}/settlement`, {
headers: { 'Authorization': 'Bearer pk_live_your_api_key' }
});
if (response.status === 404) {
console.log('Invoice not yet settled');
} else {
const { data } = await response.json();
console.log(`Settlement status: ${data.status}`);
}
{
"data": {
"id": "d4e5f6a7-b8c9-0123-def0-456789012345",
"invoiceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "98.49",
"grossAmount": "99.99",
"currency": "USDT",
"chain": "ethereum",
"transactionHash": "0xdeadbeef1234567890...",
"merchantWallet": "0xYourWallet...",
"status": "completed",
"initiatedAt": "2024-01-15T10:05:00.000Z",
"completedAt": "2024-01-15T10:06:30.000Z",
"failedAt": null,
"createdAt": "2024-01-15T10:04:30.000Z",
"updatedAt": "2024-01-15T10:06:30.000Z"
}
}
{
"error": "Not Found",
"message": "No settlement found for this invoice"
}
{
"error": "Forbidden",
"message": "Invoice not accessible"
}
Get Invoice Settlement
Retrieves the settlement associated with a specific invoice. Returns the most recent settlement if the invoice has been settled.Path Parameters
string
required
UUID of the invoice.
Response
object
Settlement object. Same fields as Get Settlement.
curl https://api.settlx.io/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/settlement \
-H "Authorization: Bearer pk_live_your_api_key"
const invoiceId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(`https://api.settlx.io/api/v1/invoices/${invoiceId}/settlement`, {
headers: { 'Authorization': 'Bearer pk_live_your_api_key' }
});
if (response.status === 404) {
console.log('Invoice not yet settled');
} else {
const { data } = await response.json();
console.log(`Settlement status: ${data.status}`);
}
{
"data": {
"id": "d4e5f6a7-b8c9-0123-def0-456789012345",
"invoiceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "98.49",
"grossAmount": "99.99",
"currency": "USDT",
"chain": "ethereum",
"transactionHash": "0xdeadbeef1234567890...",
"merchantWallet": "0xYourWallet...",
"status": "completed",
"initiatedAt": "2024-01-15T10:05:00.000Z",
"completedAt": "2024-01-15T10:06:30.000Z",
"failedAt": null,
"createdAt": "2024-01-15T10:04:30.000Z",
"updatedAt": "2024-01-15T10:06:30.000Z"
}
}
{
"error": "Not Found",
"message": "No settlement found for this invoice"
}
{
"error": "Forbidden",
"message": "Invoice not accessible"
}
⌘I