• POST rest/addprivaterelation/

      • Add a private (consumer) relation

This POST method allows you to create a new private relation (consumer) including contact and address details.

Important!
It is very important to understand how your request will be interpreted since this is a specific process and the outcome of your request can be unexpected.

General
First of all, the mandatory parameters are appended with an asterix (*). The rest of the parameters are not mandatory. The response of this request will be the details of the relation. The response format can be found in the ‘ListRelations’ endpoint response description.

Also, the parameters customerNumber may not be 0. Sending 0 as number will be interpreted as an empty value for this parameter.

Parameters
Two parameters in this request needs some explanation: OnExistingRelationNumber and OnExistingRelationName. We will explain both parameters below.

OnExistingRelationName This field determines what should happen when the relation you POST already exist, based on the relation name. A match occurs when the relations first- and lastname match. The default behaviour is that we will return the already existing relation. However, if you want the creation of the relation to be forced you can add this parameter in your POST. When set to CONTINUE we will continue creating a new relation, which will result in multiple consumers with the same name existing in your administration.

OnExistingRelationNumber This field determines how we should behave when the relation you POST already exist, based on the customer number. The default behaviour is that we will return the already existing relation. However, if you want the creation of the relation to be forced you can add this parameter in your POST. When set to CONTINUE we will continue creating a new relation, but with a differtent, unique number. When set to ABORT (default), we will abort the creation and return the already existing relation instead.

Please note that is is not required to post a relation number. If you leave it empty, we will automatically generate a number for you and return the newly created relation with the automatic defined number.

  • Request
  • Response

Parameters

OnExistingRelationNumber String Details
ABORT|CONTINUE (defaults to ABORT)
OnExistingRelationName String Details
ABORT|CONTINUE (defaults to ABORT)
Address_City String Details
City of the correspondence address
Address_Street String Details
Street of the correspondence address
Address_PostalCode String Details
Postalcode of the correspondence address
Address_CountryCode String Details
ISO 3166 (A2) country code of the correspondence address
Address_Unit String Details
Unit number of the correspondence address
Address_UnitAppendix String Details
Unit number appendix. Examples: a, b, or suite c.
IsCustomer Boolean (true|false) Details
Whether the relation is marked as customer or not
IsOther Boolean (true|false) Details
Wheter the relation is marked as other relation or not
CustomerNumber Integer Details
If the relation is a customer, this will be the relations customernumber
GroupName String Details
The group to associate this relation with. If the group does not exist yet, a new group with the submitted name will be created.
Relation_Contact * Array Details
An JSON array of contacts for the relation. The first contact will be used as the relations main contact.
Relation_Contact > Email String Details
Contact e-mail address
Relation_Contact > Phone String Details
Contact phonenumber
Relation_Contact > Sex String Details
Contact Sex (Man|Vrouw)
Relation_Contact > LastName * String Details
Contact last name
Relation_Contact > FirstName * String Details
Contact first name
Relation_Contact > ContactNotes String Details
Notes to be added to the contact

CURL Example

Parameters


Response JSON Example

The response order can vary from the parameter order above