Skip to main content
POST
/
me
/
paymentMethods
Add a payment method
curl --request POST \
  --url https://api.guile.app/me/paymentMethods \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "paymentMethodToken": "<string>",
  "isDefault": false
}
'
{
  "type": "card",
  "isDefault": false,
  "card": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "network": "visa",
    "last4": "<string>",
    "expirationMonth": "<string>",
    "expirationYear": "<string>"
  },
  "digitalWallet": {
    "provider": "apple"
  }
}

Body

application/json

Request body for adding a payment method to a customer's profile.

Payment methods must be tokenized through the payment processor's client-side SDK before being submitted to this API. Never send raw card details directly.

paymentMethodToken
string
required

The payment method token obtained from the payment processor's client-side SDK.

For card payments, this should be a tokenized representation of the card (e.g., a Stripe payment method token). Specific cards for digital wallets (like Apple Pay or Google Pay) cannot be added and should instead be processed directly through the payment processor during checkout.

This token is used to securely add the payment method without exposing sensitive payment information to the API.

Required string length: 1 - 500
isDefault
boolean
default:false
required

Whether to set this payment method as the default payment method for the customer.

If set to true, this payment method will be used by default for future transactions. If the customer already has a default payment method, it will be replaced.

Response

Created.

Representation of a payment method for a customer

type
enum<string>
required

Indicator of the payment method type.

Available options:
card,
digitalWallet
isDefault
boolean
default:false
required

Indicates if this card is the default card in a customer's saved payment methods.

card
object

A representation of the customer's credit or debit card. This property is required when the payment method type is card.

digitalWallet
object

A representation of the customer's digital wallet, such as Apple Pay. This property is required when the payment method type is digitalWallet.