Create Order

The Create Order API allows merchants to initiate a payment order with customer and payment details. It returns a unique order ID and a payment_url that redirects the customer for payment completion.


Endpoint

POST /v1/payments/createOrderRequest

This endpoint is used to:

  • Generate a unique order for a payment
  • Optionally pass a custom order ID
  • Redirect the customer to a success URL after payment

Headers

NameValue
Content-Typeapplication/x-www-form-urlencoded
AuthorizationBasic base64(public_key:secret_key)

Request Body Parameters

NameTypeRequiredDescriptionExample
midstringYesMerchant ID assigned by UPITranzactABC
amountintegerYesPayment amount (between 1 - 100000)200
order_idstringNoCustom unique order IDbd79da4cccff1
redirect_urlstringYesURL to redirect the customer after successful paymenthttps://example.com/success
notestringYesPayment remarkAdd Money
customer_namestringYesFull name of the customerJohn
customer_emailstringYesValid email address of the customer[email protected]
customer_mobilestringYesValid 10-digit mobile number0123456789

Code Example

await axios.post(
  "https://api.upitranzact.com/v1/payments/createOrderRequest",
  {
    mid: "Your Merchant ID", // Example: ABC
    amount: "200",
    order_id: "bd79da4cc3ff1", // Optional
    redirect_url: "https://example.com/success",
    note: "Add money",
    customer_name: "John",
    customer_email: "[email protected]",
    customer_mobile: "0123456789",
  },
  {
    headers: {
      Authorization: "Basic eW91cl9wdWJsaWNfa2V5OnlvdXJfc2VjcmV0X2tleQ==",
    },
  }
);

Success Response

{
  "status": true,
  "statusCode": 200,
  "msg": "Order request created successfully",
  "data": {
    "orderId": "utz_ccxxzsdf",
    "payment_url": "https://upitz.com/checkout/payment/xxxxxxx..."
  }
}
{
    "status": false,
    "statusCode": 409,
    "msg": "Order ID already exists"
}