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

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

// 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,
      "voidable": true,
      "created_at": "2023-12-01T05:00:00.401Z",
      "paid_at": "2023-12-01T05:00:00.401Z",
      "last_payment_attempt": "2023-12-01T05:00:00.401Z",
      "dispute_alerted_at": "2023-12-01T05:00:00.401Z",
      "refunded_at": "2023-12-01T05:00:00.401Z",
      "plan": {
        "id": "plan_xxxxxxxxxxxxx"
      },
      "product": {
        "id": "prod_xxxxxxxxxxxxx",
        "title": "<string>",
        "route": "<string>"
      },
      "user": {
        "id": "user_xxxxxxxxxxxxx",
        "name": "John Doe",
        "username": "johndoe42",
        "email": "[email protected]"
      },
      "membership": {
        "id": "mem_xxxxxxxxxxxxxx",
        "status": "trialing"
      },
      "member": {
        "id": "<string>",
        "phone": "<string>"
      },
      "payment_method": {
        "id": "payt_xxxxxxxxxxxxx",
        "created_at": "2023-12-01T05:00:00.401Z",
        "payment_method_type": "acss_debit",
        "card": {
          "brand": "mastercard",
          "last4": "<string>",
          "exp_month": 42,
          "exp_year": 42
        }
      },
      "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": "mastercard",
      "card_last4": "<string>",
      "billing_address": {
        "name": "<string>",
        "line1": "<string>",
        "line2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "postal_code": "<string>",
        "country": "<string>"
      },
      "payment_method_type": "acss_debit",
      "billing_reason": "subscription_create",
      "failure_message": "<string>",
      "metadata": {}
    }
  ],
  "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.

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

How to order the results.

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

The reason why a specific payment was billed

Available options:
subscription_create,
subscription_cycle,
subscription_update,
one_time,
manual,
subscription
currencies
enum<string>[] | null

The currency of the payment.

The available currencies on the platform

Available options:
usd,
sgd,
inr,
aud,
brl,
cad,
dkk,
eur,
nok,
gbp,
sek,
chf,
hkd,
huf,
jpy,
mxn,
myr,
pln,
czk,
nzd,
aed,
eth,
ape,
cop,
ron,
thb,
bgn,
idr,
dop,
php,
try,
krw,
twd,
vnd,
pkr,
clp,
uyu,
ars,
zar,
dzd,
tnd,
mad,
kes,
kwd,
jod,
all,
xcd,
amd,
bsd,
bhd,
bob,
bam,
khr,
crc,
xof,
egp,
etb,
gmd,
ghs,
gtq,
gyd,
ils,
jmd,
mop,
mga,
mur,
mdl,
mnt,
nad,
ngn,
mkd,
omr,
pyg,
pen,
qar,
rwf,
sar,
rsd,
lkr,
tzs,
ttd,
uzs,
rub,
btc,
cny
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.

The status of a receipt

Available options:
draft,
open,
paid,
pending,
uncollectible,
unresolved,
void
substatuses
enum<string>[] | null

The substatus of the payment.

The friendly status of a receipt

Available options:
auto_refunded,
refunded,
partially_refunded,
dispute_warning,
open_resolution,
open_dispute,
failed,
price_too_low,
succeeded,
drafted,
uncollectible,
unresolved,
past_due,
pending,
incomplete,
canceled
include_free
boolean | null

Whether to include free payments.

created_before
string<date-time> | null

The maximum creation date to filter by

Example:

"2023-12-01T05:00:00.401Z"

created_after
string<date-time> | null

The minimum creation date to filter by

Example:

"2023-12-01T05:00:00.401Z"

Response

A successful response

The connection type for Receipt.

data
object[]
required

A list of nodes.

page_info
object
required

Information to aid in pagination.