Create Payment Profile
Creates a payment profile for a customer.
When you create a new payment profile for a customer via the API, it does not automatically make the profile current for any of the customer’s subscriptions. To use the payment profile as the default, you must set it explicitly for the subscription or subscription group.
Select an option from the Request Examples drop-down on the right side of the portal to see examples of common scenarios for creating payment profiles.
Do not use real card information for testing. See the Sites articles that cover testing your site setup for more details on testing in your sandbox.
Note that collecting and sending raw card details in production requires PCI compliance on your end. If your business is not PCI compliant, use Maxio.js (formerly Chargify.js) to collect credit card or bank account information.
See the following articles to learn more about subscriptions and payments:
- Subscriber Payment Details
- Self Service Pages (Allows credit card updates by Subscriber)
- Public Signup Pages payment settings
- Taxes
- Maxio.js (formerly Chargify.js)
- Full documentation on GoCardless
- Full documentation on Stripe SEPA Direct Debit
- Full documentation on Stripe BECS Direct Debit
- Full documentation on Stripe BACS Direct Debit
3D Secure (3DS) Authentication post-authentication flow
When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication.
See the 3D Secure Post-Authentication Flow article in the product documentation to learn how to manage the redirect flow.
Authorization
BasicAuth The username is a Maxio Chargify API key. The password is x.
In: header
Request Body
application/json
When following the IBAN or the Local Bank details examples, a customer, bank account and mandate will be created in your current vault. If the customer, bank account, and mandate already exist in your vault, follow the Import example to link the payment profile into Advanced Billing.
Response Body
application/json
application/json
curl -X POST "https://example.com/payment_profiles.json" \ -H "Content-Type: application/json" \ -d '{ "payment_profile": { "customer_id": 1036, "chargify_token": "tok_w68qcpnftyv53jk33jv6wk3w" } }'{ "payment_profile": { "first_name": "Jessica", "last_name": "Test", "card_type": "visa", "masked_card_number": "XXXX-XXXX-XXXX-1111", "expiration_month": 10, "expiration_year": 2018, "customer_id": 19195410, "current_vault": "bogus", "vault_token": "1", "billing_address": "123 Main St.", "billing_city": "Boston", "billing_state": "MA", "billing_zip": "02120", "billing_country": "US", "customer_vault_token": null, "billing_address_2": null, "payment_type": "credit_card", "site_gateway_setting_id": 1, "gateway_handle": "handle", "disabled": false }}List Payment Profiles GET
Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint returns an empty array.
Read Payment Profile GET
Returns a payment profile identified by its unique ID. Note that a different JSON object will be returned if the card method on file is a bank account. ### Response for Bank Account Example response for Bank Account: ``` { "payment_profile": { "id": 10089892, "first_name": "Chester", "last_name": "Tester", "created_at": "2025-01-01T00:00:00-05:00", "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "0011223344", "billing_address": "456 Juniper Court", "billing_city": "Boulder", "billing_state": "CO", "billing_zip": "80302", "billing_country": "US", "customer_vault_token": null, "billing_address_2": "", "bank_name": "Bank of Kansas City", "masked_bank_routing_number": "XXXX6789", "masked_bank_account_number": "XXXX3344", "bank_account_type": "checking", "bank_account_holder_type": "personal", "payment_type": "bank_account", "site_gateway_setting_id": 1, "gateway_handle": null } } ```