Create customer payment

Customers API v2
POSThttps://api.mollie.com/v2/customers/*customerId*/payments

Creates a payment for the customer.

Linking customers to payments enables a number of Mollie Checkout features, including:

  • Keeping track of payment preferences for your customers.
  • Enabling your customers to charge a previously used credit card with a single click.
  • Improved payment insights in your dashboard.
  • Recurring payments.

Note

This endpoint is a shortcut for creating a payment with a customerId parameter.

Parameters

Replace customerId in the endpoint URL by the customer’s ID, for example cst_8wmqcHMN4U.

This endpoint accepts the same parameters as the Create payment endpoint. For recurring payments, the following parameters have notable differences in comparison to regular payments:

recurringType

string
optional
Enables recurring payments. If set to first, a first payment for the customer is created, allowing the customer to agree to automatic recurring charges taking place on their account in the future. If set to recurring, the customer’s card is charged automatically.

amount

decimal
required
If the recurringType parameter is set to first then the minimal amount is €0.01 for iDEAL, credit card and Belfius Pay Button, €0.02 for Bancontact, or €0.10 for SOFORT Banking.

redirectUrl

string
required
If the recurringType parameter is set to recurring, this parameter is ignored. Since the payment will take place without customer interaction, a redirect is not needed.

Response

201 application/hal+json; charset=utf-8

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

Example

Request

1
2
3
4
5
6
7
curl -X POST https://api.mollie.com/v2/customers/cst_8wmqcHMN4U/payments \
    -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \
    -d "amount[currency]=EUR" \
    -d "amount[value]=10.00" \
    -d "description=My first payment" \
    -d "redirectUrl=https://webshop.example.org/order/12345/" \
    -d "webhookUrl=https://webshop.example.org/payments/webhook/"

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
36
37
38
39
40
41
HTTP/1.1 201 Created
Content-Type: application/hal+json; charset=utf-8

{
    "resource": "payment",
    "id": "tr_7UhSN1zuXS",
    "mode": "test",
    "createdAt": "2018-03-20T09:13:37+00:00",
    "amount": {
        "value": "10.00",
        "currency": "EUR"
    },
    "description": "My first payment",
    "method": null,
    "metadata": {
        "order_id": "12345"
    },
    "status": "open",
    "isCancelable": false,
    "expiresAt": "2018-03-20T09:28:37+00:00",
    "details": null,
    "profileId": "pfl_QkEhN94Ba",
    "customerId": "cst_8wmqcHMN4U",
    "sequenceType": "oneoff",
    "redirectUrl": "https://webshop.example.org/order/12345/",
    "webhookUrl": "https://webshop.example.org/payments/webhook/",
    "_links": {
        "self": {
            "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS",
            "type": "application/json"
        },
        "checkout": {
            "href": "https://www.mollie.com/payscreen/select-method/7UhSN1zuXS",
            "type": "text/html"
        },
        "documentation": {
            "href": "https://docs.mollie.com/reference/v2/payments-api/create-payment",
            "type": "text/html"
        }
    }
}