Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
184 lines (144 sloc) 5.72 KB

Create customer payment

.. api-name:: Customers API
   :version: 2

.. endpoint::
   :method: POST

.. authentication::
   :api_keys: true
   :organization_access_tokens: true
   :oauth: true

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.
  • :doc:`Recurring payments </payments/recurring>`.


This endpoint is a shortcut for :doc:`creating a payment </reference/v2/payments-api/create-payment>` with a customerId parameter.


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

This endpoint accepts the same parameters as the :doc:`Create payment </reference/v2/payments-api/create-payment>` endpoint. For recurring payments, the following parameters have notable differences in comparison to regular payments:


.. type:: string
   :required: false

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 is charged automatically.


.. type:: string
   :required: false

If the recurringType parameter is set to recurring, this parameter can be omitted. Since the payment will take place without customer interaction, a redirect is not needed.

Access token parameters

If you are using :doc:`organization access tokens </guides/authentication>` or are creating an :doc:`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 :doc:`Profiles API </reference/v2/profiles-api/get-profile>` for more information.


.. type:: string
   :required: true

The website profile's unique identifier, for example pfl_3RkSN1zuPE.


.. type:: boolean
   :required: false

Set this to true to create a payment made in test mode.


201 application/hal+json

A payment object is returned, as described in :doc:`Get payment </reference/v2/payments-api/get-payment>`.


.. code-block-selector::

   .. code-block:: bash

      curl -X POST \
         -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \
         -d "amount[currency]=EUR" \
         -d "amount[value]=10.00" \
         -d "description=Order #12345" \
         -d "sequenceType=first" \
         -d "redirectUrl=" \
         -d "webhookUrl="

   .. code-block:: php

      $mollie = new \Mollie\Api\MollieApiClient();

      $payment = $mollie->customers->get("cst_8wmqcHMN4U")->createPayment([
          "amount" => [
             "currency" => "EUR",
             "value" => "10.00",
          "description" => "Order #12345",
          "sequenceType" => "first",
          "redirectUrl" => "",
          "webhookUrl" => "",

   .. code-block:: ruby

      require 'mollie-api-ruby'

      Mollie::Client.configure do |config|
        config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'

      payment = Mollie::Customer::Payment.create(
        customer_id:   'cst_8wmqcHMN4U',
        amount:        { value: '10.00', currency: 'EUR' },
        description:   'Order #12345',
        sequence_type: 'first',
        redirect_url:  '',
        webhook_url:   ''


You can’t perform that action at this time.