Create a new customer profile
POST/customers/
v2
POST
customer-create-customer
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"name":"string","owner":{"address":{"street":"Königsberger Straße","houseNumber":"4-6","city":"Espelkamp","zip":"32339","countryCode":"DE","addressPrefix":"c/o Ada Lovelace"},"company":"string","emailAddress":"email@mittwald.example","firstName":"string","lastName":"string","phoneNumbers":["string"],"salutation":"mr","title":"string","useFormalTerm":true},"vatId":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/customers
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.customer.createCustomer({
"data": {
"name": "string",
"owner": {
"address": {
"street": "Königsberger Straße",
"houseNumber": "4-6",
"city": "Espelkamp",
"zip": "32339",
"countryCode": "DE",
"addressPrefix": "c/o Ada Lovelace"
},
"company": "string",
"emailAddress": "email@mittwald.example",
"firstName": "string",
"lastName": "string",
"phoneNumbers": [
"string"
],
"salutation": "mr",
"title": "string",
"useFormalTerm": true
},
"vatId": "string"
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\Customer\CreateCustomer\CreateCustomerRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Customer\CreateCustomer\CreateCustomerRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// CreateCustomerRequestBody to learn how to construct a valid instance
$body = new CreateCustomerRequestBody(/* TODO: ... */);
$request = (new CreateCustomerRequest(
body: $body
));
$response = $client->customer()->createCustomer($request);
var_dump($response->getBody();