Skip to main content
POST
/
api
/
v1
/
customers
/
{id}
/
payment-method
JavaScript
import Stigg from '@stigg/typescript';

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

const customerResponse = await client.v1.customers.paymentMethod.attach('x', {
  integrationId: 'integrationId',
  paymentMethodId: 'paymentMethodId',
  vendorIdentifier: 'AUTH0',
});

console.log(customerResponse.data);
{
  "data": {
    "createdAt": "2026-12-09T01:44:41.821Z",
    "updatedAt": "2026-12-09T01:44:41.824Z",
    "archivedAt": "2026-12-09T01:44:41.826Z",
    "name": "John Doe",
    "email": "[email protected]",
    "id": "customer-6e24b4",
    "metadata": {},
    "integrations": [],
    "defaultPaymentMethod": {
      "type": "CARD",
      "billingId": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
      "cardLast4Digits": "1234",
      "cardExpiryMonth": 12,
      "cardExpiryYear": 2025
    },
    "couponId": "coupon-6e24b4"
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-API-KEY
string
required

Server API Key

Path Parameters

id
string
required

The unique identifier of the entity

Required string length: 1 - 255

Body

application/json

Attach a payment method from a billing integration to a customer.

vendorIdentifier
enum<string>
required

The vendor identifier of integration

Available options:
AUTH0,
ZUORA,
STRIPE,
HUBSPOT,
AWS_MARKETPLACE,
SNOWFLAKE,
SALESFORCE,
BIG_QUERY,
OPEN_FGA,
APP_STORE
integrationId
string
required

Integration details

Maximum string length: 255
paymentMethodId
string
required

Billing provider payment method id

Maximum string length: 255
billingCurrency
enum<string> | null

Customers selected currency

Available options:
usd,
aed,
all,
amd,
ang,
aud,
awg,
azn,
bam,
bbd,
bdt,
bgn,
bif,
bmd,
bnd,
bsd,
bwp,
byn,
bzd,
brl,
cad,
cdf,
chf,
cny,
czk,
dkk,
dop,
dzd,
egp,
etb,
eur,
fjd,
gbp,
gel,
gip,
gmd,
gyd,
hkd,
hrk,
htg,
idr,
ils,
inr,
isk,
jmd,
jpy,
kes,
kgs,
khr,
kmf,
krw,
kyd,
kzt,
lbp,
lkr,
lrd,
lsl,
mad,
mdl,
mga,
mkd,
mmk,
mnt,
mop,
mro,
mvr,
mwk,
mxn,
myr,
mzn,
nad,
ngn,
nok,
npr,
nzd,
pgk,
php,
pkr,
pln,
qar,
ron,
rsd,
rub,
rwf,
sar,
sbd,
scr,
sek,
sgd,
sle,
sll,
sos,
szl,
thb,
tjs,
top,
try,
ttd,
tzs,
uah,
uzs,
vnd,
vuv,
wst,
xaf,
xcd,
yer,
zar,
zmw,
clp,
djf,
gnf,
ugx,
pyg,
xof,
xpf

Response

OK

Response object

data
Customer · object
required

A customer can be either an organization or an individual