Create Token
Create a payment token to securely store customer payment information. Tokens are used to create subscriptions and have a 24-hour expiration period to ensure security.
subscriptions.write
scope.Authorizations
Bearer authentication header in the format `Bearer <token>`, where `<token>` is your authentication token.
Headers
Merchant account ID for this request.
""default""
Body
application/jsonMerchant reference identifier for this token. Used to identify the token in your system.
"token-12345"
Subscription amount in cents (smallest currency unit).
"1000"
"2999"
Subscription currency (ISO 4217 format).
"USD"
"EUR"
Customer information object.
Payment method information object. If the merchant does not have PCI compliance, use checkout mode to redirect to the payment page to collect card information.
Billing details for this token.
Array of cart items representing token line items.
Browser information used by the customer. **Required for direct API mode**. This can be used for anti-fraud services.
Custom key-value pairs for additional information.
"{"source": "website", "campaign": "summer_promotion"}"
Response
Successful Response
Unique token identifier. If null, the user needs to complete payment through payment_url_link. Token ID will be returned via webhooks after successful payment.
"token_1234567890abcdef"
"null"
Object type, always "token".
"token"
Token creation time (ISO 8601).
"2025-08-12T09:00:00Z"
Subscription amount in cents (smallest currency unit).
"1000"
Subscription currency (ISO 4217 format).
"USD"
Customer information with generated ID.
Payment method information.
Token expiration time (ISO 8601).
"2025-08-13T09:00:00Z"
URL to complete payment for this token. **Required when id is null**. Users must complete payment through this link to receive the token ID via webhooks.
"https://pay.efundpay.com/token/abc123"
"null"
curl --request POST \--url https://api.efundpay.com/v4/tokens \--header 'Authorization: Bearer <token>' \--header 'x-merchant-account-id: <x-merchant-account-id>' \--header 'Content-Type: application/json' \--data '{"external_identifier": "token-12345","amount": 1000,"currency": "USD","customer": {"display_name": "John Doe","external_identifier": "customer-12345","first_name": "John","last_name": "Doe","email_address": "john@example.com","phone_number": "+1234567890","account_number": "123456789"},"payment_method": {"payment_channel_code": "card","type": "card","webhooks_url": "https://merchant.com/webhooks/token","card": {"number": "4111111111111111","expiration_date": "12/27","security_code": "123"}},"cart_items": [{"name": "Premium Plan","description": "Premium subscription plan with advanced features","quantity": 1,"unit_amount": 1000,"discount_amount": 0,"tax_amount": 0,"external_identifier": "premium-plan","sku": "PREMIUM001","product_url": "https://example.com/catalog/premium-plan","image_url": "https://example.com/images/premium-plan.jpg","categories": ["subscription", "premium", "feature"],"product_type": "service"}],"browser_info": {"javascript_enabled": true,"java_enabled": false,"language": "en-US","color_depth": 24,"screen_height": 1080,"screen_width": 1920,"time_zone_offset": -480,"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","user_device": "desktop","accept_header": "*/*"},"billing_details": {"first_name": "John","last_name": "Doe","email_address": "john@example.com","phone_number": "+1234567890","address": {"city": "San Jose","country": "US","postal_code": "94560","state": "California","state_code": "US-CA","house_number_or_name": "10","line1": "Stafford Appartments","line2": "29th Street","organization": "EFundFlow"}}}'
{"id": null,"object": "token","created": "2025-08-12T09:00:00Z","amount": 1000,"currency": "USD","customer": {"id": "cus_abc123","display_name": "John Doe","external_identifier": "customer-12345","first_name": "John","last_name": "Doe","email_address": "john@example.com","phone_number": "+1234567890","account_number": "123456789"},"payment_method": {"type": "card","card": {"brand": "visa","last4": "4242","exp_month": 12,"exp_year": 2027}},"expires_at": "2025-08-13T09:00:00Z","payment_url_link": "https://pay.efundpay.com/token/abc123"}