Create customer payment
Customers API

POST
https://api.mollie.nl/v1/customers/customerId/payments
Authentication: API keys OAuth access tokens

Creates a payment for the customer. Linking customers to payments enables a number of Mollie Checkout features, including:

  • 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.

Simply create a customer, link its ID to your own customer database, and continue creating payments as before with the new ID as a reference.

Parameters

Replace customerId in the endpoint URL by the customer's ID, for example cst_1234567.

This endpoint accepts the same parameters as described in Create payment.

Please note that in order to do recurring payments, direct debit or credit card has to be activated on your profile.

recurringType
string | null

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.

Possible values: null first recurring

amount
decimal

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

redirectUrl
string

If the recurringType parameter is set to recurring, this parameter is ignored: since the payment takes place without customer interaction, a redirect is not needed.

Includes

Some endpoints allow you to indicate if you want more information to be included in the API response via the include querystring parameter.

  • No includes supported for this endpoint.

Response

201
application/json; charset=utf-8

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

Example

Request code

$payment = $mollie->customers_payments->withParentId("cst_4qqhO89gsT")->create([
    'amount'        => 10.00,
    'description'   => 'First payment',
    'redirectUrl'   => 'https://webshop.example.org/order/12345/',
]);

Response

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "resource": "payment",
    "id": "tr_7UhSN1zuXS",
    "method": null,
    "mode": "test",
    "createdDatetime": "2017-12-15T17:56:07.0Z"
    "status": "open",
    "amount": "10.00",
    "description": "First payment",
    "metadata": null,
    "profileId": "pfl_QkEhN94Ba",
    "customerId": "cst_4qqhO89gsT",
    "links": {
        "redirectUrl": "https://webshop.example.org/order/12345/"
    }
}