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

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

const payment = await client.payments.retrieve('pay_xxxxxxxxxxxxxx');

console.log(payment.id);
{
  "id": "pay_xxxxxxxxxxxxxx",
  "status": "draft",
  "substatus": "succeeded",
  "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",
  "next_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": "Pickaxe Analytics",
    "route": "pickaxe-analytics"
  },
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "name": "John Doe",
    "username": "johndoe42",
    "email": "john.doe@example.com"
  },
  "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": "4242",
      "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,
  "application_fee": {
    "id": "apfee_xxxxxxxxxxxx",
    "amount": 6.9,
    "amount_captured": 6.9,
    "amount_refunded": 6.9,
    "currency": "usd",
    "created_at": "2023-12-01T05:00:00.401Z"
  },
  "card_brand": "mastercard",
  "card_last4": "4242",
  "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",
  "payments_failed": 42,
  "failure_message": "<string>",
  "metadata": {},
  "financing_installments_count": 42,
  "financing_transactions": [
    {
      "id": "ptx_xxxxxxxxxxxxxx",
      "amount": 6.9,
      "status": "succeeded",
      "created_at": "2023-12-01T05:00:00.401Z",
      "transaction_type": "purchase"
    }
  ],
  "disputes": [
    {
      "id": "dspt_xxxxxxxxxxxxx",
      "amount": 6.9,
      "currency": "usd",
      "status": "warning_needs_response",
      "editable": true,
      "needs_response_by": "2023-12-01T05:00:00.401Z",
      "reason": "Product Not Received",
      "notes": "Customer used the product for 3 months before disputing."
    }
  ],
  "resolutions": [
    {
      "id": "reso_xxxxxxxxxxxxx",
      "status": "merchant_response_needed",
      "due_date": "2023-12-01T05:00:00.401Z",
      "issue": "forgot_to_cancel",
      "customer_appealed": true,
      "merchant_appealed": true,
      "customer_response_actions": [
        "respond"
      ],
      "merchant_response_actions": [
        "accept"
      ],
      "platform_response_actions": [
        "request_buyer_info"
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The unique identifier of the payment.

Example:

"pay_xxxxxxxxxxxxxx"

Response

A successful response

A payment represents a completed or attempted charge. Payments track the amount, status, currency, and payment method used.

id
string
required

The unique identifier for the payment.

Example:

"pay_xxxxxxxxxxxxxx"

status
enum<string> | null
required

The current lifecycle state of this payment (e.g., 'draft', 'open', 'paid', 'void').

Available options:
draft,
open,
paid,
pending,
uncollectible,
unresolved,
void
substatus
enum<string>
required

The friendly status of the payment.

Available options:
succeeded,
pending,
failed,
past_due,
canceled,
price_too_low,
uncollectible,
refunded,
auto_refunded,
partially_refunded,
dispute_warning,
dispute_needs_response,
dispute_warning_needs_response,
resolution_needs_response,
dispute_under_review,
dispute_warning_under_review,
resolution_under_review,
dispute_won,
dispute_warning_closed,
resolution_won,
dispute_lost,
dispute_closed,
resolution_lost,
drafted,
incomplete,
unresolved,
open_dispute,
open_resolution
refundable
boolean
required

True only for payments that are paid, have not been fully refunded, and were processed by a payment processor that allows refunds.

retryable
boolean
required

True when the payment status is open and its membership is in one of the retry-eligible states (active, trialing, completed, or past_due); otherwise false. Used to decide if Whop can attempt the charge again.

voidable
boolean
required

True when the payment is tied to a membership in past_due, the payment status is open, and the processor allows voiding payments; otherwise false.

created_at
string<date-time>
required

The datetime the payment was created.

Example:

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

paid_at
string<date-time> | null
required

The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp.

Example:

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

last_payment_attempt
string<date-time> | null
required

The time of the last payment attempt.

Example:

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

next_payment_attempt
string<date-time> | null
required

The time of the next schedule payment retry.

Example:

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

dispute_alerted_at
string<date-time> | null
required

When an alert came in that this transaction will be disputed

Example:

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

refunded_at
string<date-time> | null
required

When the payment was refunded (if applicable).

Example:

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

plan
object
required

The plan attached to this payment.

product
object
required

The product this payment was made for

user
object
required

The user that made this payment.

membership
object
required

The membership attached to this payment.

member
object
required

The member attached to this payment.

payment_method
object
required

The tokenized payment method reference used for this payment. Null if no token was used.

company
object
required

The company for the payment.

promo_code
object
required

The promo code used for this payment.

currency
enum<string> | null
required

The three-letter ISO currency code for this payment (e.g., 'usd', 'eur').

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
total
number | null
required

The total to show to the creator (excluding buyer fees).

Example:

6.9

subtotal
number | null
required

The subtotal to show to the creator (excluding buyer fees).

Example:

6.9

usd_total
number | null
required

The total in USD to show to the creator (excluding buyer fees).

Example:

6.9

refunded_amount
number | null
required

The payment refund amount(if applicable).

Example:

6.9

auto_refunded
boolean
required

Whether this payment was auto refunded or not

amount_after_fees
number
required

How much the payment is for after fees

Example:

6.9

application_fee
object
required

The application fee charged on this payment.

card_brand
enum<string> | null
required

Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'.

Available options:
mastercard,
visa,
amex,
discover,
unionpay,
jcb,
diners,
link,
troy,
visadankort,
visabancontact,
china_union_pay,
rupay,
jcbrupay,
elo,
maestro,
tarjeta_naranja,
cirrus,
nspk_mir,
verve,
ebt,
private_label,
local_brand,
uatp,
wexcard,
uzcard,
meeza,
hrg_store_card,
girocard,
fuel_card,
dankort,
carnet,
atm_card,
china_union_payuzcard,
codensa,
cabal,
unknown
card_last4
string | null
required

The last four digits of the card used to make this payment. Null if the payment was not made with a card.

Example:

"4242"

billing_address
object
required

The address of the user who made the payment.

payment_method_type
enum<string> | null
required

The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type.

Available options:
acss_debit,
affirm,
afterpay_clearpay,
alipay,
alma,
amazon_pay,
apple,
apple_pay,
au_becs_debit,
bacs_debit,
bancontact,
billie,
bizum,
blik,
boleto,
capchase_pay,
card,
cashapp,
claritypay,
coinbase,
crypto,
custom,
customer_balance,
demo_pay,
eps,
eu_bank_transfer,
fpx,
giropay,
google_pay,
gopay,
grabpay,
id_bank_transfer,
ideal,
interac,
kakao_pay,
klarna,
konbini,
kr_card,
kr_market,
kriya,
link,
mb_way,
mobilepay,
mondu,
multibanco,
naver_pay,
netbanking,
ng_bank,
ng_bank_transfer,
ng_card,
ng_market,
ng_ussd,
ng_wallet,
nz_bank_account,
oxxo,
p24,
pay_by_bank,
payco,
paynow,
paypal,
paypay,
payto,
pix,
platform_balance,
promptpay,
qris,
rechnung,
revolut_pay,
samsung_pay,
satispay,
scalapay,
sepa_debit,
sequra,
sezzle,
shop_pay,
shopeepay,
sofort,
south_korea_market,
splitit,
sunbit,
swish,
tamara,
twint,
upi,
us_bank_account,
venmo,
vipps,
wechat_pay,
zip,
unknown
billing_reason
enum<string> | null
required

The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment.

Available options:
subscription_create,
subscription_cycle,
subscription_update,
one_time,
manual,
subscription
payments_failed
integer | null
required

The number of failed payment attempts for the payment.

Example:

42

failure_message
string | null
required

If the payment failed, the reason for the failure.

metadata
object
required

The custom metadata stored on this payment. This will be copied over to the checkout configuration for which this payment was made

financing_installments_count
integer | null
required

The number of financing installments for the payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.).

Example:

42

financing_transactions
object[]
required

The financing transactions attached to this payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.).

disputes
object[] | null
required

The disputes attached to this payment. Null if the actor in context does not have the payment:dispute:read permission.

resolutions
object[] | null
required

The resolution center cases opened by the customer on this payment. Null if the actor in context does not have the payment:resolution_center_case:read permission.