All URIs are relative to https://api.paystack.co
| Method | HTTP request | Description |
|---|---|---|
| create | POST /subaccount | Create Subaccount |
| fetch | GET /subaccount/{code} | Fetch Subaccount |
| list | GET /subaccount | List Subaccounts |
| update | PUT /subaccount/{code} | Update Subaccount |
Response create(business_name, settlement_bank, account_number, percentage_charge, description=description, primary_contact_email=primary_contact_email, primary_contact_name=primary_contact_name, primary_contact_phone=primary_contact_phone, metadata=metadata)
Create Subaccount
- Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'business_name='business_name_example'# str | Name of business for subaccountsettlement_bank='settlement_bank_example'# str | Bank code for the bank. You can get the list of Bank Codes by calling the List Banks endpoint.account_number='account_number_example'# str | Bank account numberpercentage_charge=3.4# float | Customer's phone number# Create Subaccountresponse=paystack.Subaccount.create(
business_name,
settlement_bank,
account_number,
percentage_charge,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| business_name | str | Name of business for subaccount | |
| settlement_bank | str | Bank code for the bank. You can get the list of Bank Codes by calling the List Banks endpoint. | |
| account_number | str | Bank account number | |
| percentage_charge | float | Customer's phone number | |
| description | str | A description for this subaccount | [optional] |
| primary_contact_email | str | A contact email for the subaccount | [optional] |
| primary_contact_name | str | The name of the contact person for this subaccount | [optional] |
| primary_contact_phone | str | A phone number to call for this subaccount | [optional] |
| metadata | str | Stringified JSON object of custom data | [optional] |
- Content-Type: application/x-www-form-urlencoded, application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 0 | Server error | - |
[Back to top][Back to API list][Back to Model list][Back to README]
Response fetch(code)
Fetch Subaccount
- Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'code='code_example'# str | # Fetch Subaccountresponse=paystack.Subaccount.fetch(
code,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 404 | Entity not found | - |
| 0 | Server error | - |
[Back to top][Back to API list][Back to Model list][Back to README]
Response list(per_page=per_page, page=page, _from=_from, to=to)
List Subaccounts
- Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'# List Subaccountsresponse=paystack.Subaccount.list(
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| per_page | int | Number of records to fetch per page | [optional] |
| page | int | The section to retrieve | [optional] |
| _from | datetime | The start date | [optional] |
| to | datetime | The end date | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 404 | Entity not found | - |
| 0 | Server error | - |
[Back to top][Back to API list][Back to Model list][Back to README]
Response update(code, business_name=business_name, settlement_bank=settlement_bank, account_number=account_number, active=active, percentage_charge=percentage_charge, description=description, primary_contact_email=primary_contact_email, primary_contact_name=primary_contact_name, primary_contact_phone=primary_contact_phone, metadata=metadata)
Update Subaccount
- Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'code='code_example'# str | # Update Subaccountresponse=paystack.Subaccount.update(
code,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str | ||
| business_name | str | Name of business for subaccount | [optional] |
| settlement_bank | str | Bank code for the bank. You can get the list of Bank Codes by calling the List Banks endpoint. | [optional] |
| account_number | str | Bank account number | [optional] |
| active | bool | Activate or deactivate a subaccount | [optional] |
| percentage_charge | float | Customer's phone number | [optional] |
| description | str | A description for this subaccount | [optional] |
| primary_contact_email | str | A contact email for the subaccount | [optional] |
| primary_contact_name | str | The name of the contact person for this subaccount | [optional] |
| primary_contact_phone | str | A phone number to call for this subaccount | [optional] |
| metadata | str | Stringified JSON object of custom data | [optional] |
- Content-Type: application/x-www-form-urlencoded, application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 404 | Entity not found | - |
| 0 | Server error | - |
[Back to top][Back to API list][Back to Model list][Back to README]