Reference / Billing

Attach/replace the tokenized payment method.

PUT /v1/billing/payment-method
Secret API key operationId: set_payment_method

Authorization

Server-to-server. Send a secret key as a Bearer token plus the x-application-id header.

Request body · required

  • brand string required
  • last4 string required
  • token string required

Responses

200 Payment method set
{
  "data": {
    "billing_email": "string",
    "has_payment_method": false,
    "payment_brand": "string",
    "payment_last4": "string"
  },
  "error": {
    "code": "string",
    "message": "string"
  },
  "meta": {
    "timestamp": "string"
  },
  "success": false
}

Request

curl -X PUT "http://localhost:8080/v1/billing/payment-method" \
  -H "Content-Type: application/json" \
  -d '{
  "brand": "visa",
  "last4": "4242",
  "token": "pm_1a2b3c"
}'

Try it

live request
PUT http://localhost:8080/v1/billing/payment-method

Request body

application/json