Void Transaction
This will be used to void an authorized transaction.
Status Understanding:
NOTE:
Please note the transaction status in response to the Capture API, when the underlying Payment gateways send:
Payment Gateway Response | Juspay Transaction Status |
---|---|
Pending | VOID_INITIATED |
Success | VOIDED |
Failure | VOID_FAILED |
Timeout/no response from PG | AUTHORIZED |
The orders should be captured within 7 days of transaction initiation.
Request
Method | URL |
---|---|
POST | https://api.juspay.in/v2/txns/:txn_uuid/void |
⭣
The request for the Void Transaction API consists of one Path parameter: txn_uuid, and one Header: Accept, as listed below.
Type | Field | Format | Description | |
---|---|---|---|---|
Header (-u) | * | your_api_key | String | API key can be obtained from https://merchant.juspay.in/settings/api-key. Provide your API key as the basic auth username value. You do not need to provide a password. |
Path Parameter | * | txn_uuid | String | txn_uuid available in Order Status API response |
Header | * | Accept | String | Type of format accepted in response{application/json) |
* = Required
Example
curl -X POST https://api.juspay.in/v2/txns/euhlsjbd8yhjdm/void \
-u your_api_key:
-H 'Accept: application/json'
Response
The response for the Void Transaction API is an Order Object. Other objects contained in the Order Object are listed on top: (click to open tables)
Parameter | Type | Description |
---|---|---|
payment_links:wwwwwwwwww {web, mobile, iframe} | Object String | Contains 3 strings that link to a Desktop optimized, Mobile optimized as well as iFrame checkout screen for the given order |
Payment Links Object Parameters:
Field | Type | Description |
---|---|---|
web | String | Link to checkout page that is optimized for Desktop for the given order. |
mobile | String | Link to Mobile optimized checkout page for the given order. |
iframe | String | Link to iFrame checkout screen. This is typically embedded inside of your own page. |
Payment Links
These links can directly be emailed or messaged to your customers. They will be redirected using a link to enter payment information. If you wish to use your own branding, then you can embed the iframe link into your page. Note that, these links are not valid perpetually. As soon as your order expires (this can be changed via our dashboard), the link will cease to work.
These links can directly be emailed or messaged to your customers. They will be redirected using a link to enter payment information. If you wish to use your own branding, then you can embed the iframe link into your page. Note that, these links are not valid perpetually. As soon as your order expires (this can be changed via our dashboard), the link will cease to work.
payment_gateway_response: {param1, param2, ....} | Object String | Object containing payment gateway response details |
Payment Gateway Response Object Parameters:
Field | Type | Description | Example |
---|---|---|---|
txn_id | String | Transaction ID | "11327833" |
rrn | String | Authorization Retrieval Reference Number | "502913366745" |
resp_message | String | Result of API action | "Payment Successful" |
resp_code | String | Numeric code of response message | "0" |
epg_txn_id | String | Electronic Payment Gateway transaction ID | "1532690566017" |
created | String | Date time (ISO representation) when order was created | "2020-04-28T06:31:37Z" |
auth_id_code | String | Authorization ID Code | "475926" |
card:wwwwwwwwwwnt {param1, param2, ....} | Object String | Object containing credit/debit card details |
Card Object Parameters:
Field | Type | Description |
---|---|---|
using_saved_card | boolean | True if using a saved card |
saved_to_locker | boolean | True if card has been saved to locker |
last_four_digits | String | Last four digits of card number |
name_on_card | String | Card holder name. Should contain alphabetical characters only. |
expiry_year | String | Expiry year of the card (Format: "yyyy") |
expiry_month | String | Expiry month of the card (Format: "mm") |
card_type | String | "CREDIT" or "DEBIT" |
card_reference | String | Unique identifier for the card |
card_issuer | String | Code for bank that issued the card (Example: "HDFC Bank") |
card_isin | String | International Securities Identification Number for card (Example: "545721") |
card_brand | String | Brand of card ("MASTERCARD", "VISA", etc.) |
Refunds: [{...},{...},..] wwwwwwwwwwwwwwwwwwwi | Array wwwwt | An array of Refund Objects with details of each refund (returned only if the refunded parameter is set to "true". |
Refund Object Parameters:
Field | Type | Description |
---|---|---|
id | String | ID generated for the refund |
unique_request_id | Srtring | Unique ID generated for the request |
ref | String | Reference number provided by the bank for the refund |
amount | Double | Amount refunded (or to be refunded) |
created | String | Date time (ISO representation) when refund was created |
status | String | Status of the refund. Can be one of PENDING, SUCCESS, FAILURE, MANUAL_REVIEW (see table below for meaning). |
error_message | String | Message if error occured |
sent_to_gateway | Boolean | Set to 'true' if request was sent to gateway |
Status | Meaning |
---|---|
SUCCESS | This means that the refund has been successfully executed. |
PENDING | This would mean that the refund has been queued with JusPay or with the downstream system. |
FAILURE | We were unable to process the refund successfully. You have to try again with new unique_request_id. |
MANUAL_REVIEW | This would mean that the refund request was sent an ambigious response from the payment gateway and the merchant has to manually reconcile it with the payment gateway to get the proper response. Also, any refunds which are in pending for more than 10 days are set for manual review. |
merchant_id | String | Unique identifier for the merchant. |
order_id | String | Unique Identifier for the order. It is suggested to keep the order id length at a maximum of 21 characters irrespective of payment methods and gateways. |
id | String | Unique ID generated by Juspay for the given order. |
customer_id | String | String that uniquely identifies the customer. Generated by Juspay when you created customer object. |
customer_email | String | Email address of the customer. Must be present if backend gateway requires it. |
customer_phone | String | Mobile number or fixed line number of the customer. Must be present if backend gateway requires it. |
product_id | String | An identifier for the product on the Lender side for which the payment is being done. This field is just echoed back in the response so that Lender can differentiate on their side. Fits well for impulse purchase usecases. |
status | String | Status of the order. If you receive “NEW”, then the order has been successfully created (see Status Mapping table below). |
status_id | Integer | Status ID is a numeric id corresponding to the status value (see Status Mapping table below). |
amount | double | This is the amount that a customer will be charged in this transaction. Will accept double values with up to two decimal places. For example, 100.15 is valid input but 100.1532 is not valid. |
currency | String | ISO string of the currency. Use INR for Indian Rupee. Among other accepted values are EUR, USD, GBP. |
refunded | Boolean | True if the order has been completely refunded. Will be false for partial refunds or if the order doesn’t have any refunds. |
date_created | String | Date-time of mandate or order creation |
return_url | String | A fully qualified URL such as http://shop.merchant.com/ to which the customer will be redirected after payment completion. This URL shouldn’t contain any query parameters. This URL takes higher precedence over the common return URL configured in your account. settings. |
udf1 | String | udf1 to udf10 - User defined field which will be echoed back in the response from Juspay with a Max character limit of 255. |
udf2 | String | |
udf3 | String | |
udf4 | String | |
udf5 | String | |
udf6 | String | |
udf7 | String | |
udf8 | String | |
udf9 | String | |
udf10 | String | |
txn_id | String | Transaction ID |
txn_uuid | String | Transaction UUID |
gateway_id | Integer | Unique numeric identifier for your preferred gateway. (Refer to "Gateway Mapping" table.) |
bank_error_code | String | Bank Error Code |
bank_error_message | String | Bank Error Message |
payment_method_type | String | Must be either CARD, NB, WALLET, or UPI. Entered when creating the order or mandate |
payment_method | String | Entered when creating the order or mandate. Found in the given tables for the corresponding API and transaction type. |
auth_type | String | Type of authentication used |
Status Mapping - Order status codes and meaning(click to open table)
Order Status | ID | Meaning |
---|---|---|
CREATED | 1 | Returned when order is successfully created. |
NEW | 10 | Newly created order. |
PENDING_VBV | 23 | Authentication is in progress. The customer has to approve the mandate through the PSP App of their choice. |
CHARGED | 21 | Successful transaction. The subscription cost of the period has been charged. |
AUTHENTICATION_FAILED | 26 | User did not complete authentication. |
AUTHORIZATION_FAILED | 27 | User completed authentication, but the bank refused the transaction. |
JUSPAY_DECLINED | 22 | User input is not accepted by the underlying PG. |
AUTHORIZING | 28 | Transaction status is pending from bank. |
Example
{
"udf9": "",
"udf8": "",
"udf7": "",
"udf6": "",
"udf5": "",
"udf4": "",
"udf3": "",
"udf2": "",
"udf10": "",
"udf1": "",
"txn_uuid": "eulvW58PbNNojAJXR7B",
"txn_id": ":txn_uuid",
"status_id": 32,
"status": "VOID_INITIATED",
"return_url": "https://api.juspay.in",
"refunded": false,
"product_id": "",
"payment_method_type": "CARD",
"payment_method": "MASTERCARD",
"payment_links": {
"web": "https://api.juspay.in/merchant/pay/ord_be69837b0a4b4fe486967e1ce1cd0477",
"mobile": "https://api.juspay.in/merchant/pay/ord_be69837b0a4b4fe486967e1ce1cd0477?mobile=true",
"iframe": "https://api.juspay.in/merchant/ipay/ord_be69837b0a4b4fe486967e1ce1cd0477"
},
"payment_gateway_response": {
"txn_id": "8342jhd9",
"rrn": "",
"resp_message": "Void is Pending",
"resp_code": "PENDING",
"epg_txn_id": "14327074",
"created": "2019-03-01T08:38:44Z",
"auth_id_code": "NA"
},
"order_id": "183782",
"merchant_id": "merchant_id",
"id": "ord_be69837b0a4b4fe486967e1ce1cd0477",
"gateway_id": 70,
"date_created": "2019-03-01T08:37:10Z",
"customer_phone": null,
"customer_id": "FUR14920977945",
"customer_email": null,
"currency": "INR",
"card": {
"using_saved_card": true,
"saved_to_locker": false,
"name_on_card": "test",
"last_four_digits": "",
"expiry_year": "2022",
"expiry_month": "07",
"card_type": "DEBIT",
"card_reference": "aa301450fe38c65cd813a8c33897942b",
"card_issuer": "HDFC Bank",
"card_isin": "541919",
"card_fingerprint": "6rds4re1p3678ftk333q64gs1g",
"card_brand": "MASTERCARD"
},
"bank_error_message": "Void is Pending",
"bank_error_code": "PENDING",
"auth_type": "THREE_DS",
"amount_refunded": 0,
"amount": 10,
"refunds":[ ]
}
{
"status": "Bad Request",
"error_message": "Invalid state for void operation.",
"error_code": "Invalid"
}
{
"status": "error",
"error_code": "access_denied"
}
Updated 11 months ago