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

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 pprint import pprint

# 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 Refund

response = paystack.Refund.create(
    transaction,
)

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 pprint import pprint

# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'

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 pprint import pprint

# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'


# List Refunds

response = paystack.Refund.list(
)

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]