Build payments into your product with TPE virtual. Start integrating →
Logo

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 and 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 (for example, 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.app/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 }
}

Response

Status200 OK
BodyA paginated array of payment link objects.

Errors follow the shared envelope. See Responses.

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.app/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"
  }
}

Response

Status201 Created
BodyThe created payment link object, wrapped in data. A new link is draft until you publish it.

Errors follow the shared envelope. See Responses.

Request
curl https://api.mytpe.app/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"
  }
}

Response

Status200 OK
BodyOne payment link object, wrapped in data.

Errors follow the shared envelope. See Responses.

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

Request
curl -X PUT https://api.mytpe.app/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"
  }
}

Response

Status200 OK
BodyThe updated payment link object, wrapped in data.

Errors follow the shared envelope. See Responses.

Publish, pause, resume

These actions return the updated link.

Request — publish
curl -X POST https://api.mytpe.app/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".

Response

Status200 OK
BodyThe updated payment link object, wrapped in data, with status set to active, paused, or active respectively. Publishing also locks the slug, which can no longer change.

Errors follow the shared envelope. See Responses.

Request
curl -X POST https://api.mytpe.app/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.

Response

Status200 OK
BodyThe link with status now archived, wrapped in data. Archiving is the end of the lifecycle — links are never deleted, because transactions reference them.

Errors follow the shared envelope. See Responses.

On this page