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

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

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

console.log(payment.id);
{
  "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": "<string>",
    "username": "<string>",
    "email": "<string>"
  },
  "membership": {
    "id": "mem_xxxxxxxxxxxxxx",
    "status": "trialing"
  },
  "member": {
    "id": "<string>",
    "phone": "<string>"
  },
  "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>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required
Example:

"pay_xxxxxxxxxxxxxx"

Response

A successful response

An object representing a receipt for a membership.

id
string
required

The payment ID

Example:

"pay_xxxxxxxxxxxxxx"

status
enum<string> | null
required

The current state of the payment. The status of a receipt

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

The friendly status of the payment.

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
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 datetime the payment was paid

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"

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

The plan attached to this payment.

product
object | null
required

The access pass attached to this payment.

user
object | null
required

The user that made this payment.

membership
object | null
required

The membership attached to this payment.

member
object | null
required

The member attached to this payment.

company
object | null
required

The company for the payment.

promo_code
object | null
required

The promo code used for this payment.

currency
enum<string> | null
required

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
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

card_brand
enum<string> | null
required

Card network reported by the processor (for example visa, mastercard, amex). Present only when the underlying payment method type is card. Possible card brands that a payment token can have

Available options:
mastercard,
visa,
amex,
discover,
unionpay,
jcb,
diners,
link,
troy,
visadankort,
visabancontact,
china_union_pay,
rupay,
jcbrupay,
elo,
unknown
card_last4
string | null
required

The last 4 digits of the card used to make the payment.

billing_address
object | null
required

The address of the user who made the payment.

payment_method_type
enum<string> | null
required

Machine-readable identifier for the payment method used on the payment. Examples include card, cashapp ..., local methods such as ideal, sofort, ... BNPL options like klarna, affirm, ..., or crypto. Returns null when the processor does not supply a type. The different types of payment methods that can be used.

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

The reason for the charge. The reason why a specific payment was billed

Available options:
subscription_create,
subscription_cycle,
subscription_update,
one_time,
manual,
subscription
failure_message
string | null
required

If the payment failed, the reason for the failure.