Pay By Link API
Create Payment Link
/v1/payment-links
This endpoint allows merchants to create a payment link that can be shared with customers for making payments. The payment link contains details such as the amount, currency, description, and optional metadata. It can also be customized with URLs for success, failure, and cancellation scenarios. The payment link is valid until the specified expiration date and can be used for one-time or recurring payments depending on the provided settings.
Request parameters
{
"amount": 1000000,
"currency": "USD",
"customerId": "5e9f8f8f-9d9e-9e9d-9e9f-8f8f8f9d9e9f",
"description": "Payment for services",
"expiresAt": "2025-03-14T00:00:00Z",
"metadata": {
"cancelUrl": "https://example.com/cancel",
"failureUrl": "https://example.com/failure",
"successUrl": "https://example.com/success"
},
"orderReference": "ORD123456",
"recurring": {
"expiry": "2025-03-14T00:00:00Z",
"frequency": 30,
"parentTransactionId": "5e9f8f8f-9d9e-9e9d-9e9f-8f8f8f9d9e9f",
"type": "cof_initial"
},
"autoClearing": true
}
Responses
{
"amount": 1000000,
"createdAt": "2025-03-01T12:00:00Z",
"currency": "USD",
"customerId": "example",
"description": "Payment for services",
"expiresAt": "2025-03-14T00:00:00Z",
"id": "pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f",
"metadata": {
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"failureUrl": "https://example.com/failure",
"successUrl": "https://example.com/success"
},
"orderReference": "ORD123456",
"status": "active",
"updatedAt": "2025-03-01T12:30:00Z",
"url": "https://checkout.plexypay.com/pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
Retrieve Payment Links
/v1/payment-links
This endpoint retrieves a list of payment links for a merchant, based on various query parameters such as status, page, and date range. The response includes pagination information along with the payment links data.
Responses
{
"data": [
{
"amount": 1000000,
"createdAt": "2025-03-01T12:00:00Z",
"currency": "USD",
"description": "Payment for services",
"expiresAt": "2025-03-14T00:00:00Z",
"id": "pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f",
"orderReference": "ORD123456",
"status": "active",
"updatedAt": "2025-03-01T12:30:00Z"
}
],
"page": 1,
"size": 10,
"total": 100
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
Retrieve Payment Link
/v1/payment-links/{external_id}
This endpoint retrieves a payment link based on the provided external ID, the merchant's ID, and store ID. It returns the details of the payment link if found.
Responses
{
"amount": 1000000,
"createdAt": "2025-03-01T12:00:00Z",
"currency": "USD",
"customerId": "example",
"description": "Payment for services",
"expiresAt": "2025-03-14T00:00:00Z",
"id": "pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f",
"metadata": {
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"failureUrl": "https://example.com/failure",
"successUrl": "https://example.com/success"
},
"orderReference": "ORD123456",
"status": "active",
"updatedAt": "2025-03-01T12:30:00Z",
"url": "https://checkout.plexypay.com/pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
Update Payment Link
/v1/payment-links/{external_id}
This endpoint updates the expiration time of a payment link, identified by its external ID. If the link is not found or cannot be updated, appropriate error responses are returned.
Request parameters
{
"expiresAt": "2025-03-14T00:00:00Z"
}
Responses
{
"amount": 1000000,
"createdAt": "2025-03-01T12:00:00Z",
"currency": "USD",
"customerId": "example",
"description": "Payment for services",
"expiresAt": "2025-03-14T00:00:00Z",
"id": "pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f",
"metadata": {
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"failureUrl": "https://example.com/failure",
"successUrl": "https://example.com/success"
},
"orderReference": "ORD123456",
"status": "active",
"updatedAt": "2025-03-01T12:30:00Z",
"url": "https://checkout.plexypay.com/pl_5e9f8f8f9d9e9e9d9e9f8f8f8f9d9e9f"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
Cancel Payment Link
/v1/payment-links/{external_id}
This endpoint cancels a payment link for a merchant. It checks if the payment link exists and can be canceled, and updates its status to "Cancelled" if possible. If the payment link cannot be canceled, an appropriate error is returned.
Responses
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
{
"code": "1",
"message": "service unavailable",
"source": "keys",
"type": "apiError"
}
26 August 2025