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.
-
Create the link. Send an
Idempotency-Keyso 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
statusisdraft. -
Publish the link. Its
statusbecomesactive.curl -X POST https://api.mytpe.app/api/ext/links/your-link-id/publish \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN" -
Share the URL, built from the link's
slug:https://mytpe.app/pay/your-link-slug -
When a customer pays, MyTPE sends a
transaction.paidwebhook event. Use yourmetadatato match it to your order.
Manage a live link
| Action | Endpoint | Effect |
|---|---|---|
| Pause | POST /links/{id}/pause | Stops accepting payments for now. |
| Resume | POST /links/{id}/resume | Accepts payments again. |
| Archive | POST /links/{id}/archive | Closes 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.