Skip to main content

Create a customer invite

POST/v2/customers/{customerId}/invites
API version
v2
Request method
POST
Operation ID
customer-create-customer-invite

Request​

  • customerIdstringrequired

    ID of the Customer to create a CustomerInvite for.

Responses​

Format
application/json
Description
  • avatarRefIdstring (uuid)

    Reference to the Customer's avatar.

  • customerIdstring (uuid)required

    ID of the Customer the invite is for.

  • customerNamestringrequired

    Name of the Customer the user is invited to.

  • idstring (uuid)required

    ID of the CustomerInvite.

  • informationobjectrequired
    • invitationTokenstring

      Token for authentication purposes.

    • invitedBystring (uuid)required

      ID of the user that created the invite.

  • mailAddressstring (email)required

    Mail-address of the user the invite is for.

  • membershipExpiresAtstring (date-time)

    Time the CustomerMembership should expire at.

  • messagestring

    Message contained in the CustomerInvite.

  • rolestring (one of: notset, owner, member, accountant)required
Content-Type: application/json

{
"avatarRefId": "f0f86186-0a5a-45b2-aa33-502777496347",
"customerId": "f0f86186-0a5a-45b2-aa33-502777496347",
"customerName": "string",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"information": {
"invitationToken": "string",
"invitedBy": "f0f86186-0a5a-45b2-aa33-502777496347"
},
"mailAddress": "email@mittwald.example",
"membershipExpiresAt": "1985-10-26T01:21:00.000Z",
"message": "string",
"role": "notset"
}
{
"properties": {
"avatarRefId": {
"description": "Reference to the Customer's avatar.",
"format": "uuid",
"type": "string"
},
"customerId": {
"description": "ID of the Customer the invite is for.",
"format": "uuid",
"type": "string"
},
"customerName": {
"description": "Name of the Customer the user is invited to.",
"type": "string"
},
"id": {
"description": "ID of the CustomerInvite.",
"format": "uuid",
"type": "string"
},
"information": {
"properties": {
"invitationToken": {
"description": "Token for authentication purposes.",
"type": "string"
},
"invitedBy": {
"description": "ID of the user that created the invite.",
"format": "uuid",
"type": "string"
}
},
"required": [
"invitedBy"
],
"type": "object"
},
"mailAddress": {
"description": "Mail-address of the user the invite is for.",
"format": "email",
"type": "string"
},
"membershipExpiresAt": {
"description": "Time the CustomerMembership should expire at.",
"format": "date-time",
"type": "string"
},
"message": {
"description": "Message contained in the CustomerInvite.",
"type": "string"
},
"role": {
"enum": [
"notset",
"owner",
"member",
"accountant"
],
"type": "string"
}
},
"required": [
"id",
"customerId",
"mailAddress",
"role",
"information",
"customerName"
],
"type": "object"
}

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-d '{"mailAddress":"email@mittwald.example","membershipExpiresAt":"1985-10-26T01:21:00.000Z","message":"string","role":"notset"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/customers/string/invites
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.createCustomerInvite({
"customerId": "string",
"data": {
"mailAddress": "email@mittwald.example",
"membershipExpiresAt": "1985-10-26T01:21:00.000Z",
"message": "string",
"role": "notset"
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Customer\CreateCustomerInvite\CreateCustomerInviteRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Customer\CreateCustomerInvite\CreateCustomerInviteRequestBody;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

// TODO: Please consult the properties and constructor signature of
// CreateCustomerInviteRequestBody to learn how to construct a valid instance
$body = new CreateCustomerInviteRequestBody(/* TODO: ... */);

$request = (new CreateCustomerInviteRequest(
customerId: "string",
body: $body
));
$response = $client->customer()->createCustomerInvite($request);

var_dump($response->getBody();

On this page