Introduction
Juspay APIs are built around basic HTTP communication and closely follo`ws the standards of REST. While the URL themselves are not specific to resources, the URL path is intuitive to reflect the action performed by the API.
API Endpoint
|
Environment
|
Endpoint
|
|---|---|
Sandbox
| https://sandbox.juspay.in
|
Production
| https://api.juspay.in
|
Production Static
| https://api-ns1.juspay.in
|
Authentication
Below are the details on the two mode of Authentication that Juspay support.
API Key:
All the APIs except POST /txns use Basic HTTP authentication scheme to authenticate the requests and identify your account. API key is generally used for the server side API calls. The API key can be obtained from the Juspay dashboard. Provide your API key as the basic auth username value. You do not need to provide a password. If its passed as Authorization in the header then it should be the Basic auth of Base64 encoded value of API Key.
Transaction POST /txns API is exempted from authentication so that the card numbers (sensitive data) can be posted from your servers to JusPay’s servers if you are PCI Compliant
API Key is like the password to your account. You must never send this information to browser or application clients. Also, do not publish your API Key in publicly accessible areas such as Git repositories, Android/iOS clients, support forums, etc.
Sample request
Client Auth Token
Client Auth Token is another mode of Authentication. The client auth token is a 15min valid token which can be generated from create order or Get/create customer API (Details provided in the respective section). This token can be used for client side authentication ie for SDK integration.
Header
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'x-merchantid:<your_merchantId>'
-H 'x-routing-id:<your_customer_id>'
The request should always be in application/x-www-form-urlencoded format. Using different format for request submission might lead to request failure.
The x-merchantid is a mandatory params in all the API call. The value is same as the merchant_id/ username provided by Juspay.
For all backend APIs, we expect x-routing-id https request header.
Merchants session is tied to the first API call merchant makes to start the payment. Generally its order create or customer create API call. We recommend passing the customer_id as x-routing-id.
Session is tied to x-routing-id, merchant should ensure to pass same x-routing-id for all the api calls being made for the same session.
- Have questions?
- Need help? Contact support
- LLM? Read llms.txt

