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);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
customer_response = client.v1.customers.payment_method.attach(
id="x",
integration_id="integrationId",
payment_method_id="paymentMethodId",
vendor_identifier="AUTH0",
)
print(customer_response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
customerResponse, err := client.V1.Customers.PaymentMethod.Attach(
context.TODO(),
"x",
stigg.V1CustomerPaymentMethodAttachParams{
IntegrationID: "integrationId",
PaymentMethodID: "paymentMethodId",
VendorIdentifier: stigg.V1CustomerPaymentMethodAttachParamsVendorIdentifierAuth0,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerResponse.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.customers.CustomerResponse;
import io.stigg.models.v1.customers.paymentmethod.PaymentMethodAttachParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
PaymentMethodAttachParams params = PaymentMethodAttachParams.builder()
.id("x")
.integrationId("integrationId")
.paymentMethodId("paymentMethodId")
.vendorIdentifier(PaymentMethodAttachParams.VendorIdentifier.AUTH0)
.build();
CustomerResponse customerResponse = client.v1().customers().paymentMethod().attach(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
customer_response = stigg.v1.customers.payment_method.attach(
"x",
integration_id: "integrationId",
payment_method_id: "paymentMethodId",
vendor_identifier: :AUTH0
)
puts(customer_response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Customers.PaymentMethod;
StiggClient client = new();
PaymentMethodAttachParams parameters = new()
{
ID = "x",
IntegrationID = "integrationId",
PaymentMethodID = "paymentMethodId",
VendorIdentifier = VendorIdentifier.Auth0,
};
var customerResponse = await client.V1.Customers.PaymentMethod.Attach(parameters);
Console.WriteLine(customerResponse);stigg v1:customers:payment-method attach \
--api-key 'My API Key' \
--id x \
--integration-id integrationId \
--payment-method-id paymentMethodId \
--vendor-identifier AUTH0curl --request POST \
--url https://api.stigg.io/api/v1/customers/{id}/payment-method \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"integrationId": "<string>",
"paymentMethodId": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/customers/{id}/payment-method",
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([
'integrationId' => '<string>',
'paymentMethodId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"createdAt": "2025-10-26T10:00:00.000Z",
"updatedAt": "2025-10-26T10:00:00.000Z",
"archivedAt": null,
"name": "John Doe",
"email": "john@example.com",
"billingId": "cus_MIhJJFnJL24HFH",
"id": "customer-6e24b4",
"billingCurrency": "usd",
"metadata": {},
"integrations": [],
"defaultPaymentMethod": {
"type": "CARD",
"billingId": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"cardLast4Digits": "1234",
"cardExpiryMonth": 12,
"cardExpiryYear": 2025
},
"couponId": "coupon-6e24b4",
"timezone": null,
"language": "en",
"passthrough": {
"stripe": {
"invoiceCustomFields": {}
},
"zuora": {}
}
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Attach payment method
Attaches a payment method to a customer for billing. Required for paid subscriptions when integrated with a billing provider.
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);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
customer_response = client.v1.customers.payment_method.attach(
id="x",
integration_id="integrationId",
payment_method_id="paymentMethodId",
vendor_identifier="AUTH0",
)
print(customer_response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
customerResponse, err := client.V1.Customers.PaymentMethod.Attach(
context.TODO(),
"x",
stigg.V1CustomerPaymentMethodAttachParams{
IntegrationID: "integrationId",
PaymentMethodID: "paymentMethodId",
VendorIdentifier: stigg.V1CustomerPaymentMethodAttachParamsVendorIdentifierAuth0,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerResponse.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.customers.CustomerResponse;
import io.stigg.models.v1.customers.paymentmethod.PaymentMethodAttachParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
PaymentMethodAttachParams params = PaymentMethodAttachParams.builder()
.id("x")
.integrationId("integrationId")
.paymentMethodId("paymentMethodId")
.vendorIdentifier(PaymentMethodAttachParams.VendorIdentifier.AUTH0)
.build();
CustomerResponse customerResponse = client.v1().customers().paymentMethod().attach(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
customer_response = stigg.v1.customers.payment_method.attach(
"x",
integration_id: "integrationId",
payment_method_id: "paymentMethodId",
vendor_identifier: :AUTH0
)
puts(customer_response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Customers.PaymentMethod;
StiggClient client = new();
PaymentMethodAttachParams parameters = new()
{
ID = "x",
IntegrationID = "integrationId",
PaymentMethodID = "paymentMethodId",
VendorIdentifier = VendorIdentifier.Auth0,
};
var customerResponse = await client.V1.Customers.PaymentMethod.Attach(parameters);
Console.WriteLine(customerResponse);stigg v1:customers:payment-method attach \
--api-key 'My API Key' \
--id x \
--integration-id integrationId \
--payment-method-id paymentMethodId \
--vendor-identifier AUTH0curl --request POST \
--url https://api.stigg.io/api/v1/customers/{id}/payment-method \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"integrationId": "<string>",
"paymentMethodId": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/customers/{id}/payment-method",
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([
'integrationId' => '<string>',
'paymentMethodId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"createdAt": "2025-10-26T10:00:00.000Z",
"updatedAt": "2025-10-26T10:00:00.000Z",
"archivedAt": null,
"name": "John Doe",
"email": "john@example.com",
"billingId": "cus_MIhJJFnJL24HFH",
"id": "customer-6e24b4",
"billingCurrency": "usd",
"metadata": {},
"integrations": [],
"defaultPaymentMethod": {
"type": "CARD",
"billingId": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"cardLast4Digits": "1234",
"cardExpiryMonth": 12,
"cardExpiryYear": 2025
},
"couponId": "coupon-6e24b4",
"timezone": null,
"language": "en",
"passthrough": {
"stripe": {
"invoiceCustomFields": {}
},
"zuora": {}
}
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Path Parameters
The unique identifier of the entity
1 - 255Body
Attach a payment method from a billing integration to a customer.
The vendor identifier of the integration (e.g. STRIPE, SALESFORCE, SNOWFLAKE)
AUTH0, ZUORA, STRIPE, HUBSPOT, AWS_MARKETPLACE, SNOWFLAKE, SALESFORCE, BIG_QUERY, OPEN_FGA, APP_STORE, RECEIVED, PREQUEL, AIRWALLEX, STRIPE_INVOICING The internal ID of the integration this record is linked to
255Billing provider payment method id. Attaching it makes it the customer's new default payment method for future charges; any previously attached payment method is no longer used as the default, though it is not removed from the billing provider.
255Customers selected currency
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
The customer object with attached payment method.
Response object
A customer can be either an organization or an individual
Show child attributes
Show child attributes
