Skip to content

Latest commit

 

History

History
137 lines (95 loc) · 3.18 KB

File metadata and controls

137 lines (95 loc) · 3.18 KB

Transaction Split

TransactionSplit.create(**kwargs) - Create a Transaction split

Usage

from paystackapi.transaction_split import TransactionSplit
response = TransactionSplit.create(
            name="Test Biz 123",
            type="percentage",
            currency="xxxxxxxxx",
            subaccounts="[{'subaccount': 'ACCT_4hl4xenwpjy5wb', 'share':40 },...]",
            bearer_type="account"
        )

Arguments

  • name: Name of the transaction split
  • type: The type of transaction split you want to create (percentage or flat)
  • currency: One of NGN, GHS, ZAR, or USD
  • subaccounts: A list of object containing subaccount code and number of shares
  • bearer_type: One of subaccount, account, all-proportional, or all.
  • bearer_subaccount: Subaccount code
  • **kwargs

Returns

JSON data from Paystack API.

TransactionSplit.list(perPage, page) - List or search for the transaction splits available on your integration.

Usage

from paystackapi.transaction_split import TransactionSplit
response = TransactionSplit.list(perPage=3, page=1)

Arguments

  • perPage: Records you want to retrieve per page (Integer)
  • page: Which page you want to retrieve (Integer)
  • **kwargs

Returns

JSON data from Paystack API.

TransactionSplit.fetch(split_id) - Get details of a split in your integration.

Usage

from paystackapi.transaction_split import TransactionSplit
response = TransactionSplit.fetch(split_id=14551)

Arguments

  • split_id: Split ID

Returns

JSON data from Paystack API.

TransactionSplit.update(split_id, **kwargs) - Update transaction split details in your integration

Usage

from paystackapi.transaction_split import TransactionSplit
response = TransactionSplit.update(
            split_id=45411,
            **kwargs
        )

Arguments

  • split_id: Slit ID
  • name: Name of the transaction split
  • active: True or False
  • subaccounts: A list of object containing subaccount code and number of shares
  • bearer_type: Any of subaccount | account | all-proportional | all
  • bearer_subaccount: Subaccount code
  • **kwargs

Returns

JSON data from Paystack API.

TransactionSplit.remove_split_subaccount(split_id, **kwargs) - Remove a subaccount from a transaction split.

Usage

from paystackapi.transaction_split import TransactionSplit
response = TransactionSplit.remove_split_subaccount(
            split_id=45411,
            **kwargs
        )

Arguments

  • split_id: Split ID
  • subaccount: This is the subaccount code
  • **kwargs

Returns

JSON data from Paystack API.

TransactionSplit.add_or_update_split_subaccount(split_id, **kwargs) - Add a subaccount to a transaction split or update the share of an existing subaccount in a transaction split.

Usage

from paystackapi.transaction_split import TransactionSplit
response = TransactionSplit.add_or_update_split_subaccount(
            split_id=45411,
            **kwargs
        )

Arguments

  • split_id: Split ID
  • subaccount: This is the sub account code
  • share: This is the transaction share for the subaccount
  • **kwargs

Returns

JSON data from Paystack API.