Create customer¶
POST
https://api.mollie.com/v2/customers
Creates a simple minimal representation of a customer in the Mollie API to use for the Mollie Checkout and Recurring features. These customers will appear in your Mollie Dashboard where you can manage their details, and also see their payments and subscriptions.
Parameters¶
string
optional
|
The full name of the customer. |
string
optional
|
The email address of the customer. |
string
optional
|
Allows you to preset the language to be used in the hosted payment pages shown to the consumer. When this parameter is not provided, the browser language will be used instead in the payment flow (which is usually more accurate). Possible values: |
object
optional
|
Provide any data you like, and we will save the data alongside the customer. Whenever you fetch the customer with our API, we’ll also include the metadata. You can use up to 1kB of JSON. |
Access token parameters¶
If you are using organization access tokens or are creating an
OAuth app, the testmode
parameter is also available.
boolean
optional
|
Set this to true to create a test mode customer. |
Example¶
1 2 3 4 | curl -X POST https://api.mollie.com/v2/customers \
-H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \
-d "name=Customer A" \
-d "email=customer@example.org"
|
1 2 3 4 5 6 7 | <?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");
$customer = $mollie->customers->create([
"name" => "Customer A",
"email" => "customer@example.org",
]);
|
1 2 3 4 5 6 7 8 9 10 | require 'mollie-api-ruby'
Mollie::Client.configure do |config|
config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
end
customer = Mollie::Customer.create(
name: 'Customer A',
email: 'customer@example.org'
)
|
1 2 3 4 | We don't have a Python code example for this API call yet.
If you have some time to spare, feel free to open a pull request at:
https://github.com/mollie/api-documentation
|
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 open a pull request at:
https://github.com/mollie/api-documentation
|
Response¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | HTTP/1.1 201 Created
Content-Type: application/hal+json
{
"resource": "customer",
"id": "cst_8wmqcHMN4U",
"mode": "test",
"name": "Customer A",
"email": "customer@example.org",
"locale": null,
"metadata": null,
"createdAt": "2018-04-06T13:10:19.0Z",
"_links": {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_8wmqcHMN4U",
"type": "application/hal+json"
},
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/create-customer",
"type": "text/html"
}
}
}
|