Payment Status

Payment Status Endpoint:

This endpoint is useful for initiating payments with a custom UPI Intent and redirecting customers after they complete the payment.

POST /v1/payments/checkPaymentStatus

Code Example: Axios POST Request

Below is an example of how to use Axios to check payment status:

await axios.post(
  "https://api.upitranzact.com/v1/payments/checkPaymentStatus",
  {
    mid: "Your Merchant ID", // Example: ABC
    order_id: "Your order ID", // Example: bd79da4cc3ff1
  },
  {
    headers: {
      Authorization: "Basic base64(public_key:secret_key)"
    }
  }
);

Key Points

  • mid: Your merchant identifier.

  • order_id: A unique string for transaction tracking.

  • Authorization: Basic base64(public_key:secret_key).

Ensure all placeholders (e.g., "Your Merchant ID") are replaced with actual values before executing

Request Body Parameters:

POST /v1/payments/checkPaymentStatus

Headers

Name
Value

Content-Type

application/x-www-form-urlencoded

Authorization

Basic Auth

Body

Name
Type
Description
Example Value
Required

mid

string

Merchant ID assigned to you by UPITranzact.

ABC

Yes

order_id

string

A unique identifier for the order.

bd79da4cccff1

Yes

Authorization:

The request must include an Authorization header with a Base64 encoded string containing your public_key and secret_key in the format public_key:secret_key. Here's an example of how to generate the Authorization header:

Example:

Authorization: "Basic base64(public_key:secret_key)"

For example, if your public_key is your_public_key and your secret_key is your_secret_key, you would encode this into Base64 and use it as the Authorization header.

Example Authorization Header (Base64 encoded):

Authorization: "Basic eW91cl9wdWJsaWNfa2V5OnlvdXJfc2VjcmV0X2tleQ=="

Response

{
    "status": true,
    "statusCode": 200,
    "msg": "Transaction is successful",
    "data": {
        "amount": 1,
        "UTR": "502002472504",
        "order_id": "utz_xxxxxxx"
    }
}

Error Codes:

  • 400: Bad Request - Missing required parameters or invalid data.

  • 401: Unauthorized - Invalid or missing Authorization Basic Auth.

  • 404: Not Found - An issue occurred on the server side.

  • 409: Conflict - The request could not be processed due to a conflict with the current state of the resource.

  • 500: Internal Server Error - An issue occurred on the server side.

Last updated