Skip to main content
POST
/
customers
/
{customer_id}
/
payment_methods
/
attach
Attach external payment method
curl --request POST \
  --url https://api.zenskar.com/customers/{customer_id}/payment_methods/attach \
  --header 'Content-Type: application/json' \
  --header 'organisation: <api-key>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "payment_method_id": "<string>",
  "connector": {
    "name": "<string>",
    "reference_id": "<string>"
  },
  "set_as_default": true
}
'
{
  "customer_id": "<string>",
  "payment_method_id": "<string>",
  "external_id": "<string>",
  "set_as_default": true,
  "raw_data": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
default:<your-api-key>
required
organisation
string
header
default:<your-organisation-id>
required

Path Parameters

customer_id
string<uuid>
required

Body

application/json

Request schema for attaching external payment method to customer

payment_method_id
string
required

Payment method ID from external provider (e.g., Stripe pm_xxx)

Minimum string length: 1
connector
Connector · object

Payment provider connector configuration (e.g., {'name': 'stripe'}). If not provided, will auto-detect from resource mappings.

set_as_default
boolean | null

Whether to set this payment method as default for the customer

Response

Successful Response

Response schema for payment method attachment operation

customer_id
string
required

Customer ID

payment_method_id
string
required

Attached payment method ID

external_id
string
required

External customer ID (e.g., Stripe customer ID)

set_as_default
boolean
required

Whether payment method was set as default

raw_data
Raw Data · object
required

Raw PaymentMethod object from provider