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

const client = new Whopsdk({
  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,
  "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>"
}

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

Example:

"pay_xxxxxxxxxxxxxx"

status
enum<string> | null
required

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

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

The friendly status of the 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
refundable
boolean
required

Whether the payment can be refunded.

retryable
boolean
required

Whether the payment can be retried.

created_at
integer
required

The datetime the receipt was created

Example:

1701406800

paid_at
integer | null
required

The datetime the receipt was paid

Example:

1701406800

last_payment_attempt
integer | null
required

The time of the last payment attempt.

Example:

1701406800

dispute_alerted_at
integer | null
required

When an alert came in that this transaction will be disputed

Example:

1701406800

refunded_at
integer | null
required

When the payment was refunded (if applicable).

Example:

1701406800

plan
object | null
required

The plan attached to this receipt.

product
object | null
required

The access pass attached to this receipt.

user
object | null
required

The user that made this payment.

membership
object | null
required

The membership attached to this receipt.

company
object | null
required

The company for the receipt.

promo_code
object | null
required

The promo code used for this receipt.

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 receipt is for after fees

Example:

6.9

card_brand
string | null
required

The type of card used as the payment method.

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

Returns the type of payment method used for the payment, if available. Ex. klarna, affirm, card, cashapp

billing_reason
string | null
required

The billing reason

failure_message
string | null
required

If the payment failed, the reason for the failure.

I