Payment Link

Payment Link Endpoint:

This endpoint is useful for initiating payments with a custom payment link and share with customers to collect payments from them.

POST /v1/payments/createPaymentLink

Code Example: Axios POST Request

Below is an example of how to use Axios to create a payment link:

await axios.post(
  "https://api.upitranzact.com/v1/payments/createPaymentLink",
  {
    mid: "Your Merchant ID", // Example: ABC
    amount: "Numeric value between 1-100000",
    note: "Rent from customer", // Payment remark
    customer_name: "John",
    customer_email: "john@example.com",
    customer_mobile: "Your Customer Mobile", // Correct value needed
  },
  {
    headers: {
      Authorization: "Basic base64(public_key:secret_key)"
    }
  }
);

Key Points

  • mid: Your merchant identifier.

  • amount: Must be a numeric value between 1 and 100000.

  • note: A payment remark.

  • customer_name: Ensure this contains a name.

  • customer_email: Ensure this contains a valid email address.

  • customer_mobile: Ensure this contains a valid phone number instead of a name.

  • 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/createPaymentLink

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

amount

integer

The total amount.

200

Yes

note

string

A remark for the payment.

Add Money

Yes

customer_name

string

The name of the customer making for the payment.

John

Yes

customer_email

string

The email address of the payment.

john@example.com

Yes

customer_mobile

string

The mobile number of the customer.

0123456789

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": "Payment link created successfully",
    "data": {
        "paymentId": "XXXXXXXX",
        "payment_url": "https://upitz.me/XXXXXXXX"
    }
}

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.

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

Last updated