Skip to content

Latest commit

 

History

History
174 lines (119 loc) · 5.23 KB

File metadata and controls

174 lines (119 loc) · 5.23 KB

paystack.Refund

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

Method HTTP request Description
create POST /refund Create Refund
fetch GET /refund/{id} Fetch Refund
list GET /refund List Refunds

create

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

Create Refund

Example

  • Bearer Authentication (bearerAuth):
import paystack
from paystack.rest import ApiException
from pprint import pprint


transaction = 'transaction_example' # str | Transaction reference or id
amount = 56 # int | Amount ( 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)
currency = 'currency_example' # str | Three-letter ISO currency. Allowed values are NGN, GHS, ZAR or USD (optional)
customer_note = 'customer_note_example' # str | Customer reason (optional)
merchant_note = 'merchant_note_example' # str | Merchant reason (optional)

# Create Refund

response = paystack.Refund.create(transaction, amount=amount, currency=currency, customer_note=customer_note, merchant_note=merchant_note)
pprint(response)

Parameters

Name Type Description Notes
transaction str Transaction reference or id
amount int Amount ( 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]
currency str Three-letter ISO currency. Allowed values are NGN, GHS, ZAR or USD [optional]
customer_note str Customer reason [optional]
merchant_note str Merchant 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 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]

fetch

Response fetch(id)

Fetch Refund

Example

  • Bearer Authentication (bearerAuth):
import paystack
from paystack.rest import ApiException
from pprint import pprint


id = 'id_example' # str | 

# Fetch Refund

response = paystack.Refund.fetch(id)
pprint(response)

Parameters

Name Type Description Notes
id str

Return type

Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

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]

list

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

List Refunds

Example

  • Bearer Authentication (bearerAuth):
import paystack
from paystack.rest import ApiException
from pprint import pprint


per_page = 56 # int | Number of records to fetch per page (optional)
page = 56 # int | The section to retrieve (optional)
_from = '2013-10-20T19:20:30+01:00' # datetime | The start date (optional)
to = '2013-10-20T19:20:30+01:00' # datetime | The end date (optional)

# List Refunds

response = paystack.Refund.list(per_page=per_page, page=page, _from=_from, to=to)
pprint(response)

Parameters

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]

Return type

Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

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]