Skip to main content
GET
/
refunds
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: 'My API Key',
});

// Automatically fetches more pages as needed.
for await (const refundListResponse of client.refunds.list({ payment_id: 'pay_xxxxxxxxxxxxxx' })) {
  console.log(refundListResponse.id);
}
{
  "data": [
    {
      "id": "rf_xxxxxxxxxxxxxxx",
      "amount": 6.9,
      "currency": "usd",
      "status": "pending",
      "created_at": "2023-12-01T05:00:00.401Z",
      "provider": "stripe",
      "provider_created_at": "2023-12-01T05:00:00.401Z",
      "reference_status": "available",
      "reference_type": "acquirer_reference_number",
      "reference_value": "<string>",
      "payment": {
        "id": "pay_xxxxxxxxxxxxxx"
      }
    }
  ],
  "page_info": {
    "end_cursor": "<string>",
    "start_cursor": "<string>",
    "has_next_page": true,
    "has_previous_page": true
  }
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Query Parameters

after
string | null

Returns the elements in the list that come after the specified cursor.

before
string | null

Returns the elements in the list that come before the specified cursor.

first
integer | null

Returns the first n elements from the list.

Example:

42

last
integer | null

Returns the last n elements from the list.

Example:

42

payment_id
string
required

The ID of the payment to list refunds for

Example:

"pay_xxxxxxxxxxxxxx"

direction
enum<string> | null

The direction to sort the refunds by The direction of the sort.

Available options:
asc,
desc

Response

A successful response

The connection type for Refund.

data
object[]
required

A list of nodes.

page_info
object
required

Information to aid in pagination.