Resolve Short Code
Resolve a short code to retrieve the associated payment link details.
note
This is a public endpoint — no authentication headers are required.
GET
https://api.zenpayz.com/merchant/api/v1/payment-links/resolve/:shortCodeBearer · API key
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
shortCode REQUIRED | string | The payment link short code (e.g. ZP-XYZ789) |
Response
Success (200 OK)
{
"success": true,
"data": {
"linkId": "pl_a1b2c3d4e5f6g7h8",
"title": "Pro Plan Payment",
"description": "Payment for Pro Plan subscription",
"amount": 4999,
"currency": "INR",
"status": "ACTIVE",
"usageType": "SINGLE",
"merchantName": "Acme Corp",
"merchantLogo": "https://example.com/logo.png",
"paymentUrl": "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8",
"expiresAt": "2024-02-15T23:59:59.000Z"
},
"message": "Payment link resolved successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-15T10:30:00.000Z",
"processing_time_ms": 20,
"api_version": "v1",
"endpoint": "GET /payment-links/resolve/:shortCode",
"user_type": "merchant"
}
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| PAYMENT_LINK_NOT_FOUND | 404 | Short code does not resolve to any payment link |
| PAYMENT_LINK_EXPIRED | 410 | Payment link has expired |
| PAYMENT_LINK_INACTIVE | 410 | Payment link is inactive |
Examples
- cURL
- JavaScript
- SDK
curl -X GET https://api.zenpayz.com/merchant/api/v1/payment-links/resolve/ZP-XYZ789
const response = await fetch('https://api.zenpayz.com/merchant/api/v1/payment-links/resolve/ZP-XYZ789', {
method: 'GET',
});
const result = await response.json();
console.log(result.data.linkId); // pl_a1b2c3d4e5f6g7h8
console.log(result.data.paymentUrl); // "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8"
const link = await zenpays.paymentLinks.resolveShortCode('ZP-XYZ789');
console.log(link.linkId); // pl_a1b2c3d4e5f6g7h8
console.log(link.paymentUrl); // "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8"