Async Transaction Splits Module

This wrapper class facilitates synchronous integration with Paystack Transaction Splits APIs. The Transaction Splits API enables merchants split the settlement for a transaction across their payout account, and one or more subaccounts.

You can use the tool kit in the helpers module as reference: Tool kit module


class AsyncTransactionSplitClientAPI(secret_key: str = None)

Paystack Transaction Split API Reference: Transaction Splits

async add_or_update_subaccount_split(split_id: str, subaccount: str, transaction_share: int)→ PayStackResponse

Add a Subaccount to a Transaction Split, or update the share of an existing Subaccount in a Transaction Split

Parameters:
  • split_id (str) – The ID of the transaction split

  • subaccount (str) – The Subaccount code

  • transaction_share (int) – The number of shares

Returns:

The response from the API

Return type:

PayStackResponse object

async create_split(transaction_split_name: str, transaction_split_type: str, currency: str, subaccounts: List[Dict[str, Any]], bearer_type: str, bearer_subaccount: str)→ PayStackResponse

Create a split payment on your integration

Parameters:
  • transaction_split_name (str) – Name of the transaction split

  • transaction_split_type (str) – Type of transaction split you want to create. Value: SplitType.value.value

  • currency (str) – Value: Currency.value.value

  • subaccounts (List[Dict[str, Any]]) – A list of object containing subaccount code and number of shares.

  • bearer_type (str) – Any of: subaccount | account | all-proportional | all

  • bearer_subaccount (str) – Subaccount Code

Returns:

The response from the API

Return type:

PayStackResponse object

async fetch_split(split_id: str)→ PayStackResponse

Fetch details of a specific transaction split

Parameters:

split_id (str) – The transaction split ID

Returns:

The response from the API

Return type:

PayStackResponse object

async list_split(split_name: str | None = None, active: bool | None = None, sort_by: str | None = None, per_page: int | None = None, page: int | None = None, from_date: date | None = None, to_date: date | None = None)→ PayStackResponse

List all the transaction splits

Parameters:
  • split_name (str, optional) – Name of the transaction split

  • active (bool, optional) – Either True or False

  • sort_by (str, optional) – Sort by name, defaults to createdAt date

  • per_page (int, optional) – Number of transactions split records per page

  • page (int, optional)

  • from_date (date, optional)

  • to_date (date, optional)

Returns:

The response from the API

Return type:

PayStackResponse object

async remove_sub_account_split(split_id: str, subaccount: str)→ PayStackResponse

Remove a Sub Account from a transaction split

Parameters:
  • split_id (str) – the transaction split ID

  • subaccount (str) – the subaccount code

Returns:

The response from the API

Return type:

PayStackResponse object

async update_split(split_id: str, transaction_split_name: str, active: bool, bearer_type: str | None = None, bearer_subaccount: str | None = None)→ PayStackResponse

Update a specific transaction split details

Parameters:
  • split_id (str) – the id of the transaction split to update

  • transaction_split_name (str) – the name of the transaction split

  • active (bool)

  • bearer_type (str, optional)

  • bearer_subaccount (str, optional)

Returns:

The response from the API

Return type:

PayStackResponse object