Skip to content

Latest commit

History

History
521 lines (355 loc) · 15.2 KB

File metadata and controls

521 lines (355 loc) · 15.2 KB

paystack.PaymentRequest

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

MethodHTTP requestDescription
archivePOST /paymentrequest/archive/{id}Archive Payment Request
createPOST /paymentrequestCreate Payment Request
fetchGET /paymentrequest/{id}Fetch Payment Request
finalizePOST /paymentrequest/finalize/{id}Finalize Payment Request
listGET /paymentrequestList Payment Request
notifyPOST /paymentrequest/notify/{id}Send Notification
totalsGET /paymentrequest/totalsPayment Request Total
updatePUT /paymentrequest/{id}Update Payment Request
verifyGET /paymentrequest/verify/{id}Verify Payment Request

archive

Response archive(id)

Archive Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Archive Payment Requestresponse=paystack.PaymentRequest.archive(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr

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-
0Server error-

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

create

Response create(customer, amount=amount, currency=currency, due_date=due_date, description=description, line_items=line_items, tax=tax, send_notification=send_notification, draft=draft, has_invoice=has_invoice, invoice_number=invoice_number, split_code=split_code)

Create Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'customer='customer_example'# str | Customer id or code# Create Payment Requestresponse=paystack.PaymentRequest.create(
customer,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
customerstrCustomer id or code
amountintPayment request amount. Only useful if line items and tax values are ignored. The endpoint will throw a friendly warning if neither is available.[optional]
currencystrSpecify the currency of the invoice. Allowed values are NGN, GHS, ZAR and USD. Defaults to NGN[optional]
due_datedatetimeISO 8601 representation of request due date[optional]
descriptionstrA short description of the payment request[optional]
line_itemslist[object]Array of line items[optional]
taxlist[object]Array of taxes[optional]
send_notificationlist[object]Indicates whether Paystack sends an email notification to customer. Defaults to true[optional]
draftlist[object]Indicate if request should be saved as draft. Defaults to false and overrides send_notification[optional]
has_invoicelist[object]Set to true to create a draft invoice (adds an auto incrementing invoice number if none is provided) even if there are no line_items or tax passed[optional]
invoice_numberintNumeric value of invoice. Invoice will start from 1 and auto increment from there. This field is to help override whatever value Paystack decides. Auto increment for subsequent invoices continue from this point.[optional]
split_codestrThe split code of the transaction split.[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(id)

Fetch Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Fetch Payment Requestresponse=paystack.PaymentRequest.fetch(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr

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]

finalize

Response finalize(id)

Finalize Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Finalize Payment Requestresponse=paystack.PaymentRequest.finalize(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr

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-
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, customer=customer, status=status, currency=currency, _from=_from, to=to)

List Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'# List Payment Requestresponse=paystack.PaymentRequest.list(
)
pprint(response)

Parameters

NameTypeDescriptionNotes
per_pageintNumber of records to fetch per page[optional]
pageintThe section to retrieve[optional]
customerstrCustomer ID[optional]
statusstrInvoice status to filter[optional]
currencystrIf your integration supports more than one currency, choose the one to filter[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]

notify

Response notify(id)

Send Notification

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Send Notificationresponse=paystack.PaymentRequest.notify(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr

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-
0Server error-

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

totals

Response totals()

Payment Request Total

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'# Payment Request Totalresponse=paystack.PaymentRequest.totals()
pprint(response)

Parameters

This endpoint does not need any parameter.

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(id, customer=customer, amount=amount, currency=currency, due_date=due_date, description=description, line_items=line_items, tax=tax, send_notification=send_notification, draft=draft, has_invoice=has_invoice, invoice_number=invoice_number, split_code=split_code)

Update Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Update Payment Requestresponse=paystack.PaymentRequest.update(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr
customerstrCustomer id or code[optional]
amountintPayment request amount. Only useful if line items and tax values are ignored. The endpoint will throw a friendly warning if neither is available.[optional]
currencystrSpecify the currency of the invoice. Allowed values are NGN, GHS, ZAR and USD. Defaults to NGN[optional]
due_datedatetimeISO 8601 representation of request due date[optional]
descriptionstrA short description of the payment request[optional]
line_itemslist[object]Array of line items[optional]
taxlist[object]Array of taxes[optional]
send_notificationlist[object]Indicates whether Paystack sends an email notification to customer. Defaults to true[optional]
draftlist[object]Indicate if request should be saved as draft. Defaults to false and overrides send_notification[optional]
has_invoicelist[object]Set to true to create a draft invoice (adds an auto incrementing invoice number if none is provided) even if there are no line_items or tax passed[optional]
invoice_numberintNumeric value of invoice. Invoice will start from 1 and auto increment from there. This field is to help override whatever value Paystack decides. Auto increment for subsequent invoices continue from this point.[optional]
split_codestrThe split code of the transaction split.[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]

verify

Response verify(id)

Verify Payment Request

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Verify Payment Requestresponse=paystack.PaymentRequest.verify(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr

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]