Payment links API
With the Payment Links API you can generate payment links that by default, unlike regular payments, do not expire. The Payment Link can be shared with your customers and will redirect them to them the payment page where they can complete the payment. A /reference/v2/payments-api/get-payment
will only be created once the customer initiates the payment.
string |
This description will also be used as the payment description and will be shown to your customer on their card or bank statement when possible. | ||||
amount amount object |
The amount that you want to charge, e.g.
|
||||
string |
The URL your customer will be redirected to after completing the payment process. | ||||
string |
Set the webhook URL, where we will send payment link status updates to. Note The The |
||||
datetime |
The expiry date of the payment link in ISO 8601 format. For example: 2021-12-24T12:00:16+01:00 . It will always be stored in UTC timezone. |
If you are using organization access tokens </guides/authentication>
or are creating an OAuth app </oauth/overview>
, the only mandatory extra parameter is the profileId
parameter. With it, you can specify which profile the payment belongs to. Organizations can have multiple profiles for each of their websites. See Profiles API </reference/v2/profiles-api/get-profile>
for more information.
string |
The website profile's unique identifier, for example pfl_3RkSN1zuPE . |
boolean |
Set this to true to only retrieve payment links made in test mode. By default, only live payment links are returned. |
201
application/hal+json
A payment link object is returned, as described in /reference/v2/payment-links-api/get-payment-link
.
.. code-block:: bash
curl -X POST https://api.mollie.com/v2/payment-links -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" -d "amount[currency]=EUR" -d "amount[value]=24.95" -d "description=Bicycle tires" -d "expiresAt=2021-06-06T11:00:00+00:00" -d "redirectUrl=https://webshop.example.org/thanks" -d "webhookUrl=https://webshop.example.org/payment-links/webhook/"
HTTP/1.1 201 Created
Content-Type: application/hal+json
{
"resource": "payment-link",
"id": "pl_4Y0eZitmBnQ6IDoMqZQKh",
"mode": "test",
"profileId": "pfl_QkEhN94Ba",
"createdAt": "2021-03-20T09:13:37+00:00",
"paidAt": null,
"updatedAt": null,
"expiresAt": "2021-06-06T11:00:00+00:00",
"amount": {
"value": "24.95",
"currency": "EUR"
},
"description": "Bicycle tires",
"redirectUrl": "https://webshop.example.org/thanks",
"webhookUrl": "https://webshop.example.org/payment-links/webhook/",
"_links": {
"self": {
"href": "https://api.mollie.com/v2/payment-links/pl_4Y0eZitmBnQ6IDoMqZQKh",
"type": "application/json"
},
"paymentLink": {
"href": "https://useplink.com/payment/4Y0eZitmBnQ6IDoMqZQKh/",
"type": "text/html"
},
"documentation": {
"href": "https://docs.mollie.com/reference/v2/payment-links-api/create-payment-link",
"type": "text/html"
}
}
}