PayAgency Logo
PaymentLink

Payment Templates API

This API retrieves all saved payment link templates for the authenticated user. It returns template details including name, redirect URLs, webhook URLs, and screenshots.


API Endpoint

GET https://backend.pay.agency/v1/payment-templates

Headers

Header NameDescription
Content-TypeSet to application/json.
AuthorizationBearer token (your secret key or test key).

Success Response

On success, the API returns an array of payment templates:

{
  "data": [
    {
      "template_id": "07b3ac4b-7f99-4736-b116-12862433010y",
      "template_name": "Donation Template",
      "payment_template_id": "TPL7823981",
      "template_screenshot": "https://cdn.pay.agency/screenshots/template1.png",
      "redirect_url": "https://pay.agency/success",
      "webhook_url": "https://webhook.site/abc123"
    },
    {
      "template_id": "07b3ac4b-7f99-4736-b116-12862433010c",
      "template_name": "E-commerce Checkout",
      "payment_template_id": "TPL8923746",
      "template_screenshot": "https://cdn.pay.agency/screenshots/template2.png",
      "redirect_url": "https://pay.agency/thank-you",
      "webhook_url": "https://webhook.site/xyz987"
    }
  ]
}

Error Response

{
  "message": "Authentication Secret Key is missing."
}
{
  "message": "Invalid Secret Key."
}

On this page