Terminal Module

This wrapper class facilitates synchronous integration with Paystack Terminal APIs. The Terminal API allows you to build delightful in-person payment experiences.


class TerminalClientAPI(secret_key: str = None)

Paystack Terminal API Reference: Terminal

commission_terminal(serial_number: str)→ PayStackResponse

Activate debug device by linking it to your integration

Parameters:

serial_number (str) – serial number of the device to activate

Returns:

The response from the API

Return type:

PayStackResponse object

decommission_terminal(serial_number: str)→ PayStackResponse

Deactivate debug device by unlinking it from your integration

Parameters:

serial_number (str) – the serial number of the device to be deactivated

Returns:

The response from the API

Return type:

PayStackResponse object

fetch_event_status(terminal_id: str, event_id: str)→ PayStackResponse

Fetch details of a specific event status sent to the terminal

Parameters:
  • terminal_id (str) – terminal ID the event is sent to

  • event_id (str) – event ID the event is sent to the terminal

Returns:

The response from the API

Return type:

PayStackResponse object

fetch_terminal(terminal_id: str)→ PayStackResponse

Get details of a terminal

Parameters:

terminal_id (str) – The terminal id the event is sent to

Returns:

The response from the API

Return type:

PayStackResponse object

fetch_terminal_status(terminal_id: str)→ PayStackResponse

Fetch the availability of a terminal before sending an event

Parameters:

terminal_id (str) – terminal id the event is sent to

Returns:

The response from the API

Return type:

PayStackResponse object

list_terminals(per_page: int = 50, next_cursor: bool | None = True, previous_cursor: bool | None = True)→ PayStackResponse

List the Terminals available on your integration

Parameters:
  • per_page (int, optional) – The number of terminal records per page. (default: 50)

  • next_cursor (bool, optional) – (default: True)

  • previous_cursor (bool, optional) – (default: True)

Returns:

The response from the API

Return type:

PayStackResponse object

send_event(terminal_id: str, event_type: str, terminal_action: str, data_object: Dict[str, str])→ PayStackResponse

Send an event from your application to the Paystack Terminal

Parameters:
  • terminal_id (str) – The terminal id the event is sent to

  • event_type (str) – The event type to send.

  • terminal_action (str) – The action to perform on the terminal

  • data_object – parameters needed to perform the specified action.

Returns:

The response from the API

Return type:

PayStackResponse object

update_terminal(terminal_id: str, terminal_name: str, terminal_address: str)→ PayStackResponse

Update details of the terminal

Parameters:
  • terminal_id (str) – terminal id the event is sent to

  • terminal_name (str) – terminal name

  • terminal_address (str) – terminal address

Returns:

The response from the API

Return type:

PayStackResponse object

Note

If you pass invoice type as the event_type, the action can either be [ process || view ]. For transaction type as the event_type, the action can either be [ process || print ].

Use the string values of the ``EventType`` and ``EventAction``.

For data_object follows as suited: [invoice type]: you need to pass {id: invoice_id, reference: offline_reference}. [transaction type], you can pass {id: transaction_id}