Skip to main content
POST
/
payment-link
/
generate
Generate Payment Link
curl --request POST \
  --url https://sandbox.omnispay.com/api/payment-link/generate \
  --header 'Content-Type: application/json' \
  --header 'Time-Zone: <time-zone>' \
  --header 'X-HMAC-Signature: <api-key>' \
  --header 'accountId: <api-key>' \
  --header 'apiKey: <api-key>' \
  --data '
{
  "FullName": "John Doe",
  "Email": "user@example.com",
  "Phone": "+971501234567",
  "invoiceAmount": 100.5,
  "notes": "Payment for order #12345",
  "isTermsAndConditionsAccepted": true,
  "Is_QR_needed": true,
  "Is_invoice_generated": true,
  "expiryOn": "2023-11-07T05:31:56Z",
  "Address": "123 Street, City, Country",
  "City": "Dubai",
  "Country": "UAE",
  "currency": "AED",
  "Invoice_Id": "INV123456",
  "Product_Id": "<string>",
  "callback_url": "https://example.com/callback"
}
'
import requests

url = "https://sandbox.omnispay.com/api/payment-link/generate"

payload = {
"FullName": "John Doe",
"Email": "user@example.com",
"Phone": "+971501234567",
"invoiceAmount": 100.5,
"notes": "Payment for order #12345",
"isTermsAndConditionsAccepted": True,
"Is_QR_needed": True,
"Is_invoice_generated": True,
"expiryOn": "2023-11-07T05:31:56Z",
"Address": "123 Street, City, Country",
"City": "Dubai",
"Country": "UAE",
"currency": "AED",
"Invoice_Id": "INV123456",
"Product_Id": "<string>",
"callback_url": "https://example.com/callback"
}
headers = {
"Time-Zone": "<time-zone>",
"apiKey": "<api-key>",
"X-HMAC-Signature": "<api-key>",
"accountId": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'Time-Zone': '<time-zone>',
apiKey: '<api-key>',
'X-HMAC-Signature': '<api-key>',
accountId: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
FullName: 'John Doe',
Email: 'user@example.com',
Phone: '+971501234567',
invoiceAmount: 100.5,
notes: 'Payment for order #12345',
isTermsAndConditionsAccepted: true,
Is_QR_needed: true,
Is_invoice_generated: true,
expiryOn: '2023-11-07T05:31:56Z',
Address: '123 Street, City, Country',
City: 'Dubai',
Country: 'UAE',
currency: 'AED',
Invoice_Id: 'INV123456',
Product_Id: '<string>',
callback_url: 'https://example.com/callback'
})
};

fetch('https://sandbox.omnispay.com/api/payment-link/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.omnispay.com/api/payment-link/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'FullName' => 'John Doe',
'Email' => 'user@example.com',
'Phone' => '+971501234567',
'invoiceAmount' => 100.5,
'notes' => 'Payment for order #12345',
'isTermsAndConditionsAccepted' => true,
'Is_QR_needed' => true,
'Is_invoice_generated' => true,
'expiryOn' => '2023-11-07T05:31:56Z',
'Address' => '123 Street, City, Country',
'City' => 'Dubai',
'Country' => 'UAE',
'currency' => 'AED',
'Invoice_Id' => 'INV123456',
'Product_Id' => '<string>',
'callback_url' => 'https://example.com/callback'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Time-Zone: <time-zone>",
"X-HMAC-Signature: <api-key>",
"accountId: <api-key>",
"apiKey: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://sandbox.omnispay.com/api/payment-link/generate"

payload := strings.NewReader("{\n \"FullName\": \"John Doe\",\n \"Email\": \"user@example.com\",\n \"Phone\": \"+971501234567\",\n \"invoiceAmount\": 100.5,\n \"notes\": \"Payment for order #12345\",\n \"isTermsAndConditionsAccepted\": true,\n \"Is_QR_needed\": true,\n \"Is_invoice_generated\": true,\n \"expiryOn\": \"2023-11-07T05:31:56Z\",\n \"Address\": \"123 Street, City, Country\",\n \"City\": \"Dubai\",\n \"Country\": \"UAE\",\n \"currency\": \"AED\",\n \"Invoice_Id\": \"INV123456\",\n \"Product_Id\": \"<string>\",\n \"callback_url\": \"https://example.com/callback\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Time-Zone", "<time-zone>")
req.Header.Add("apiKey", "<api-key>")
req.Header.Add("X-HMAC-Signature", "<api-key>")
req.Header.Add("accountId", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://sandbox.omnispay.com/api/payment-link/generate")
.header("Time-Zone", "<time-zone>")
.header("apiKey", "<api-key>")
.header("X-HMAC-Signature", "<api-key>")
.header("accountId", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"FullName\": \"John Doe\",\n \"Email\": \"user@example.com\",\n \"Phone\": \"+971501234567\",\n \"invoiceAmount\": 100.5,\n \"notes\": \"Payment for order #12345\",\n \"isTermsAndConditionsAccepted\": true,\n \"Is_QR_needed\": true,\n \"Is_invoice_generated\": true,\n \"expiryOn\": \"2023-11-07T05:31:56Z\",\n \"Address\": \"123 Street, City, Country\",\n \"City\": \"Dubai\",\n \"Country\": \"UAE\",\n \"currency\": \"AED\",\n \"Invoice_Id\": \"INV123456\",\n \"Product_Id\": \"<string>\",\n \"callback_url\": \"https://example.com/callback\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.omnispay.com/api/payment-link/generate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Time-Zone"] = '<time-zone>'
request["apiKey"] = '<api-key>'
request["X-HMAC-Signature"] = '<api-key>'
request["accountId"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"FullName\": \"John Doe\",\n \"Email\": \"user@example.com\",\n \"Phone\": \"+971501234567\",\n \"invoiceAmount\": 100.5,\n \"notes\": \"Payment for order #12345\",\n \"isTermsAndConditionsAccepted\": true,\n \"Is_QR_needed\": true,\n \"Is_invoice_generated\": true,\n \"expiryOn\": \"2023-11-07T05:31:56Z\",\n \"Address\": \"123 Street, City, Country\",\n \"City\": \"Dubai\",\n \"Country\": \"UAE\",\n \"currency\": \"AED\",\n \"Invoice_Id\": \"INV123456\",\n \"Product_Id\": \"<string>\",\n \"callback_url\": \"https://example.com/callback\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "<string>",
  "message": "<string>",
  "response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}
{
"status": "<string>",
"message": "<string>",
"response": {}
}

Generate Payment Link

This endpoint allows merchants to generate a payment link with customer-specific details such as name, amount, and notes.

Request Body

  • FullName (string, required): The full name of the customer. Must be between 2 to 50 characters and match the pattern [a-zA-Z./' ]+.
  • Email (string, required): The email address of the customer. Must be between 3 to 45 characters.
  • Phone (string, required): The phone number of the customer.
  • invoiceAmount (number, required): The amount for the payment, should be equal to or greater than 10.
  • notes (string, required): Any additional information or description for the payment.
  • isTermsAndConditionsAccepted (boolean, required): Whether the customer accepts the terms and conditions.
  • currency (string, optional): The currency for the payment, must be “AED”.
  • expiryOn (string, required): The expiry date of the payment link in yyyy-MM-dd HH:mm:ss format AND recommended expiry date should be 30 days from the payment link generation date.
  • Is_QR_needed (boolean, required): Whether a QR code is needed.
  • Is_invoice_generated (boolean, required): Whether an invoice is generated.
  • Address (string, optional): The address of the customer.
  • City (string, optional): The city of the customer.
  • Country (string, optional): The country of the customer.
  • Invoice_Id (string, optional): The unique ID of the invoice.
  • Product_Id (string, optional): The unique ID of the product.
  • callback_url (string, optional): The callback URL for payment updates.

Example Request

{
  "FullName": "John Doe",
  "Email": "john.doe@example.com",
  "Phone": "1234567890",
  "invoiceAmount": 50.00,
  "notes": "Payment for services rendered",
  "isTermsAndConditionsAccepted": true,
  "currency": "AED",
  "expiryOn": "2025-03-01 12:00:00",
  "Is_QR_needed": true,
  "Is_invoice_generated": true,
  "Address": "123 Main Street",
  "City": "Dubai",
  "Country": "UAE",
  "Invoice_Id": "INV123456",
  "Product_Id": "PROD7890",
  "callback_url": "https://example.com/callback"
}

Authorizations

apiKey
string
header
required
X-HMAC-Signature
string
header
required
accountId
string
header
required

Headers

Time-Zone
string
required
User-Agent
string

Body

application/json

Request payload for generating payment link

FullName
string
required

User's full name (only alphabets, dot, slash, apostrophe, and space allowed)

Required string length: 2 - 50
Pattern: [a-zA-Z./' ]+
Example:

"John Doe"

Email
string
required

User email address

Required string length: 3 - 60
Example:

"user@example.com"

Phone
string
required

User phone number

Example:

"+971501234567"

invoiceAmount
number<double>
required

Invoice amount (minimum 10)

Required range: x >= 10
Example:

100.5

notes
string
required

Notes related to payment

Required string length: 2 - 150
Example:

"Payment for order #12345"

isTermsAndConditionsAccepted
boolean
required

Must be true to accept terms and conditions

Example:

true

Is_QR_needed
boolean
required

Specify if a QR code is required

Example:

true

Is_invoice_generated
boolean
required

Specify if an invoice should be generated

Example:

true

expiryOn
string<date-time>
required

Expiry date of the payment link

Address
string

User's address

Example:

"123 Street, City, Country"

City
string

City name

Pattern: ^[a-zA-Z\s.'-]+$
Example:

"Dubai"

Country
string

Country name

Pattern: ^[a-zA-Z\s.'-]+$
Example:

"UAE"

currency
string

Currency (only AED is allowed)

Example:

"AED"

Invoice_Id
string

Invoice ID

Example:

"INV123456"

Product_Id
string

Product ID

callback_url
string

Callback URL for payment notifications

Example:

"https://example.com/callback"

Response

OK. Payment link generated successfully

status
string
message
string
response
object