Async Disputes Module

This wrapper class facilitates asynchronous interaction with Paystack Disputes API. The Disputes API allows you manage transaction disputes on your integration.

You can use the tool kit in the helpers module as reference: PayStackEase Helpers Package


class AsyncDisputesClientAPI(secret_key: str = None)

Paystack Customer API Reference: Disputes

async add_evidence(dispute_id: str, customer_email: str, customer_name: str, customer_phone: str, service_details: str, delivery_address: str | None = None, delivery_date: date | None = None)→ PayStackResponse

Add evidence to a dispute.

Parameters:
  • dispute_id (str) – The ID of the dispute to fetch

  • customer_email (str) – The customer’s email

  • customer_name (str) – The customer’s name

  • customer_phone (str) – The customer’s phone

  • service_details (str) – The service details

  • delivery_address (str, optional) – The delivery address

  • delivery_date (date, optional) – The delivery date

Returns:

The response from the API.

Return type:

PayStackResponse object

async export_disputes(per_page: int | None = 50, page: int | None = 1, from_date: date | None = None, to_date: date | None = None, transaction_id: str | None = None, status: str | None = None)→ PayStackResponse

Export disputes.

Parameters:
  • per_page (int, optional) – The number of disputes to return per page.

  • page (int, optional) – The page to return.

  • from_date (date, optional) – The date from which to fetch disputes.

  • to_date (date, optional) – The date until which to fetch disputes.

  • transaction_id (str, optional) – The ID of the transaction.

  • status (str, optional) – The dispute status.

Returns:

The response from the API.

Return type:

PayStackResponse object

async fetch_dispute(dispute_id: str)→ PayStackResponse

Fetch a dispute.

Parameters:

dispute_id (str) – The ID of the dispute to fetch

Returns:

The response from the API

Return type:

ClientEPayStackResponse object

async get_upload_url(dispute_id: str, uploaded_filename: str)→ PayStackResponse

Get the upload URL for a dispute.

Parameters:
  • dispute_id (str) – The ID of the dispute to fetch

  • uploaded_filename (str) – The name of the uploaded file with the extension

Returns:

The response from the API

Return type:

PayStackResponse object

async list_disputes(from_date: date | None = None, to_date: date | None = None, per_page: int | None = 50, page: int | None = 1, transaction_id: str | None = None, status: str | None = None)→ PayStackResponse

List disputes.

Parameters:
  • from_date (date, optional) – The date from which to fetch disputes.

  • to_date (date, optional) – The date until which to fetch disputes.

  • per_page (int, optional) – The number of disputes to return per page.

  • page (int, optional) – The page to return

  • transaction_id (str, optional) – The ID of the transaction.

  • status (str, optional) – The dispute status.

Returns:

The response from the API

Return type:

PayStackResponse object

async list_transaction_disputes(transaction_id: str)→ PayStackResponse

List disputes for a transaction.

Parameters:

transaction_id (str) – The ID of the transaction.

Returns:

The response from the API

Return type:

PayStackResponse object

async resolve_dispute(dispute_id: str, resolution: str, message: str, refund_amount: int, uploaded_filename: str, evidence: int | None = None)→ PayStackResponse

Resolve a dispute.

Parameters:
  • dispute_id (str) – The ID of the dispute to resolve

  • resolution (str) – The resolution to resolve the dispute. Values to pass: Resolution.value.value

  • message (str) – The message for resolution.

  • refund_amount (int) – The refund amount to the customer

  • uploaded_filename (str) – filename of attachment returned via response from method get_upload_url

  • evidence (int, optional) – The evidence

Returns:

The response from the API

Return type:

PayStackResponse object

async update_dispute(dispute_id: str, refund_amount: int, uploaded_filename: str | None = None)→ PayStackResponse

Update a dispute.

Parameters:
  • dispute_id (str) – The ID of the dispute to update

  • refund_amount (int) – The refund amount to the customer

  • uploaded_filename (str, optional) – filename of attachment returned via response from method get_upload_url

Returns:

The response from the API

Return type:

PayStackResponse object

The status parameter has the string value of the DisputeStatus enum class. Also, the resolution parameter has the string value of the Resolution enum class. See documentation at Tool kit module.

Important

The filename returned by get_upload_url method must be used when uploading the file.