---
page_title: Transaction Order Status API
product: api-reference-global
page_source: https://docs.juspay.io/api-reference-global/docs/refunds-via-payouts/transaction-order-status-api
openapi: https://docs.juspay.io/api/swagger?document=https%3A%2F%2Fdocs.juspay.io%2Fapi-reference-global%2Fdocs%2Frefunds-via-payouts%2Ftransaction-order-status-api
llms_txt: https://docs.juspay.io/llms.txt
product_llms_txt: https://docs.juspay.io/api-reference-global/llms.txt
---

## API Version: default


# Transaction Order Status API



This is a Server-to-Server API that returns the status of the order along with other details in encrypted format.

* The Order Status API response includes two fields: `refund_supported` and `last_date_to_refund.`
* Based on the values of `refund_supported` and `last_date_to_refund,`refunds via source or refund via payout can be decided.
  
  * If `refund_supported` is **true**  and there is sufficient time remaining before the `last_date_to_refund`, **refunds via source**  can be initiated.
  * If `refund_supported` is **true**  but the `last_date_to_refund` has passed, **refunds via payout**  should be used.
  * If `refund_supported` is **false** , only **refunds via payout**  can be used.
* If Order Status API response does not include two fields`refund_supported` and `last_date_to_refund,`**refunds via source**  can be initiated directly.## Endpoints:
- Sandbox: https://{domain}/orders/{order_id}

- Production: https://{domain}/orders/{order_id}

## Request Type: 
GET

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string
- Value: <p>Example:- <br> MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg== </p> 
- Tags: Base64 Encoded username:password, required
## Headers:

#### x-merchantid:
Unique identifier for the merchant. This is the Merchant ID provided by Juspay. The value is case sensitive.

> **Note**
> Passing this value will help us route efficiently at network level.


- Value:  x-merchantid: testaccount
- Tags: string, Recommended

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location --request GET 'https://{host}/orders/JP1636474794' \
--header 'version: 2023-06-30' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic OTc5Mzcx*****czRTlGOg=='\
--header 'x-merchantid: your_merchant_id' 

```

### Sample Response:

#### 200 Response:
```plaintext
{
    "customer_email": "gopal@juspay.in",
    "customer_phone": "9999999999",
    "customer_id": "cth_t3pvc14xdvNGMkZo",
    "status_id": 21,
    "status": "CHARGED",
    "id": "ordeh_cd7ef46ae66e47e0bfc92bc1c59fbfe3",
    "merchant_id": "Merchant",
    "amount": 100,
    "currency": "USD",
    "order_id": "1732714726801",
    "date_created": "2024-11-27T13:38:48Z",
    "last_updated": "2024-11-27T13:39:11Z",
    "return_url": "https://google.co.in",
    "product_id": "123",
    "payment_links": {
        "mobile": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_cd7ef46ae66e47e0bfc92bc1c59fbfe3",
        "web": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_cd7ef46ae66e47e0bfc92bc1c59fbfe3",
        "iframe": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_cd7ef46ae66e47e0bfc92bc1c59fbfe3"
    },
    "udf1": "",
    "udf2": "",
    "udf3": "",
    "udf4": "",
    "udf5": "",
    "udf6": "",
    "udf7": "",
    "udf8": "",
    "udf9": "",
    "udf10": "",
    "txn_id": "Merchant-1732714726801-1",
    "payment_method_type": "WALLET",
    "auth_type": "",
    "payment_method": "APPLEPAY",
    "refunded": false,
    "amount_refunded": 0,
    "effective_amount": 100,
    "resp_code": null,
    "resp_message": null,
    "bank_error_code": "",
    "bank_error_message": "",
    "txn_uuid": "moozaTdV8Da8YdAQoJGx",
    "payment_gateway_response": {
        "resp_code": "succeeded",
        "rrn": "pii_3QPlSSE211S0rMAL1aoLhMVl",
        "created": "2024-11-27T13:39:11Z",
        "epg_txn_id": "pii_3QPlSSE211S0rMAL1aoLhMVl",
        "resp_message": null,
        "auth_id_code": "NA",
        "txn_id": "Merchant-1732714726801-1",
        "network_error_message": null,
        "network_error_code": null,
        "arn": "",
        "gateway_merchant_id": null,
        "eci": null,
        "auth_ref_num": null
    },
    "gateway_id": 50,
    "emi_details": {
        "bank": null,
        "monthly_payment": null,
        "interest": null,
        "principal_amount": null,
        "additional_processing_fee_info": null,
        "tenure": null,
        "subvention_info": [],
        "emi_type": null,
        "processed_by": null
    },
    "offers": [],
    "wallet": {
        "txn_flow_type": "REDIRECT_DEBIT"
    },
    "maximum_eligible_refund_amount": 100,
    "order_expiry": "2024-11-27T14:08:48Z",
    "resp_category": null,
    "refund_supported": true,
    "last_date_to_refund": "2024-12-09T13:38:55Z"
}
```

#### 404 Not Found:
```plaintext
{
    "error": true,
    "error_message": "order not found",
    "user_message": "Bad Request",
    "userMessage": "Bad Request",
    "error_info": {
        "code": "INVALID_INPUT",
        "category": "USER_ERROR",
        "href": "NA",
        "request_id": "fd192db9-dae1-4d05-b021-2d9b58fd99bb",
        "user_message": "Cannot process your request as order not found.",
        "developer_message": "Order not found. Please verify your request."
    }
}
```

#### 400 - Invalid Request:
```plaintext
{
    "error": true,
    "error_message": "Invalid request",
    "user_message": "Bad Request",
    "userMessage": "Bad Request",
    "error_info": {
        "code": "INVALID_INPUT",
        "category": "USER_ERROR",
        "href": "NA",
        "request_id": "18525cbd-7085-4584-a569-43f9eea1f211",
        "user_message": "Cannot process your request as order id is missing.",
        "developer_message": "Cannot process your request as order id is missing in query params."
    }
}
```

## Query Parameters:

#### order_id:
An identifier for the order to enquire on the status details
- Tags: String, Mandatory
## API Responses:
### 200:

#### id:
- Description: Unique ID generated by JusPay for the given order
- Tags: string

#### order_id:
- Description: OrderId provided in the request
- Tags: string

#### status:
- Description: Status of the order. For information on different order status and handling, refer [here](https://docs.juspay.in/resources/docs/common-resources/transaction-status)
- Tags: string

#### status_id:
- Description: Status ID is a numeric id corresponding to the status value
- Tags: Integer

#### amount:
- Description: The order amount
- Tags: Double

#### date_created:
- Description: Order creation timestamp in UTC

**Example** : 2021-11-09T16:19:55Z
- Tags: string

#### customer_email:
- Description: The email Id of the customer provided during order creation
- Tags: string

#### customer_phone:
- Description: The phone number of the customer provided during order creation
- Tags: string

#### customer_id:
- Description: The customer id provided during order creation
- Tags: string

#### merchant_id:
- Description: The merchant id provided by Juspay
- Tags: string

#### currency:
- Description: The currency provided during order creation. 

**Default:**  INR
- Tags: string

#### return_url:
- Description: The return url provided during order creation
- Tags: string

#### product_id:
- Description: The product_id provided during order creation
- Tags: string

#### udf1-udf10:
- Description: The user defined fields passed during order creation. Empty in case not passed
- Tags: string

#### txn_id:
- Description: Transaction ID for the payment attempt. Can be used as an identifier at PG end and will be present in reconciliation report.
- Tags: string

#### payment_method_type:
- Description: The payment method type used for transaction. Possible values are CARD, NB, WALLET, UPI, CONSUMER_FINANCE
- Tags: string

#### payment_method:
- Description: The payment method used for the transaction
- Tags: string

#### auth_type:
- Description: Possible values `THREE_DS`, `OTP`, `VIES`
- Tags: string

#### refunded:
- Description: **true**  if the order has been completely refunded

**false**  for partial refunds or if the order doesn't have any refunds
- Tags: Boolean

#### amount_refunded:
- Description: Amount which has been refunded so far for the given order
- Tags: Double

#### refunds:
- Description: The refund block with the details of refund initiated for the given order.
- Value:
  - **Unique_request_id**:
    - Description: The unique request id provided during refund initiation
    - Tags: String
  - **Status**:
    - Description: The status of the refund initiated. Initial status will always be PENDING
    - Tags: String
  - **Sent_to_gateway**:
    - Description: The flag denotes if the refund was initiated to gateway. The initial status is always false, as refunds are queued at juspay for a period of 15 minutes
    - Tags: Boolean
  - **Refund_type**:
    - Description: The type of refund. Values can be STANDARD, INSTANT
    - Tags: String
  - **Refund_source**:
    - Description: The name of gateway from which amount is refunded
    - Tags: String
  - **Ref**:
    - Description: The refund id provided by the PG
    - Tags: String
  - **Initiated_by**:
    - Description: The source of initiation
    - Tags: String
  - **Id**:
    - Description: The reference id provided by PG, if not available then its mapped to unique request id.
    - Tags: String
  - **Amount**:
    - Description: The refund amount passed in the request
    - Tags: Double
  - **Created**:
    - Description: The timestamp of refund creation
    - Tags: String
  - **Refund_supported**:
    - Description: Field which indicates whether refund by the payment processor is supported to refund the order amount to the transaction amount sourceIf this field is not present in the oder status response, refund via source is supported
    - Tags: Boolean
  - **Last_date_to_refund**:
    - Description: Field which indicates the final date to initaite the refund via souce
    - Tags: String
- Tags: Array of Objects

#### txn_uuid:
- Description: The unique id generated by Juspay for a particular transaction. Can be used as an identifier in case of UPI transaction
- Tags: string

#### txn_detail:
- Description: The json object with the details of the transaction
- Tags: JSON

#### payment_gateway_response:
- Description: The json object with the details receive from PG
- Value:
  - **Payment_gateway_response.resp_code**:
    - Description: The response code provided by the gateway
    - Tags: string
  - **Payment_gateway_response.rrn**:
    - Description: The bank reference number provided by the gateway
    - Tags: string
  - **Payment_gateway_response.created**:
    - Description: The transaction creation timestamp
    - Tags: string
  - **Payment_gateway_response.epg_txn_id**:
    - Description: Transaction Id from the underlying gateway
    - Tags: string
  - **Payment_gateway_response.auth_id_code**:
    - Description: Auth code provided by the gateway for the transaction.
    - Tags: string
  - **Payment_gateway_response.txn_id**:
    - Description: Transaction Id for the payment attempt
    - Tags: string
  - **Payment_gateway_response.resp_message**:
    - Description: The response message provided by the gateway
    - Tags: string
  - **Payment_gateway_response.offer_type**:
    - Description: The type of offer applied provided by the gateway( available only if offers are applied)
    - Tags: string
  - **Payment_gateway_response.offer_availed**:
    - Description: true if the offer is applied at the payment gateway. Else it will be false ( available only if offers are applied)
    - Tags: Boolean
  - **Payment_gateway_response.discount_amount**:
    - Description: The discount amount provided by the gateway for the availed offer ( available only if offers are applied)
    - Tags: Double
- Tags: JSON

#### gateway_id:
- Description: Gateway Id of the gateway used for performing this transactions
- Tags: Integer

#### gateway_reference_id:
- Description: The gateway reference id used for the transaction
- Tags: Integer

#### card:
- Description: The json containing the details of the card used for the transaction
- Value:
  - **Card.expiry_year**:
    - Description: The expiry year of the card used for the transaction
    - Tags: string
  - **Card.card_reference**:
    - Description: A reference identifier for the card.
    - Tags: string
  - **Card.expiry_month**:
    - Description: The expiry month of the card used for the transaction
    - Tags: string
  - **Card.saved_to_locker**:
    - Description: true if card was saved to locker, else false
    - Tags: Boolean
  - **Card.name_on_card**:
    - Description: The name on card used for the transaction
    - Tags: string
  - **Card.card_issuer**:
    - Description: Indicates the bank which issued the card
    - Tags: string
  - **Card.last_four_digits**:
    - Description: The last four digit of the card used
    - Tags: string
  - **Card.using_saved_card**:
    - Description: **true**  if transaction was done via a saved card
      
      **false**  if transaction via new card/unsaved card
    - Tags: Boolean
  - **Card.card_fingerprint**:
    - Description: The unique identifier for the card
    - Tags: string
  - **Card.card_isin**:
    - Description: The first six digit of the card used for the transaction
    - Tags: string
  - **Card.card_type**:
    - Description: Indicates if the card is either CREDIT or DEBIT
    - Tags: string
  - **Card.card_brand**:
    - Description: The provider of the card, can be VISA, RUPAY etc.
    - Tags: string
- Tags: JSON
### 400:

#### status:
- Description: Bad Request
- Tags: string

#### error_code:
- Description: INVALID_INPUT
- Value: <p>Example:- <br> Mandatory fields are missing </p>
- Tags: string

#### error_message:
- Description: Invalid Request
- Tags: string
### 401:

#### status:
- Description: error
- Tags: string

#### error_code:
- Description: access_denied
- Tags: string
### 404:

#### error_message:
- Description: order not found
- Tags: string

#### error_code:
- Description: INVALID_INPUT
- Tags: string
### 500:

#### status:
- Description: error
- Tags: string

#### error_code:
- Description: Internal server Error
- Tags: string



### API Latency Guideline




### **What is API Latency?** 



Time taken by the server to respond to the API request.


#### **Average API Percentile Metrics and Recommended Timeout** 



**TP50 (s):**  This means 50% of the requests have a latency less than or equal to this value. It represents the typical latency most users will experience.

**TP90 (s):** The latency at the 90th percentile. This indicates that 90% of the requests have a latency less than or equal to this value, with 10% experiencing higher latency.

**TP99 (s):**  The latency at the 99th percentile. This indicates that 99% of the requests have a latency less than or equal to this value, with 1% experiencing higher latency.

**TP99.9 (s):**  The latency at the 99.9th percentile. This is important for identifying edge cases, where 0.1% of the requests take significantly longer than the others.

**TP99.99 (s):**  The latency at the 99.99th percentile. This captures extremely rare cases, where just 0.01% of the requests take longer than this time. Monitoring this helps in identifying and addressing the rarest and most severe performance issues.


|  Transaction Percentile |  Latency (ms) |
|---|---|
|  TP50 (ms) | 0.0198 |
|  TP90 (ms) | 55.71 |
|  TP99 (ms) | 351.85 |
|  TP99.9 (ms) | 594.42 |
| Recommended Timeout | 1000 |


> **Warning**
> The recommended timeouts are based on TP99.9 data, though edge cases (0.01% of requests) may still exceed these limits and are captured in the TP99.99 data as shown below.
> 
> 
> |  Transaction Percentile |  Latency (ms) |
> |---|---|
> |  TP99.99 (ms) | 1431.42 |
> | Recommended Timeout | 2000 |
> 

