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

Create a payment link

Create a link on a ready instance, set its amount and usage rules, publish it and share the URL.

A payment link is a shareable URL that charges customers. You create it under a payment instance that's ready. Your token needs the links:write scope.

  1. Create the link. Send an Idempotency-Key so that a retry can't create a second link.

    curl -X POST https://api.mytpe.app/api/ext/links \
      -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN" \
      -H "Idempotency-Key: order-10428-link" \
      -H "Content-Type: application/json" \
      -d '{
        "payment_instance_id": "your-instance-id",
        "title": "Order 10428",
        "amount_mode": "fixed",
        "amount": 4500,
        "usage_mode": "one_shot",
        "metadata": { "order_id": "10428" }
      }'

    The link's status is draft.

  2. Publish the link. Its status becomes active.

    curl -X POST https://api.mytpe.app/api/ext/links/your-link-id/publish \
      -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN"
  3. Share the URL, built from the link's slug:

    https://mytpe.app/pay/your-link-slug
  4. When a customer pays, MyTPE sends a transaction.paid webhook event. Use your metadata to match it to your order.

ActionEndpointEffect
PausePOST /links/{id}/pauseStops accepting payments for now.
ResumePOST /links/{id}/resumeAccepts payments again.
ArchivePOST /links/{id}/archiveCloses the link for good.

You can change a link's amount settings only until its first payment. To change the price after that, archive the link and create another.

To choose the amount and usage modes, see Plan your integration. For every field, see Payment links.

On this page