Skip to main content
GET
/
payments
JavaScript
import Whopsdk from 'whopsdk';

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

// Automatically fetches more pages as needed.
for await (const paymentListResponse of client.payments.list({ company_id: 'biz_xxxxxxxxxxxxxx' })) {
  console.log(paymentListResponse.id);
}
{
  "data": [
    {
      "id": "pay_xxxxxxxxxxxxxx",
      "status": "draft",
      "substatus": "auto_refunded",
      "refundable": true,
      "retryable": true,
      "created_at": 1701406800,
      "paid_at": 1701406800,
      "last_payment_attempt": 1701406800,
      "dispute_alerted_at": 1701406800,
      "refunded_at": 1701406800,
      "plan": {
        "id": "plan_xxxxxxxxxxxxx"
      },
      "product": {
        "id": "prod_xxxxxxxxxxxxx",
        "title": "<string>",
        "route": "<string>"
      },
      "user": {
        "id": "user_xxxxxxxxxxxxx",
        "name": "<string>",
        "username": "<string>",
        "email": "<string>"
      },
      "membership": {
        "id": "mem_xxxxxxxxxxxxxx",
        "status": "trialing"
      },
      "company": {
        "id": "biz_xxxxxxxxxxxxxx",
        "title": "<string>",
        "route": "<string>"
      },
      "promo_code": {
        "id": "promo_xxxxxxxxxxxx",
        "code": "<string>",
        "amount_off": 6.9,
        "base_currency": "usd",
        "promo_type": "percentage",
        "number_of_intervals": 42
      },
      "currency": "usd",
      "total": 6.9,
      "subtotal": 6.9,
      "usd_total": 6.9,
      "refunded_amount": 6.9,
      "auto_refunded": true,
      "amount_after_fees": 6.9,
      "card_brand": "<string>",
      "card_last4": "<string>",
      "billing_address": {
        "name": "<string>",
        "line1": "<string>",
        "line2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "postal_code": "<string>",
        "country": "<string>"
      },
      "payment_method_type": "<string>",
      "billing_reason": "<string>",
      "failure_message": "<string>"
    }
  ],
  "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

company_id
string
required

The ID of the company to list payments for

Example:

"biz_xxxxxxxxxxxxxx"

direction
enum<string> | null

Which way to order the results. The direction of the sort.

Available options:
asc,
desc
order
enum<string> | null

How to order the results. The order to sort the results by.

Available options:
final_amount,
created_at,
paid_at
product_ids
string[] | null

A specific product.

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

billing_reasons
enum<string>[] | null

The billing reason for the payment

currencies
enum<string>[] | null

The currency of the payment.

plan_ids
string[] | null

A specific plan.

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

statuses
enum<string>[] | null

The status of the payment.

substatuses
enum<string>[] | null

The substatus of the payment.

include_free
boolean | null

Whether to include free payments.

created_before
integer | null

The maximum creation date to filter by

Example:

1701406800

created_after
integer | null

The minimum creation date to filter by

Example:

1701406800

Response

A successful response

The connection type for Receipt.

data
array | null
required

A list of nodes.

page_info
object
required

Information to aid in pagination.

I