Server to Server
Server to Server tokenization with Hyperswitch Vault Service for PCI compliant merchants
Secure, Direct Card Tokenization from Your Server
Tokenize payment cards directly from your servers to Juspay Hyperswitch's Vault Service, bypassing client-side tokenization. This server-to-server approach provides enhanced security and flexibility, ideal for PCI-compliant businesses managing payment methods programmatically.
Key Features
Full Token Management – Create, retrieve, update, and delete payment tokens directly from your server.
Network Tokenization – Generate network tokens through a single API.
Secure Storage – Store tokens safely in Hyperswitch's Vault.
Reduced Frontend Complexity – Shift tokenization processes to the backend, minimizing frontend dependencies.
Prerequisites
To implement server-to-server tokenization, you need:
PCI DSS compliance to handle card data securely: Make sure you have necessary PCI compliance to handle raw card data directly
Secure API authentication to protect transactions: Generate your Hyperswitch API key from Developers --> API Keys section on your Hyperswitch dashboard
Robust error handling for tokenization failures: Implement necessary handling for failure cases
How It Works
Collect Card Details – Your server collects card details (requires PCI compliance).
Send a Tokenization Request – Make a POST request to /payment_methods with the card details.
Token Creation & Validation – Hyperswitch validates the request and generates a secure token in the vault.
Network Tokenization (Optional) – If configured through your Hyperswitch dashboard, we also generate network tokens when you pass relevant parameters as mentioned below
Receive Payment Method ID – You get a pm_id, which can be used for future payments.
API Requests for Server to Server Tokenization
All Vault API requests require a Vault API Key and your Profile ID. See Vault Configuration for step-by-step instructions on generating these credentials from the Hyperswitch Control Centre.
1. Create a Customer
Endpoint:
POST /customersPurpose: Create a customer to enable storing their payment methods
For detailed request parameters and examples, refer to the Create Customer API Reference.
2. Create a Payment Method Id
Endpoint:
POST /payment_methodsPurpose: Generate a Id for a card
For detailed request parameters and examples, including how to create payment method tokens with network tokens, refer to the Create Payment Method API Reference.
3. Retrieve a Payment Method Id
Endpoint:
POST /payment_methods/:pm_idPurpose: Retrieve a Payment Method for a Id
For detailed request parameters and examples, including how to retrieve payment method id with network tokens, refer to the Retrieve Payment Method API Reference.
4. Update a Payment Method Id
Endpoint:
PATCH /payment_methods/:pm_id/update_saved_payment_methodPurpose: Modify Payment Method details.
For detailed request parameters and examples, refer to the Update Payment Method API Reference.
5. Delete a Payment Method Id
Endpoint:
DELETE /payment_methods/:pm_idPurpose: Remove a Id from the vault.
For detailed request parameters and examples, refer to the Delete Payment Method API Reference.
Last updated
Was this helpful?

