Loading...
Loading...
Paystack Terminal API — build in-person payment experiences with Paystack POS terminals. Send events (invoice/transaction), check terminal status, commission/decommission devices, and manage terminal details. Use this skill whenever integrating Paystack POS terminals, sending payment events to terminals, processing in-person payments, checking terminal availability, activating or deactivating terminal devices, or managing a fleet of POS terminals. Also use when you see references to /terminal endpoint, terminal_id, serial numbers, or event-based terminal communication.
npx skill4agent add rexedge/paystack paystack-terminalDepends on: paystack-setup for thehelper.paystackRequest
| Method | Endpoint | Description |
|---|---|---|
| POST | | Send event to terminal |
| GET | | Check event delivery status |
| GET | | Check terminal availability |
| GET | | List terminals |
| GET | | Fetch terminal details |
| PUT | | Update terminal |
| POST | | Commission (activate) terminal |
| POST | | Decommission (deactivate) terminal |
| Param | Type | Required | Description |
|---|---|---|---|
| string | Yes | |
| string | Yes | For invoice: |
| object | Yes | Event data (see examples) |
// Send invoice to terminal for processing
const event = await paystackRequest<{ id: string }>(
`/terminal/${terminalId}/event`,
{
method: "POST",
body: JSON.stringify({
type: "invoice",
action: "process",
data: {
id: 7895939, // Invoice ID
reference: 4634337895939, // Offline reference
},
}),
}
);
// event.data.id → "616d721e8c5cd40a0cdd54a6"
// Print a transaction receipt
await paystackRequest(`/terminal/${terminalId}/event`, {
method: "POST",
body: JSON.stringify({
type: "transaction",
action: "print",
data: { id: transactionId },
}),
});const status = await paystackRequest<{ delivered: boolean }>(
`/terminal/${terminalId}/event/${eventId}`
);
// status.data.delivered → trueconst presence = await paystackRequest<{
online: boolean;
available: boolean;
}>(`/terminal/${terminalId}/presence`);
if (presence.data.online && presence.data.available) {
// Send event to terminal
}const terminals = await paystackRequest("/terminal?perPage=50");
// terminals.meta.next → cursor for next page
// terminals.meta.previous → cursor for previous pageconst terminal = await paystackRequest(`/terminal/${terminalId}`);
// terminal.data: { id, serial_number, terminal_id, name, address, status }await paystackRequest(`/terminal/${terminalId}`, {
method: "PUT",
body: JSON.stringify({
name: "Front Desk Terminal",
address: "123 Main Street, Lagos",
}),
});// Activate a new terminal
await paystackRequest("/terminal/commission_device", {
method: "POST",
body: JSON.stringify({ serial_number: "1111150412230003899" }),
});
// Deactivate a terminal
await paystackRequest("/terminal/decommission_device", {
method: "POST",
body: JSON.stringify({ serial_number: "1111150412230003899" }),
});