get
https://example.com
POST /v2/affiliatePaymentMethods — Add a payment method
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Adds a Stripe payment method to the authenticated affiliate's Telegra billing profile.
For cards, obtain a paymentMethodId (pm_xxx) via Stripe.js, then call this endpoint. The paymentMethodType field can be omitted for cards.
For ACH bank accounts, complete the SetupIntent flow first (see POST /ach-setup-intent), then call this endpoint with paymentMethodType: "us_bank_account". The bank account is already attached to the Stripe customer by the time you call this — the endpoint registers it in Telegra's billing profile.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
paymentMethodId | string | Yes | Stripe payment method ID (pm_xxx) |
paymentMethodType | string | No | Set to us_bank_account for ACH; omit or set to card for credit/debit cards |
Response
Returns 201 Created with the added payment method details.
Card response (data)
data)| Field | Description |
|---|---|
paymentMethodId | Stripe pm_xxx ID |
billingProfileId | Telegra internal billing profile ID |
paymentMethodDetails.type | card |
paymentMethodDetails.cardBrand | e.g. visa, mastercard |
paymentMethodDetails.last4 | Last 4 digits |
paymentMethodDetails.expMonth | Expiry month (1–12) |
paymentMethodDetails.expYear | Expiry year (4-digit) |
paymentMethodDetails.isDefault | Whether this is the default method |
paymentMethodDetails.name | Cardholder name |
paymentMethodDetails.postalCode | Billing postal code |
ACH bank account response (data)
data)| Field | Description |
|---|---|
paymentMethodId | Stripe pm_xxx ID |
billingProfileId | Telegra internal billing profile ID |
paymentMethodDetails.type | us_bank_account |
paymentMethodDetails.bankName | Bank name |
paymentMethodDetails.last4 | Last 4 digits of account number |
paymentMethodDetails.accountType | checking or savings |
paymentMethodDetails.isDefault | Whether this is the default method |
paymentMethodDetails.name | Account holder name |
Errors
| Error | Cause |
|---|---|
PAYMENT_METHOD_CANNOT_BE_REUSED | The Stripe payment method was previously detached and can no longer be attached |
PAYMENT_METHOD_ATTACHMENT_FAILED | Stripe rejected the attachment for another reason |
Required role
affiliate_super_admin, affiliate_admin, or affiliate_agent
