---
page_title: Real-Time Payments (RTP)
product: EC API Global
page_source: https://juspay.io/sea/docs/ec-api-global/docs/order--payment-api-integration/realtime-payments-rtp
openapi: https://juspay.io/sea/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fsea%2Fdocs%2Fec-api-global%2Fdocs%2Forder--payment-api-integration%2Frealtime-payments-rtp
llms_txt: https://juspay.io/sea/docs/llms.txt
product_llms_txt: https://juspay.io/sea/docs/ec-api-global/llms.txt
---

## API Version: default


# Real Time Payments



Create a payment transaction for Real-Time Payments (RTP). Merchants can integrate RTP with Juspay to display QR codes, enabling customers to scan and complete payments instantly. The API response includes a `QRString` and an `authentication URL`, allowing merchants to display the QR code to users based on your specific use case.

**Handling QRString** `qrstring` from the response can be directly retrieved and embedded into your application for display.

**Handling Authentication URL**     If you prefer not to manage the QRString, the URL provided in the response can be loaded directly in a browser, where Juspay will handle the QR code display for the user.

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/ec-api-global/Screenshot%202025-01-23%20at%2010.34.54%E2%80%AFAM.png)
*QRCode display using Authentication URL*



> **Note**
> * The default timer value is set to 10 minutes and is configurable. If you need to adjust the timer value, please contact the Juspay team for assistance.
> * Logo update on the timer screen is feasible and can be easily managed through the Juspay Dashboard:
>   
>   1. Log in to the Juspay Dashboard.
>   2. Navigate to "_Payments_ " → "_Settings_ " → "_General_ "
>   3. Update the logo under the _"Your Company Logo"_  section.




### Supported Payment Methods:




| payment_method | RTP |
|---|---|
| PAYNOW | PayNow |
| DUITNOW | Duitnow |
| PROMPTPAY | PromptPay |
| FPS_QR | FPS QR |
## Endpoints:
- Sandbox: https://sandbox.juspay.in/txns

- Production: https://api.juspay.in/txns

## Request Type: 
POST

## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Mandatory

#### 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

#### version:
Pass the date in YYYY-MM-DD format.**Note:**  If a version is provided, the response will include data corresponding to that specific version date.

It is recommended not to enforce strict validation on the entire response on the merchant's side to allow for future key additions.
- Tags: String, Optional
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location 'https://api.juspay.in/txns' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic xxx==xxx345' \
--header 'x-merchantid: your_merchant_id' \
--data-urlencode 'order_id=:order_id' \
--data-urlencode 'merchant_id=:merchant_id' \
--data-urlencode 'payment_method_type=RTP' \
--data-urlencode 'payment_method=PROMPTPAY_QR' \
--data-urlencode 'redirect_after_payment=true' \
--data-urlencode 'format=json' \
--data-urlencode 'sdk_params=true'
```

### Sample Response:

#### 200 - Success:
```json
{
    "payment": {
        "sdk_params": {
            "tag": "RTP_PARAM",
            "contents": {
                "qrString": "00020101021230630016A0000006770101120115000000000000000020810710488030811242113520459995303764540510.005802TH59182C2P Test merchant6007Bangkok6250010810710488050810710488070110817Order Description6304DE0C",
                "name": "generate-qr-code"
            }
        },
        "authentication": {
            "method": "GET",
            "url": "https://sandbox.juspay.in/v2/pay/start/Merchant/moz6AJ9WsrT7uXjAZrY?cardIssuerBankName%3DPROMPTPAY_QR%26cardType%3DRTP%26paymentMethod%3DPROMPTPAY_QR%26paymentMethodType%3DRTP"
        }
    },
    "status": "PENDING_VBV",
    "txn_uuid": "moz6AJ9WsrT7uXjAZrY",
    "offer_details": {
        "offers": []
    },
    "order_id": "Test1737617064",
    "txn_id": "Merchant-Test1737617064-1"
}
```

#### 400 - Bad Request:
```plaintext
{
    "user_message": "Invalid merchant id. Cannot process your request.",
    "error_message": "Invalid Request",
    "error": true,
    "error_info": {
        "user_message": "Please pass valid merchant_id in request.",
        "fields": [
            {
                "field_name": "merchant_id",
                "reason": "Invalid merchant_id."
            }
        ],
        "developer_message": "merchant_id is invalid.",
        "code": "RESOURCE_NOT_FOUND",
        "category": "USER_ERROR"
    }
}
```

## Body Parameters:
### Parameters:

#### order_id:
- Description: order_id pertaining to the order for which the payment is started.
- Tags: string, Mandatory

#### payment_method_type:
- Description: Must be RTP
- Tags: string, Mandatory

#### payment_method:
- Description: The actual RTP payment method that was selected by the user. _payment_method_  value can be obtained from [Payment Methods API](https://juspay.io/sea/docs/ec-api-global/docs/order--payment-api-integration/payment-methods-api)
- Tags: string, Mandatory

#### redirect_after_payment:
- Description: This is a boolean variable and accepts true/false. We recommend that you set this to true and use the redirection flow. If set to true, then the user is redirected to the return_url configured for the order. If set to false, then the user will be stopped at the response page from the gateway. Your client should be able to read the page/title to infer that the user has completed the transaction.
- Tags: string, Mandatory

#### format:
- Description: it is set to json, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 200 with the HTML response where user will be redirected to QR code page within 3 secs.
- Tags: Json, Mandatory

#### sdk_params:
- Description: It accepts a Boolean value. - Set `sdk_params` to true to retrieve both `qrString` and `url.`- Set `sdk_params` to false to retrieve only authentication `url` in the response.
- Tags: Boolean
## API Responses:
### 200:

#### order_id:
- Description: Unique Identifier for the order which is passed in the api request
- Tags: string

#### txn_id:
- Description: Transaction ID for the order. 
- Tags: string

#### status:
- Description: Refers to status of the order
- Tags: string

#### payment:
- Value:
  - **Authentication.method**:
    - Description: It provides the details about the type of authentication method. It can be either GET or POST
    - Tags: String
  - **Authentication.url**:
    - Description: User can be directed to the targeted payment method page by loading the URL in the browser
    - Tags: string
  - **Sdk_params.tag**:
    - Description: Refers to the category of `sdk_params` fields
    - Tags: String, Mandatory
  - **Sdk_params.qrString**:
    - Description: Qrcode String generated for the input RTP method which can be direct used in your application
    - Tags: String, Mandatory
- Tags: object

#### txn_uuid:
- Description: The unique id generated by Juspay for a particular transaction. Can be used as an identifier in case of RTP transaction
- Tags: String, Mandatory
### 400:

#### error_message:
- Description: Provides the reason for the error
- Value: Response: Bad request.
- Tags: String

#### status:
- Description: Error status
- Value: Response:ERROR
- Tags: String

#### error_code:
- Description: Specifies the Error code 
- Value: Sample Response:Bad request.
- Tags: String

#### error_info:
- Description: Additional information on the error message
- Value:
  - **User_message**:
    - Description: Error message can be displayed to the user
    - Value: Sample Response:Bad request.
    - Tags: String
  - **Fields**:
    - Description: Details on the missing field with which the error occurred
    - Tags: Array
  - **Developer_message**:
    - Description: Detailed info on the error
    - Value: Sample Response:Failed while parsing your request.
    - Tags: String
  - **Category**:
    - Description: category of the error
    - Value: Sample Response:USER_ERROR
    - Tags: String
- Tags: JSON



## Error Codes:




| Scenario | Error Codes | Sample Error Message |
|---|---|---|
| Not passing order id | 400 | {"error_message":"[order id] cannot be null","status":"invalid_request_error","error_code":"blank","error_info": {"user_message":"Cannot process your request. Please contact support team for assistance.","fields": [{"field_name":"order_id","reason":"Missing field."}],"developer_message":"Missing order id. Please pass order_id or order payload.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}} |
| Not passing merchant_id | 400 | {"error_message":"Bad request.","status":"ERROR","error_code":"Bad request.","error_info": {"user_message":"Bad request.","fields": [{"field_name":"merchant_id","reason":"Field required but not passed."}],"developer_message":"Failed while parsing your request.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}} |
| Passing merchant_id as Empty | 400 | {"user_message":"Invalid merchant id. Cannot process your request.","error_message":"Invalid Request","error": true,"error_info": {"user_message":"Please pass valid merchant_id in request.","fields": [{"field_name":"merchant_id","reason":"Invalid merchant_id."}],"developer_message":"merchant_id is invalid.","code":"RESOURCE_NOT_FOUND","category":"USER_ERROR"}} |
| Passing invalid Merchant ID | 400 | {"user_message":"Invalid merchant id. Cannot process your request.","error_message":"Invalid Request","error": true,"error_info": {"user_message":"Please pass valid merchant_id in request.","fields": [{"field_name":"merchant_id","reason":"Invalid merchant_id."}],"developer_message":"merchant_id is invalid.","code":"RESOURCE_NOT_FOUND","category":"USER_ERROR"}} |
| Passing wrong endpoint | 404 | Response will be empty |
| Not passing gateway reference id but gateway configured with gateway reference ID on Juspay dashboard | 400 | {"error_message":"Can't find a suitable gateway to process the transaction","status":"Bad Request","error_code":"invalid_request_error","error_info":{"user_message":"Gateway not found to process the transaction request.","developer_message":"No functional gateways after filtering for currency THB","code":"GATEWAY_NOT_FOUND","category":"CONFIG_ERROR"}} |
| Not passing payment method | 400 | {"error_message":"Payment method type cannot be null","status":"invalid_request_error","error_code":"missing_payment_method_type","error_info":{"user_message":"Please pass payment method type in the request.","fields":[{"field_name":"payment_method_type","reason":"Missing field."}],"developer_message":"Missing payment method type in the request. Payment method type is a mandatory parametere.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}} |
| Not passing payment method type | 400 | {"error_message":"Payment method cannot be null","status":"invalid_request_error","error_code":"missing_payment_method","error_info":{"user_message":"Cannot process your request. Please contact support team for assistance.","fields":[{"field_name":"payment_method","reason":"Missing field."}],"developer_message":"Missing payment method. Payment method is required for provided payment method type.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}} |


---

## See Also

- [Wallet Redirection](https://juspay.io/sea/docs/ec-api-global/docs/order--payment-api-integration/wallet-redirection)
- [Overview](https://juspay.io/sea/docs/ec-api-global/docs/order--payment-api-integration/overview)
