Get payments
GET https://sticky.to/v1/payments
.
Authentication
Use an Authorization
header as Bearer [YOUR_PRIVATE_KEY]
.
Supported MIME types
application/json
: array of JSON objects. The response reflects our internal data structure meaning fields may be added over time. Existing fields will always be 100% backwards compatible.
Query parameters
Please URL encode >
-like characters.
sessionPaidAt
: Start or end time stamp. Use operators (>
/ <
) followed by a UNIX timestamp.
_sessionPaidAt
: Optional end time stamp. Use operators (>
/ <
) followed by a UNIX timestamp.
Get today’s payments - Node.js
const url = `https://sticky.to/v1/payments?sessionPaidAt=%3E${Math.floor(new Date(new Date().setHours(0,0,0,0)).getTime()/1000)}&_sessionPaidAt=%3C${Math.floor(new Date(new Date().setHours(23,59,59,999)).getTime()/1000)}`
const res = await fetch(
url,
{
method: 'GET',
headers: {
Authorization: 'Bearer [YOUR_PRIVATE_KEY]'
}
}
);
if (!res.ok) throw new Error(`HTTP error ${res.status}`);
const data = await res.json();
console.log(data);