Introduction

Express Checkout APIs are built around basic HTTP communication and closely follows 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

All the APIs except POST /txns use Basic HTTP authentication scheme to authenticate the requests and identify your account. 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.

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
Note: 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

curl https://api.juspay.in/orders \
    -u "$your_api_key:"

Header

-H 'Content-Type: application/x-www-form-urlencoded'
-H 'x-merchantid:$your_merchantId'

Version

Proper version headers ensure that we do not send any information that your client is not capable of handling. Our latest API version is 2018-10-25. The changelog for the revisions is given below.

2021-03-05
Rewards_breakup info will be present in order status response
RewardsBreakup
{ rewards_points_amount
, card_amount
}

2020-10-31
For this version, txn_sub_details param is included in order status response if txnObjectType == PARTIAL_CAPTURE.
If txn type is PREAUTH_AND_SETTLE, captured_amount, Refundable_amount params are included in order status response

2021-03-25
For this version, metadata params is included in refund block in order status response

2020-11-20
For this version, error_code param is included in refund block in order status response

2020-03-14
For this version the Metadata that is passed during the order creation will be present in order status response

2019-03-12
For this version, refund_source, refund_type params are included in refund block in order status response

2019-11-11
For this version Status in order status API Response can be AUTO_REFUNDED with status_id as 36 if transaction is auto refunded

2018-10-25
For this version, ‘gateway_reference_id’ param is included in order status response payload.

2018-09-20
For this version, 'initiated_by’ param is included in order refund whether the refund was initiated by API or from the dashboard

2018-07-16
Surcharge information is included in the order status response

2017-07-26
Chargebacks against the order will be included in the response payload.

2017-05-25
For this version, PG offer related params are included in the payment_gateway_response block.

2017-03-16
Refunds are marked as MANUAL_REVIEW if they remain in PENDING state for a considerably longer duration. Typically, network timeout errors at the time of the transaction will result in such state and most importantly, for gateways that do not provide automatic reconciliation.

2016-10-27
For this version, webhooks are posted whenever the payment is initiated for an order.

2016-07-19
For order payment failures, webhooks will be sent to your server. Remember to configure this version in the Webhook settings page.

2015-08-18
/order/status will respond with all the failed refunds too. Prior to this version, failed refunds were expressly excluded from the listing as clients did not have the capability to handle refunds in the failure state.

2015-01-09
Refunds in the pending state will have status PENDING. Prior to this, refund status PENDING was sent as SUCCESS.

Note: JusPay introduced PENDING status for refunds as a large number of PayU refunds were initially queued and the success of these refunds was not guaranteed.

Sample request

curl https://api.juspay.in/orders \
    -H "version: 2018-10-25" \
    -u "$your_api_key:"