- Subscriptions that link customers to pricing plans.
- Billing entities for regional billing configurations.
- Payment methods that enable automatic billing based on usage.
- Save their payment method: Verify whether the customer’s payment method is saved with PayPal.
- If they already have a saved payment method, retrieve their latest payment method and display it to them for confirmation.
- If the customer doesn’t modify the displayed payment method, use those details to register the customer profile.
- If the customer creates a new payment method instead, save it as their new payment method and then use it to register the customer profile.
- If they don’t have a saved payment method, ask the customer to provide their payment method details and save it as a new payment method.
- If they already have a saved payment method, retrieve their latest payment method and display it to them for confirmation.
- Register customer profile: Use the saved payment method and create a customer profile.
Prerequisite
Before you register customers, ensure you have the customer’s payment information (to save) or external customer ID (to retrieve a saved payment method).1. Save payment method and get Payment Method Token (PMT)
A Payment Method Token (PMT) is a secure reference to a customer’s payment information that is stored in PayPal’s PCI-compliant vault. Instead of storing sensitive payment details directly in your system, you save them with PayPal, create a PMT, and use the PMT for transactions.Verify if customer has saved a payment method
If you have the customer’s external ID, use a valid access token and make a GET call to the/v1/commerce/billing/customers/{external_customer_id} endpoint. On successful retrieval, PayPal returns customer information including their latest payment_method_token.
If no payment method is saved, the response does not contain payment_method_token.
Response parameter
| Parameter name | Description and further action |
|---|---|
payment_method_tokenstring | Payment method token identifier. Use this value to get payment method details for customer confirmation. |
Get saved payment method details for customer confirmation
If the customer has saved a payment method, use a valid access token and make a GET call to the/v3/vault/payment-tokens/{payment_method_token} endpoint, with the payment_method_token retrieved in the previous step.
On successful retrieval, the PayPal server returns a vault customer ID and the saved payment method details.
- If the customer confirms the existing payment method: Use the existing
payment_method_tokento register their customer profile. - If the customer wants to add a new payment method: Save a new payment method.
Save a new payment method
For new customers or existing customers without saved payment methods, collect their payment information and ask for consent to save it for billing. After they agree, save the payment method and create the PMT. Supported payment methods:- PayPal wallet: For information on how to save a PayPal wallet and get the PMT, see Create payment token - PayPal.
- Cards (debit and credit cards): For information on how to save Cards and get the PMT, see Create payment token - Cards.
- Apple Pay: For information on how to save Apple Pay and get the PMT, see Create payment token - Apple Pay.
- Bank accounts (ACH debit): For information on how to save bank account information and get the PMT, see Create payment token - ACH.
2. Register customer profile
After you get a payment method token (either newly created or retrieved from existing saved payment methods), register the customer profile in your PayPal billing system. Use a valid access token and make a POST call to the/v1/commerce/billing/customers endpoint with all required request parameters. On successful customer creation, PayPal returns the customer ID you entered in external_id.
Request body parameters
| Parameter name | Description |
|---|---|
external_idRequired, string | External identifier for the customer. Must contain only alphanumeric characters, underscores, and hyphens. Maximum 64 characters. |
nameRequired, string | Full name of the customer or business name. Maximum 512 characters. |
emailRequired, string | Customer’s email address. |
addressobject | Customer’s billing address with fields: line1, line2, city, state, postal_code, country. |
phonestring | Primary phone number of the customer, including country code if available. |
payment_method_tokenstring | Token representing the customer’s saved payment method in PayPal Vault. Obtain this token either by creating a new payment method token or retrieving an existing one. |
billing_entity_codestring | Code identifying the billing entity associated with this customer. |
tax_codesarray | List of unique codes used to identify taxes to be applied to this customer. Example: ["standard_vat"]. |
metadata[]array | Array of custom key-value metadata objects for storing extra customer attributes. |
metadata[].keyRequired when metadata[] provided, string | Metadata key name. Maximum 20 characters. |
metadata[].valueRequired when metadata[] provided, string | Metadata value. Maximum 100 characters. |
metadata[].display_in_invoiceRequired when metadata[] provided, boolean | Whether to display this metadata on customer invoices. |
Response parameters
This section documents only the response parameters relevant for the next step. For the exhaustive list of response parameters, see API reference.
| Parameter name | Description and further action |
|---|---|
external_idstring | Unique external identifier for the customer. Use this external_id in future operations, such as when creating subscriptions or offering billing credits. |
payment_method_typestring | Type of payment method saved. Possible values: CARD, PAYPAL, ACH, APPLE_PAY. |
3. Understand customer lifecycle and manage customers
After you register customers, you can perform various management actions throughout their relationship with your business.| Possible management actions | Impact |
|---|---|
| Update customer details: Modify name, email, address, phone, and metadata. | Updates customer information while preserving all active subscriptions and billing. |
| Change payment method: Create new payment method token and update customer record. | Switches payment method for future billing while maintaining active subscriptions. |
| Delete customer: Remove customer data from your billing system. | Permanently removes customer and terminates all subscriptions, billing, and wallets. |