Build payments into your product with MyTPE Pay. Start integrating →
Logo
Get started

Payment links

Create a link on a ready instance, set amount and usage rules, publish it, and share the URL to start collecting payments.

A payment link is a shareable URL that charges customers. It is the fastest way to start collecting — no checkout to build. This is your "start working" moment: once a link is published, its URL can be paid by anyone you share it with.

A link is created under a payment instance that is ready, and can optionally use a published form.

Two settings define a link's behaviour. Both have full value lists in Statuses & enums.

amount_mode — how much the customer pays:

ModeBehaviour
fixedA single set amount.
openPayer chooses, optionally bounded by min_amount / max_amount.

usage_mode — how many times / how long it can be paid:

ModeBehaviour
one_shotOne payment, then exhausted.
limitedUp to max_uses payments, then exhausted.
reusableUnlimited until you archive it.
capped_amountCloses when total_collected reaches target_amount.
time_windowPayable only between starts_at and ends_at.
whitelistOnly the allowed_payers you list can pay.

Lifecycle

A link starts as draft and only accepts payments once active. exhausted, expired, and archived are terminal.

Create and publish

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",
    "form_id": "4f5a6b7c-8d9e-0f1a-2b3c-4d5e6f7a8b9c",
    "metadata": { "order_id": "10428" }
  }'
201 Created
{
  "data": {
    "id": "5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d",
    "slug": "ord-10428-x9f2",
    "title": "Order #10428",
    "amount_mode": "fixed",
    "amount": "4500.00",
    "currency": "DZD",
    "usage_mode": "one_shot",
    "status": "draft",
    "paid_count": 0,
    "total_collected": "0.00",
    "metadata": { "order_id": "10428" }
  }
}

Publish it

curl -X POST https://api.mytpe.appp/api/ext/links/5a6b.../publish \
  -H "X-Api-Key: $MYTPE_API_KEY" \
  -H "X-Api-Secret: $MYTPE_API_SECRET"

The link's status becomes active.

Share the URL

Build the customer URL from the slug and send it. Display it exactly as returned — do not rebuild or shorten it.

https://pay.mytpe.appp/ord-10428-x9f2

Get paid

When a customer pays, a transaction.paid webhook fires and the link's paid_count / total_collected update. Use the metadata you set to reconcile against your order.

ActionEndpointEffect
PausePOST /links/{id}/pauseTemporarily stop accepting payments (paused).
ResumePOST /links/{id}/resumeRe‑activate a paused link.
ArchivePOST /links/{id}/archivePermanently close the link (terminal).

Some fields are immutable once a link has been paid (for example amount_mode and amount). To change pricing, archive the link and create a new one.

→ API: Payment links

On this page