---
page_title: UPI Collect
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/express-checkout/upi-collect
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fexpress-checkout%2Fupi-collect
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# UPI Collect



Create a collect transaction for given UPI VPA. In UPI collect transaction, payment collect request is sent to the UPI app.

> **Note**
> Please use the relevant parameters received from the **Payment Method API in UPI** for **payment_method_type**  and **payment_method**  fields.

## 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-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Old UPI - Collect Request Code Snippet:

```old upi - collect request
curl -X POST https://api.juspay.in/txns \
-H 'x-routing-id: customer_1122'\
-d "order_id=:order_id" \
-d "merchant_id=:merchant_id" \
-d "payment_method_type=UPI" \
-d "payment_method=UPI" \
-d "txn_type=UPI_COLLECT" \
-d "upi_vpa=:vpa" \
-d "redirect_after_payment=true" \
-d "format=json"

```

#### New UPI - Collect Request Code Snippet:

```new upi - collect request
curl -X POST https://api.juspay.in/txns \
-H 'x-routing-id: customer_1122'\
-d "order_id=:order_id" \
-d "merchant_id=:merchant_id" \
-d "payment_method_type=UPI" \
-d "payment_method=UPI_COLLECT" \
-d "upi_vpa=:vpa" \
-d "redirect_after_payment=true" \
-d "format=json"

```

### Sample Response:

#### Response:
```json
{
  "order_id": ":order_id",
  "txn_id": ":txn_id",
  "status": "PENDING_VBV",
  "payment": {
    "authentication": {
      "method": "GET",
      "url": "https://api.juspay.in/pay/start/guest/8646a7a0xxxxxfa99995fec00340a507"
    }
  }
}
```

## Body Parameters:
### Parameters:

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

#### merchant_id:
- Description: ID of the merchant_account that you hold with us.
- Tags: string, Mandatory

#### payment_method_type:
- Description: Must be `UPI`
- Tags: string, Mandatory

#### payment_method:
- Description: Please use the relevant value received from the **Payment Method API in thepayment_method**  field.
- Tags: string, Mandatory

#### txn_type:
- Description: Must be `UPI_COLLECT`for Old UPI Collect Request. This field is obsolete for New UPI Collect Request
- Tags: string, Mandatory

#### upi_vpa:
- Description: VPA to which the collect request must be sent.
- Tags: string, Mandatory

#### format:
- Description: If it is set to json, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 302 with the Location attribute having the destination URL.
- 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
## API Responses:
### 200:

#### order_id:
- Description: test_9069_789
- Tags: string

#### txn_id:
- Description: aman_prod-test_9069_789-9
- Tags: string

#### txn_uuid:
- Description: dev8pyieixvdyldt
- Tags: string

#### status:
- Description: PENDING_VBV
- Tags: string

#### payment:
- Value:
  - **Authentication.method**:
    - Tags: string
  - **Authentication.url**:
    - Tags: String
- Tags: object
### 400:

#### object:
- Description: {}
- Tags: object


---

## See Also

- [EMI Plans V2](https://juspay.io/in/docs/api-reference/docs/express-checkout/emi-plans-v2)
- [Verify VPA](https://juspay.io/in/docs/api-reference/docs/express-checkout/verify-vpa)
