Skip to content

Latest commit

History

History
252 lines (176 loc) · 7.76 KB

File metadata and controls

252 lines (176 loc) · 7.76 KB

paystack.Subaccount

All URIs are relative to https://api.paystack.co

MethodHTTP requestDescription
createPOST /subaccountCreate Subaccount
fetchGET /subaccount/{code}Fetch Subaccount
listGET /subaccountList Subaccounts
updatePUT /subaccount/{code}Update Subaccount

create

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

Example

  • 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)

Parameters

NameTypeDescriptionNotes
business_namestrName of business for subaccount
settlement_bankstrBank code for the bank. You can get the list of Bank Codes by calling the List Banks endpoint.
account_numberstrBank account number
percentage_chargefloatCustomer's phone number
descriptionstrA description for this subaccount[optional]
primary_contact_emailstrA contact email for the subaccount[optional]
primary_contact_namestrThe name of the contact person for this subaccount[optional]
primary_contact_phonestrA phone number to call for this subaccount[optional]
metadatastrStringified JSON object of custom data[optional]

Return type

Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded, application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
0Server error-

[Back to top][Back to API list][Back to Model list][Back to README]

fetch

Response fetch(code)

Fetch Subaccount

Example

  • 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)

Parameters

NameTypeDescriptionNotes
codestr

Return type

Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
404Entity not found-
0Server error-

[Back to top][Back to API list][Back to Model list][Back to README]

list

Response list(per_page=per_page, page=page, _from=_from, to=to)

List Subaccounts

Example

  • 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)

Parameters

NameTypeDescriptionNotes
per_pageintNumber of records to fetch per page[optional]
pageintThe section to retrieve[optional]
_fromdatetimeThe start date[optional]
todatetimeThe end date[optional]

Return type

Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
404Entity not found-
0Server error-

[Back to top][Back to API list][Back to Model list][Back to README]

update

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

Example

  • 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)

Parameters

NameTypeDescriptionNotes
codestr
business_namestrName of business for subaccount[optional]
settlement_bankstrBank code for the bank. You can get the list of Bank Codes by calling the List Banks endpoint.[optional]
account_numberstrBank account number[optional]
activeboolActivate or deactivate a subaccount[optional]
percentage_chargefloatCustomer's phone number[optional]
descriptionstrA description for this subaccount[optional]
primary_contact_emailstrA contact email for the subaccount[optional]
primary_contact_namestrThe name of the contact person for this subaccount[optional]
primary_contact_phonestrA phone number to call for this subaccount[optional]
metadatastrStringified JSON object of custom data[optional]

Return type

Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded, application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
404Entity not found-
0Server error-

[Back to top][Back to API list][Back to Model list][Back to README]