Create customer payment

Customers API v1

Warning

The v1 API has been deprecated. The v1 API will be supported for the foreseeable future, at least until July 2023. However, new features will only be added to the v2 API.

The documentation for creating payments for a customer in the new v2 API can be found here. For more information on the v2 API, refer to our v2 migration guide.

POSThttps://api.mollie.com/v1/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:

recurringTypestringoptional
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.
amountdecimalrequired
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.
redirectUrlstringrequired
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/json

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

Example

Request

1
2
3
4
5
curl -X POST https://api.mollie.com/v1/customers/cst_8wmqcHMN4U/payments \
    -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \
    -d "amount=10.00" \
    -d "description=Order #12345" \
    -d "redirectUrl=https://webshop.example.org/order/12345/"

Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
HTTP/1.1 201 Created
Content-Type: application/json

{
    "resource": "payment",
    "id": "tr_7UhSN1zuXS",
    "mode": "test",
    "createdDatetime": "2018-03-16T14:36:44.0Z",
    "status": "open",
    "expiryPeriod": "PT15M",
    "amount": "10.00",
    "description": "Order #12345",
    "metadata": null,
    "locale": "nl_NL",
    "profileId": "pfl_QkEhN94Ba",
    "customerId": "cst_8wmqcHMN4U",
    "links": {
        "paymentUrl": "https://www.mollie.com/payscreen/select-method/7UhSN1zuXS",
        "redirectUrl": "https://webshop.example.org/order/12345/"
    }
}