• docs
  • Developers
  • Support
  • Log in
  • Sign up
  • Dashboard
  • Overview
  • Payments
  • Connect
  • API reference
  • Changelog
  • Overview

    Mollie API

    • Overview
    • Security
    • Authentication
    • Testing
    • Common data types
    • Handling errors
    • Webhooks
    • Pagination
    • API idempotency
    • Postman collection

    Mobile apps

    • Overview
    • Accepting payments
    • Authorizing Mollie users

    Integration partners

    • Getting started
    • User agent strings
  • Payments

    Payments

    • Accepting payments
    • Hosted checkout
    • Build your own checkout
    • Status changes
    • Refunds
    • Recurring payments
    • Multicurrency
    • QR codes
    • Integrating gift cards
    • Migrating from v1 to v2

    Orders

    • Overview
    • Why use orders?
    • Migrating to the Orders API
    • Handling discounts
    • Status changes
    • Integrating vouchers
    • Integrating PayPal Express Checkout button

    Wallets

    • Apple Pay overview
    • Direct integration of Apple Pay

    Mollie Components

    • Overview
    • Testing
    • Handling errors
    • Styling
  • Connect

    Mollie Connect

    • Overview
    • Onboard your customers
    • Application fees
    • Splitting payments
    • Refunds and chargebacks

    Creating an app

    • Getting started
    • Permissions
  • API reference

    Accepting payments

    • Payments API
    • Methods API
    • Refunds API
    • Chargebacks API
    • Captures API
    • Wallets API
    • Payment links API
      • Create payment link
      • Get payment link
      • List payment links

    Components

    • Mollie.js

    Receiving orders

    • Orders API
    • Shipments API

    Recurring

    • Customers API
    • Mandates API
    • Subscriptions API

    Connect

    • OAuth API
    • Permissions API
    • Organizations API
    • Profiles API
    • Onboarding API

    Business operations

    • Balances API BETA
    • Settlements API
    • Invoices API

    Partners

    • Clients API
  • Changelog

    Timeline

    • Create payment link
      • Parameters
        • Access token parameters
      • Response
      • Example
        • Response

Accepting payments

  • Payments API
  • Methods API
  • Refunds API
  • Chargebacks API
  • Captures API
  • Wallets API
  • Payment links API
    • Create payment link
    • Get payment link
    • List payment links

Components

  • Mollie.js

Receiving orders

  • Orders API
  • Shipments API

Recurring

  • Customers API
  • Mandates API
  • Subscriptions API

Connect

  • OAuth API
  • Permissions API
  • Organizations API
  • Profiles API
  • Onboarding API

Business operations

  • Balances API BETA
  • Settlements API
  • Invoices API

Partners

  • Clients API

Create payment link¶

Payment links API v2
POSThttps://api.mollie.com/v2/payment-links
Authentication:API keysOrganization access tokensApp access tokens

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 Get payment will only be created once the customer initiates the payment.

Parameters¶

descriptionstringrequired
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.
amountamount objectrequired

The amount that you want to charge, e.g. {"currency":"EUR", "value":"1000.00"} if you would want to charge €1000.00.

Show child parameters

currencystringrequired
An ISO 4217 currency code. The currencies supported depend on the payment methods that are enabled on your account.
valuestringrequired
A string containing the exact amount you want to charge in the given currency. Make sure to send the right amount of decimals. Non-string values are not accepted.
redirectUrlstringoptional
The URL your customer will be redirected to after completing the payment process.
webhookUrlstringoptional

Set the webhook URL, where we will send payment link status updates to.

The webhookUrl is optional, but without a webhook you will miss out on important status changes about your payment link.

The webhookUrl must be reachable from Mollie’s point of view, so you cannot use localhost. If you want to use webhook during development on localhost, you should use a tool like ngrok to have the webhooks delivered to your local machine.

See webhook documentation for more details.

expiresAtdatetimeoptional
The expiry date of the payment link in ISO 8601 format. For example: 2021-12-24T12:00:16+01:00.

Access token parameters¶

If you are using organization access tokens or are creating an OAuth app, 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 for more information.

profileIdstringrequired for access tokensShow details
The website profile’s unique identifier, for example pfl_3RkSN1zuPE.
testmodebooleanoptionalShow details
Set this to true to only retrieve payment links made in test mode. By default, only live payment links are returned.

Response¶

201 application/hal+json

A payment link object is returned, as described in Get payment link.

Example¶

cURLPHPPythonRubyNode.js
1
2
3
4
5
6
7
8
curl -X POST https://api.mollie.com/v2/payment-links \
   -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \
   --data-urlencode "amount[currency]=EUR" \
   --data-urlencode "amount[value]=24.95" \
   --data-urlencode "description=Bicycle tires" \
   --data-urlencode "expiresAt=2023-06-06T11:00:00+00:00" \
   --data-urlencode "redirectUrl=https://webshop.example.org/thanks" \
   --data-urlencode "webhookUrl=https://webshop.example.org/payment-links/webhook/"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");
$paymentLink = $mollie->paymentLinks->create([
  "amount" => [
    "currency" => "EUR",
    "value" => "24.95",
  ],
  "description" => "Bicycle tires",
  "expiresAt" => "2023-06-06T11:00:00+00:00",
  "redirectUrl" => "https://webshop.example.org/thanks",
  "webhookUrl" => "https://webshop.example.org/payment-links/webhook/",
]);
$paymentLink->getCheckoutUrl();
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from mollie.api.client import Client

mollie_client = Client()
mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM")

payment_link = mollie_client.payment_links.create({
   "amount": {
         "currency": "EUR",
         "value": "24.95"
   },
   "description": "Bicycle tires",
   "expiresAt": "2023-06-06T11:00:00+00:00",
   "webhookUrl": "https://webshop.example.org/payment-links/webhook/",
   "redirectUrl": "https://webshop.example.org/thanks",
})
1
2
3
4
We don't have a Ruby code example for this API call yet.

If you have some time to spare, feel free to share suggestions on our Discord:
https://discord.gg/VaTVkXB4aQ
1
2
3
4
We don't have a Node.js code example for this API call yet.

If you have some time to spare, feel free to share suggestions on our Discord:
https://discord.gg/VaTVkXB4aQ

Response¶

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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": "2023-06-06T11:00:00+00:00",
    "amount": {
        "value": "24.95",
        "currency": "EUR"
    },
    "archived": false,
    "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://paymentlink.mollie.com/payment/4Y0eZitmBnQ6IDoMqZQKh/",
            "type": "text/html"
        },
        "documentation": {
            "href": "https://docs.mollie.com/reference/v2/payment-links-api/create-payment-link",
            "type": "text/html"
        }
    }
}
Was this page helpful? Feel free to share your feedback with us directly on our Discord.