/PaymentLinkApi/createCreate a hosted payment link for a product or order. The returned link can be shared with the customer.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Positive amount to collect. |
currency | string | Yes | Three-letter ISO currency code, for example TZS. |
product_name | string | Yes | Product or order name, up to 255 characters. |
description | string | Yes | Payment description, up to 255 characters. |
reference_no | string | No | Merchant reference; generated when omitted. Must be unique. |
product_picture | URL | No | HTTP or HTTPS product image URL. |
curl -X POST "https://www.yoqpay.com/PaymentLinkApi/create" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "X-API-SECRET: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"amount":1000,"currency":"TZS","product_name":"Order 1001","description":"Payment for order 1001"}'
$client = new \GuzzleHttp\Client();
$response = $client->post('https://www.yoqpay.com/PaymentLinkApi/create', [
'headers' => [
'X-API-KEY' => 'YOUR_API_KEY',
'X-API-SECRET' => 'YOUR_API_SECRET',
'Content-Type' => 'application/json',
],
'json' => [
'amount' => 1000,
'currency' => 'TZS',
'product_name' => 'Order 1001',
'description' => 'Payment for order 1001',
],
]);
const response = await fetch('https://www.yoqpay.com/PaymentLinkApi/create', {
method: 'POST',
headers: {
'X-API-KEY': 'YOUR_API_KEY',
'X-API-SECRET': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1000,
currency: 'TZS',
product_name: 'Order 1001',
description: 'Payment for order 1001'
})
});
const result = await response.json();
HttpClient client = HttpClient.newHttpClient();
String body = """
{"amount":1000,"currency":"TZS","product_name":"Order 1001","description":"Payment for order 1001"}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://www.yoqpay.com/PaymentLinkApi/create"))
.header("X-API-KEY", "YOUR_API_KEY")
.header("X-API-SECRET", "YOUR_API_SECRET")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
import requests
response = requests.post(
'https://www.yoqpay.com/PaymentLinkApi/create',
headers={
'X-API-KEY': 'YOUR_API_KEY',
'X-API-SECRET': 'YOUR_API_SECRET',
},
json={
'amount': 1000,
'currency': 'TZS',
'product_name': 'Order 1001',
'description': 'Payment for order 1001',
},
timeout=30,
)
result = response.json()
Example response
{
"status": "success",
"data": {
"reference_no": "pl_8af31d02c4f1a991",
"payment_link": "https://example.com/transactions/merchantfunds?paylink=...",
"qr_code_url": "https://...",
"amount": 1000,
"currency": "TZS",
"status": "active"
}
}