Skip to main content
POST
/
topups
Create topup
curl --request POST \
  --url https://api.whop.com/api/v1/topups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 6.9,
  "company_id": "biz_xxxxxxxxxxxxxx",
  "payment_method_id": "pmt_xxxxxxxxxxxxxx"
}
'
import requests

url = "https://api.whop.com/api/v1/topups"

payload = {
"amount": 6.9,
"company_id": "biz_xxxxxxxxxxxxxx",
"payment_method_id": "pmt_xxxxxxxxxxxxxx"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 6.9,
company_id: 'biz_xxxxxxxxxxxxxx',
payment_method_id: 'pmt_xxxxxxxxxxxxxx'
})
};

fetch('https://api.whop.com/api/v1/topups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/topups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 6.9,
'company_id' => 'biz_xxxxxxxxxxxxxx',
'payment_method_id' => 'pmt_xxxxxxxxxxxxxx'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.whop.com/api/v1/topups"

payload := strings.NewReader("{\n \"amount\": 6.9,\n \"company_id\": \"biz_xxxxxxxxxxxxxx\",\n \"payment_method_id\": \"pmt_xxxxxxxxxxxxxx\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/topups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 6.9,\n \"company_id\": \"biz_xxxxxxxxxxxxxx\",\n \"payment_method_id\": \"pmt_xxxxxxxxxxxxxx\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.whop.com/api/v1/topups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 6.9,\n \"company_id\": \"biz_xxxxxxxxxxxxxx\",\n \"payment_method_id\": \"pmt_xxxxxxxxxxxxxx\"\n}"

response = http.request(request)
puts response.read_body
{
  "created_at": "2023-12-01T05:00:00.401Z",
  "failure_message": "<string>",
  "id": "pay_xxxxxxxxxxxxxx",
  "paid_at": "2023-12-01T05:00:00.401Z",
  "total": 6.9
}
{
"error": {
"code": "parameter_missing",
"message": "Missing required parameter: amount.",
"param": "amount",
"type": "invalid_request_error"
}
}
{
"error": {
"message": "Invalid or missing API key",
"type": "unauthorized"
}
}
{
"error": {
"message": "You do not have permission to access this resource",
"type": "forbidden"
}
}
{
"error": {
"message": "Resource not found",
"type": "not_found"
}
}
{
"error": null
}
{
"error": null
}
{
"error": {
"message": "An unexpected error occurred",
"type": "internal_server_error"
}
}

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

Body

application/json

Parameters for CreateTopup

amount
number
required

The amount to add to the balance in the specified currency. For example, 50.00 for $50.00 USD.

Example:

6.9

company_id
string
required

The unique identifier of the company to add funds to, starting with 'biz_'.

Example:

"biz_xxxxxxxxxxxxxx"

currency
enum<string>
required

The currency for the top-up amount, such as 'usd'.

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,
usdt,
kzt,
awg,
whop_usd,
xau
payment_method_id
string
required

The unique identifier of the stored payment method to charge for the top-up.

Example:

"pmt_xxxxxxxxxxxxxx"

Response

A successful response

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

created_at
string<date-time>
required

The datetime the payment was created.

Example:

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

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,
usdt,
kzt,
awg,
whop_usd,
xau
failure_message
string | null
required

If the payment failed, the reason for the failure.

id
string
required

The unique identifier for the payment.

Example:

"pay_xxxxxxxxxxxxxx"

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"

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

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

Example:

6.9