MyTPEMyTPE Pay
Pay Links

Get Pay Links for Instance

Retrieves a paginated list of payment links for a specific Mytpe Pay instance.

Get Pay Links for Instance

GET https://dev.mytpe.app/api/v2/mytpe-pay/{id}/links

Retrieves a paginated list of payment links associated with a specific Mytpe Pay instance ID.

Authentication

Authentication: API Key (X-API-KEY + X-API-SECRET headers)

This endpoint requires authentication using X-API-KEY and X-API-SECRET headers.

X-API-KEY: {your_api_key}
X-API-SECRET: {your_api_secret}

Request Parameters

Path Parameters

Prop

Type

Query Parameters

Prop

Type

Example Request

get-pay-links.js
const instanceId = '00ded387-5dbd-412b-b619-90b0e86d416f';

const response = await fetch(
  `https://dev.mytpe.app/api/v2/mytpe-pay/${instanceId}/links?per_page=10&page=1`,
  {
    method: 'GET',
    headers: {
      'X-API-KEY': 'your_api_key',
      'X-API-SECRET': 'your_api_secret',
      'Accept': 'application/json',
    },
  }
);

const data = await response.json();
console.log(data);
get-pay-links.ts
interface PayLink {
  id: string;
  title: string;
  slug: string;
  type: string;
  amount: string;
  status: string;
  payment_mode: string;
  payment_status: string;
  collected_amount: string;
}

interface PayLinksResponse {
  success: boolean;
  message: string;
  data: {
    current_page: number;
    data: PayLink[];
    total: number;
    last_page: number;
  };
}

const instanceId = '00ded387-5dbd-412b-b619-90b0e86d416f';

const response = await fetch(
  `https://dev.mytpe.app/api/v2/mytpe-pay/${instanceId}/links?per_page=10&page=1`,
  {
    method: 'GET',
    headers: {
      'X-API-KEY': 'your_api_key',
      'X-API-SECRET': 'your_api_secret',
      'Accept': 'application/json',
    },
  }
);

const data: PayLinksResponse = await response.json();
console.log(data);
get_pay_links.py
import requests

instance_id = '00ded387-5dbd-412b-b619-90b0e86d416f'

headers = {
    'X-API-KEY': 'your_api_key',
    'X-API-SECRET': 'your_api_secret',
    'Accept': 'application/json',
}

params = {
    'per_page': 10,
    'page': 1,
}

response = requests.get(
    f'https://dev.mytpe.app/api/v2/mytpe-pay/{instance_id}/links',
    headers=headers,
    params=params,
)

data = response.json()
print(data)
GetPayLinksController.php
use Illuminate\Support\Facades\Http;

$instanceId = '00ded387-5dbd-412b-b619-90b0e86d416f';

$response = Http::withHeaders([
    'X-API-KEY' => 'your_api_key',
    'X-API-SECRET' => 'your_api_secret',
    'Accept' => 'application/json',
])->get("https://dev.mytpe.app/api/v2/mytpe-pay/{$instanceId}/links", [
    'per_page' => 10,
    'page' => 1,
]);

$data = $response->json();
get-pay-links.php
<?php

$instanceId = '00ded387-5dbd-412b-b619-90b0e86d416f';

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://dev.mytpe.app/api/v2/mytpe-pay/{$instanceId}/links?per_page=10&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        'X-API-KEY: your_api_key',
        'X-API-SECRET: your_api_secret',
        'Accept: application/json',
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
get-pay-links.cjs
const axios = require('axios');

const instanceId = '00ded387-5dbd-412b-b619-90b0e86d416f';

axios.get(`https://dev.mytpe.app/api/v2/mytpe-pay/${instanceId}/links`, {
  headers: {
    'X-API-KEY': 'your_api_key',
    'X-API-SECRET': 'your_api_secret',
    'Accept': 'application/json',
  },
  params: {
    per_page: 10,
    page: 1,
  },
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response?.data));

Example Success Response

200 OK

{
    "success": true,
    "message": "Pay links retrieved successfully",
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": "d5bb42f0-3a50-4c78-aba6-4e66ac7750af",
                "mytpe_pay_id": "00ded387-5dbd-412b-b619-90b0e86d416f",
                "title": "Testing",
                "details": "A detailed description of the awesome product.",
                "logo": null,
                "slug": "awesome-product-unique-slug",
                "type": "dynamic",
                "amount": "100.00",
                "status": "active",
                "payment_mode": "reusable",
                "max_payments": null,
                "successful_payments_count": 0,
                "metadata": {
                    "internal_reference": "ORD-12345"
                },
                "created_at": "2026-01-17T07:43:30.000000Z",
                "updated_at": "2026-01-17T07:43:30.000000Z",
                "payment_link": "https://frontdev.mytpe.app/pay/awesome-product-unique-slug",
                "payment_status": "active",
                "remaining_payments": null,
                "collected_amount": "0.00"
            },
            {
                "id": "a2cc31e1-4b60-5d89-bcd7-5f77bd8861bg",
                "mytpe_pay_id": "00ded387-5dbd-412b-b619-90b0e86d416f",
                "title": "One-Time Invoice #1234",
                "details": "Invoice for web design services.",
                "logo": null,
                "slug": "invoice-1234",
                "type": "dynamic",
                "amount": "50000.00",
                "status": "closed",
                "payment_mode": "one_shot",
                "max_payments": 1,
                "successful_payments_count": 1,
                "metadata": {
                    "invoice_number": "INV-1234"
                },
                "created_at": "2026-01-15T10:20:30.000000Z",
                "updated_at": "2026-01-15T14:35:00.000000Z",
                "payment_link": "https://frontdev.mytpe.app/pay/invoice-1234",
                "payment_status": "paid",
                "remaining_payments": 0,
                "collected_amount": "50000.00"
            }
        ],
        "first_page_url": "https://dev.mytpe.app/api/v2/mytpe-pay/00ded387-5dbd-412b-b619-90b0e86d416f/links?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https://dev.mytpe.app/api/v2/mytpe-pay/00ded387-5dbd-412b-b619-90b0e86d416f/links?page=1",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://dev.mytpe.app/api/v2/mytpe-pay/00ded387-5dbd-412b-b619-90b0e86d416f/links?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "https://dev.mytpe.app/api/v2/mytpe-pay/00ded387-5dbd-412b-b619-90b0e86d416f/links",
        "per_page": 10,
        "prev_page_url": null,
        "to": 2,
        "total": 2
    }
}

Response Fields

Each payment link in the data array contains the following fields:

Prop

Type

Pagination Metadata

Prop

Type

Understanding Payment Link Types

  • Dynamic links have a fixed amount and support all payment modes (reusable, one_shot, limited).
  • Static links allow customers to enter their own amount and are always reusable.
  • The collected_amount field shows the total revenue generated by the link.
  • The payment_status field helps you quickly identify paid, unpaid, and expired links.

Using Payment Status

The payment_status field is especially useful for dashboard displays:

  • Filter invoices by paid vs expired to track outstanding payments
  • Show awaiting_payment links prominently for follow-up
  • Identify partially_paid limited links that need attention

Error Responses

401 Authentication Failed

{
    "errors": [
        {
            "status": "401",
            "code": "API_KEY_INVALID",
            "title": "Invalid API key",
            "detail": "Authentication failed. Please check your API credentials."
        }
    ]
}

404 Instance Not Found

{
    "errors": [
        {
            "status": "404",
            "code": "NOT_FOUND",
            "title": "MytpePay instance not found",
            "detail": "The specified MytpePay instance does not exist or you do not have access to it"
        }
    ]
}

Use Cases

This endpoint is useful for:

  • Displaying all payment links in a dashboard
  • Syncing payment links with an external CRM or ERP system
  • Building reports on link performance and revenue
  • Managing and monitoring link statuses across an instance
  • Tracking which invoices are paid vs expired
  • Monitoring inventory for limited links

Filtering and Sorting

For advanced filtering by status, type, or date range, consider implementing client-side filtering on the returned data or contact support about upcoming query parameter features.

On this page