Build payments into your product with MyTPE Pay. Start integrating →
Logo
API reference

Payment links

Create, publish, and control shareable URLs that charge customers by card.

A payment link is a shareable URL that charges customers. It is created under a ready payment instance and can optionally use a published form.

Statuses reference

Payment links use three enums — status, amount_mode, and usage_mode — all defined in Statuses & enums → Payment link. Customer payments produce transactions.

Endpoints

MethodPathDescription
GET/linksList payment links (paginated).
POST/linksCreate a link (starts as draft).
GET/links/{id}Retrieve one link.
PUT/links/{id}Update a link.
POST/links/{id}/publishPublish a draft (statusactive).
POST/links/{id}/pausePause an active link.
POST/links/{id}/resumeResume a paused link.
POST/links/{id}/archiveArchive a link (terminal).
FieldTypeDescription
idstring (uuid)Unique identifier.
payment_instance_idstring (uuid)Parent instance.
form_idstring (uuid) | nullAttached form, if any.
slugstringUsed to build the public payment URL.
title / descriptionstringShown on the payment page.
logostring | nullPublic logo URL.
amount_modestringfixed or open — see statuses.
amount / min_amount / max_amountstring | nullPricing, depending on amount_mode.
currencystring | null3‑letter code (e.g. DZD).
usage_modestringHow often it can be paid — see statuses.
max_uses / target_amountnumber | nullLimits for limited / capped_amount.
starts_at / ends_at / expires_atstring | nullWindow / expiry.
paid_countintegerSuccessful payments so far.
total_collectedstringSum collected so far.
statusstringLifecycle state — see statuses.
allowed_payersarrayWhitelisted payers, when loaded.
metadataobject | nullYour own key/value data, echoed in webhooks.
created_at / updated_atstring (ISO 8601)Timestamps.

Query parameters: payment_instance_id, status, usage_mode, search, sort_by, sort_dir, per_page.

Request
curl "https://api.mytpe.appp/api/ext/links?payment_instance_id=3e4f...&status=active" \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET"
200 OK
{
  "data": [
    {
      "id": "5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d",
      "payment_instance_id": "3e4f5a6b-7c8d-9e0f-1a2b-3c4d5e6f7a8b",
      "form_id": "4f5a6b7c-8d9e-0f1a-2b3c-4d5e6f7a8b9c",
      "slug": "ord-10428-x9f2",
      "title": "Order #10428",
      "description": null,
      "logo": null,
      "amount_mode": "fixed",
      "amount": "4500.00",
      "min_amount": null,
      "max_amount": null,
      "currency": "DZD",
      "usage_mode": "one_shot",
      "max_uses": null,
      "target_amount": null,
      "starts_at": null,
      "ends_at": null,
      "expires_at": null,
      "paid_count": 0,
      "total_collected": "0.00",
      "status": "active",
      "metadata": { "order_id": "10428" },
      "created_at": "2026-06-09T13:00:00.000000Z",
      "updated_at": "2026-06-09T13:05:00.000000Z"
    }
  ],
  "links": { "first": "...?page=1", "last": "...?page=1", "prev": null, "next": null },
  "meta": { "current_page": 1, "from": 1, "to": 1, "per_page": 15, "last_page": 1, "total": 1 }
}
FieldTypeRequiredNotes
payment_instance_iduuidyesInstance must be ready.
titlestringyesMax 191.
descriptionstringnoMax 5000.
form_iduuidnoMust be a published form.
amount_modeenumyesfixed, open.
amountnumberconditionalRequired when amount_mode is fixed.
min_amount / max_amountnumbernoBounds for open.
currencystringno3 chars.
usage_modeenumyesone_shot, limited, reusable, capped_amount, time_window, whitelist.
max_usesintegerconditionalRequired when usage_mode is limited.
target_amountnumberconditionalRequired when usage_mode is capped_amount.
starts_at / ends_atdateconditionalRequired when usage_mode is time_window.
expires_atdatenoMust be in the future.
allowed_payersarrayconditionalRequired when usage_mode is whitelist. Items: { email?, phone? }.
metadataobjectnoYour own reference data.
Request
curl -X POST https://api.mytpe.appp/api/ext/links \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_instance_id": "3e4f5a6b-7c8d-9e0f-1a2b-3c4d5e6f7a8b",
    "title": "Order #10428",
    "amount_mode": "fixed",
    "amount": 4500,
    "currency": "DZD",
    "usage_mode": "one_shot",
    "metadata": { "order_id": "10428" }
  }'
201 Created
{
  "data": {
    "id": "5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d",
    "payment_instance_id": "3e4f5a6b-7c8d-9e0f-1a2b-3c4d5e6f7a8b",
    "form_id": null,
    "slug": "ord-10428-x9f2",
    "title": "Order #10428",
    "description": null,
    "amount_mode": "fixed",
    "amount": "4500.00",
    "min_amount": null,
    "max_amount": null,
    "currency": "DZD",
    "usage_mode": "one_shot",
    "max_uses": null,
    "target_amount": null,
    "paid_count": 0,
    "total_collected": "0.00",
    "status": "draft",
    "metadata": { "order_id": "10428" },
    "created_at": "2026-06-09T13:00:00.000000Z",
    "updated_at": "2026-06-09T13:00:00.000000Z"
  }
}
Request
curl https://api.mytpe.appp/api/ext/links/5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET"
200 OK
{
  "data": {
    "id": "5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d",
    "payment_instance_id": "3e4f5a6b-7c8d-9e0f-1a2b-3c4d5e6f7a8b",
    "form_id": null,
    "slug": "ord-10428-x9f2",
    "title": "Order #10428",
    "amount_mode": "fixed",
    "amount": "4500.00",
    "currency": "DZD",
    "usage_mode": "one_shot",
    "paid_count": 1,
    "total_collected": "4500.00",
    "status": "exhausted",
    "metadata": { "order_id": "10428" },
    "created_at": "2026-06-09T13:00:00.000000Z",
    "updated_at": "2026-06-09T14:30:00.000000Z"
  }
}

Accepts title, description, form_id, max_uses, target_amount, expires_at, metadata.

Request
curl -X PUT https://api.mytpe.appp/api/ext/links/5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Order #10428 (updated)", "metadata": { "order_id": "10428", "channel": "web" } }'
200 OK
{
  "data": {
    "id": "5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d",
    "title": "Order #10428 (updated)",
    "status": "draft",
    "metadata": { "order_id": "10428", "channel": "web" },
    "updated_at": "2026-06-09T13:10:00.000000Z"
  }
}

Publish, pause, resume

These actions return the updated link.

Request — publish
curl -X POST https://api.mytpe.appp/api/ext/links/5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d/publish \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET"
200 OK
{
  "data": {
    "id": "5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d",
    "slug": "ord-10428-x9f2",
    "status": "active",
    "updated_at": "2026-06-09T13:05:00.000000Z"
  }
}

POST /links/{id}/pause returns the link with status: "paused"; POST /links/{id}/resume returns it back to status: "active".

Request
curl -X POST https://api.mytpe.appp/api/ext/links/5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d/archive \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET"
200 OK
{ "message": "Payment link archived." }

amount_mode, amount, and usage_mode are fixed once a link has been paid. To change pricing, archive the link and create a new one.

On this page