Skip to content

Latest commit

History

History
177 lines (119 loc) · 4.54 KB

File metadata and controls

177 lines (119 loc) · 4.54 KB

paystack.Refund

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

MethodHTTP requestDescription
createPOST /refundCreate Refund
fetchGET /refund/{id}Fetch Refund
listGET /refundList Refunds

create

Response create(transaction, amount=amount, currency=currency, customer_note=customer_note, merchant_note=merchant_note)

Create Refund

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'transaction='transaction_example'# str | Transaction reference or id# Create Refundresponse=paystack.Refund.create(
transaction,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
transactionstrTransaction reference or id
amountintAmount ( in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR ) to be refunded to the customer. Amount cannot be more than the original transaction amount[optional]
currencystrThree-letter ISO currency. Allowed values are NGN, GHS, ZAR or USD[optional]
customer_notestrCustomer reason[optional]
merchant_notestrMerchant reason[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 Refund

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 Refundresponse=paystack.Refund.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]

list

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

List Refunds

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'# List Refundsresponse=paystack.Refund.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]