Refund Module
This wrapper class facilitates synchronous integration with Paystack Refund API. The Refunds API allows you to create and manage transaction refunds.
- class RefundClientAPI(secret_key: str = None)
Paystack Refund API Reference: Refund
- create_refund(transaction_ref_or_id: str, amount: int | None = None, currency: str | None = None, customer_note: str | None = None, merchant_note: str | None = None)→ PayStackResponse
Create a refund
- Parameters:
transaction_ref_or_id – The transaction id or reference to fetch
amount (int, optional) – The amount to refund
currency (str, optional) – The currency to refund.
customer_note – The customer note or reason
merchant_note (str, optional) – The merchant note or reason
- Returns:
The response from the API
- Return type:
PayStackResponse object
- fetch_refund(reference: str)→ PayStackResponse
Fetch a refund
- Parameters:
reference (str) – The transaction reference to fetch for refund
- Returns:
The response from the API
- Return type:
PayStackResponse object
- list_refunds(reference: str | None = None, currency: str | None = None, per_page: int | None = 50, page: int | None = 1, from_date: date | None = None, to_date: date | None = None)→ PayStackResponse
List refunds
- Parameters:
reference (str, optional) – The transaction reference to fetch for the refund
currency (str, optional)
per_page (int, optional) – The number of plans per page
page (int, optional) – The page number
from_date
to_date
- Returns:
The response from the API
- Return type:
PayStackResponse object
You can use the tool kit in the helpers module as reference to pass the string value of Currency: Tool kit module