---
page_source: https://juspay.io/br/docs/api-reference-brazil/docs/express-checkout/pix
page_title: PIX
---

## API Version: default


# PIX



PIX is a real-time payment system created by Brazil’s Central Bank. Merchants can integrate PIX with Juspay by displaying QR codes for customers to scan and complete payments instantly. By default, PIX payments are valid for 30 minutes, although this may vary depending on the payment gateway, with the shortest duration being used.## Endpoints:
- Sandbox:  https://api.sandbox.juspay.io/txns

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

## Request Type: 
POST

## 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> Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==</p>
- Tags: Base64 Encoded username:password, required
## Headers:

#### x-merchantid:
Merchant ID provided by Juspay
- Value: <p>Example:- <br>merchant-id</p>
- Tags: string, required

#### version:
Pass the date in YYYY-MM-DD format
- Value: <p>Example:- <br>2023-01-01</p>
- Tags: string

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

#### Order + Txns API - Pix Code Snippet:

```order + txns api - pix
curl --location 'https://api.juspay.io/txns' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic R*********RTV***g==' \
--data-urlencode 'order_id=1728385008' \
--data-urlencode 'merchant_id=azhar_test' \
--data-urlencode 'payment_method_type=RTP' \
--data-urlencode 'redirect_after_payment=true' \
--data-urlencode 'format=json' \
--data-urlencode 'payment_method=PIX_QR' \
--data-urlencode 'sdk_params=true' \
--data-urlencode 'identity_credentials={"cpf":"5****509"}'
```

### Sample Response:

#### Response:
```plaintext
{
    "order_id": "1728899031",
    "payment": {
        "authentication": {
            "method": "GET",
            "url": "https://sandbox.juspay.io/v2/pay/start/test/mozsRnRYPs4ApqgYBmr?cardIssuerBankName%3DPIX_QR%26cardType%3DRTP%26paymentMethod%3DPIX_QR%26paymentMethodType%3DRTP"
        },
        "sdk_params": {
            "contents": {
                "name": "generate-qr-code",
                "qrString": "000201******014BR.GOV.BCB.PIX2569spi-h.itau.com.br/pix/qr/v2/af581bdc-624e-4333-af38-1adaddfa6ce05204000053039865802BR5914PMD BASHAR RIO6009SAO PAULO62070503***6304E7DB"
            },
            "tag": "RTP_PARAM"
        }
    },
    "status": "PENDING_VBV",
    "txn_id": "test-1728899031-1",
    "txn_uuid": "mozsRnRYPs4ApqgYBmr"
}
```

## Body Parameters:
### Basic Parameters:

#### order_id:
- Description: Unique Identifier for the order. Should be Alphanumeric with character length less than 21.
- Value: <p>Example:- <br> order-id-9876580 </p>
- Tags: string, required

#### amount:
- Description: Amount that the customer has to pay. Will accept stringified double or integer values with upto two decimal places. For example, "100.15" and "100" are valid input but "100.1532" is not valid.
- Value: <p>Example:- <br> 1.00 </p>
- Tags: Double, required

#### options.get_client_auth_token:
- Description: Client side authenticaion token required for Hyper SDK calls
- Value: Value : true
- Tags: string

#### customer_id:
- Description: It is the ID with which merchant refers to a customer object. This id is used to access the stored payment methods, allow EMI transactions and setup subscriptions. In case of guest login it should be an empty string.
- Value: <p>Example:- <br> customer-id-007 </p>
- Tags: string

#### customer_email:
- Description: Email address of the customer. If the backend gateway requires it, then you must send this value.
- Value: <p>Example:- <br> test@gmail.com</p>
- Tags: string

#### customer_phone:
- Description: Mobile number or fixed line number of the customer. If the backend gateway requires it, then you must send this value.
- Value: <p>Example:- <br> 99999999</p>
- Tags: string

#### currency:
- Description: ISO string of the currency. Use BRL for Brazilian Real. Among other accepted values are EUR, USD, GBP, SGD, IDR etc. Default value: INR
- Tags: string

#### description:
- Description: Short description for the order. We send this information to the backend gateways whenever there is a provision for this.
- Tags: string

#### return_url:
- Description: A fully qualified URL which the customer will be redirected after payment completion. It is also required to provide the control back to SDK after the completion of transaction. This URL shouldn't contain any query parameters or Ip address. This URL takes higher precedence over the common return URL configured in your account settings.
- Value: <p>Example:- <br> https://shop.merchant.com </p>
- Tags: string

#### product_id:
- Description: An identifier for the product. Fits well for impulse purchase usecases.
- Value: <p>Example:- <br> John </p>
- Tags: string

#### gateway_id:
- Description: Specify your preferred gateway for this order.
- Value: <p>Example:- <br> Wick </p>
- Tags: string

#### merchant_id:
- Tags: String, Mandatory

#### payment_method_type:
- Description: This will be **RTP**  for PIX payments
- Tags: String, Mandatory

#### redirect_after_payment:
- Tags: String, Mandatory

#### payment_method:
- Description: The value for this field will be **PIX_QR** for PIX payments
- Tags: String, Mandatory

#### format:
- Tags: String, Mandatory

#### identity_credentials:
- Description: This field should be used to pass cpf or cnpj values in the json format.
- Value:
  - **Cpf**:
    - Description: Brazilian identity number without punctuation
    - Tags: String, Conditional
  - **Cnpj**:
    - Description: Brazilian identity number for companies without punctuation
    - Tags: String, Conditional
  - **Pix_key**:
    - Description: Nickname that identifies a user's transactional account in Brazil
    - Tags: String, Conditional
- Tags: Object, Mandatory

#### sdk_params:
- Description: This value should be passed if you are not doing SDK integration.
- Tags: Bool, Mandatory
## API Responses:
### 200:

#### order_id:
- Tags: String, Required

#### payment:
- Value:
  - **Authentication**:
    - Value:
      - **Method**:
        - Tags: String, Required
      - **Url**:
        - Tags: String, Required
    - Tags: Object, Required
  - **Sdk_params**:
    - Value:
      - **Contents**:
        - Value:
          - **Name**:
            - Tags: String, Required
          - **QrString**:
            - Tags: String, Required
        - Tags: Object, Required
      - **Tag**:
        - Tags: String, Required
    - Tags: Object, Required
- Tags: Object, Required

#### status:
- Tags: String, Required, Required

#### txn_id:
- Tags: String, Required, Required

#### txn_uuid:
- Tags: String
### 400:

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

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

#### error_message:
- Description: Further Details of keys missing
- Tags: string
