Skip to content

Online Registration ​

The following documentation describes how to perform an online registration via the API, especially when the customer is already a prospect in a club.

Case of a customer already known as a prospect in a club ​

It is not not possible to create a new contact when that person is already known in a club.
However, some external services need to create a new contact even though it already exists.
We have added two API endpoints to address this issue.

Glossary of key concepts ​

Before going any further, let's make sure we're using the same terminology.

Prospect contact ​

This refers to the existing customer.
Their status must be temp. We will call this the source contact in this document.

Temporary contact ​

This refers to the customer we want to register.
Their status must be prospect. We will call this the target contact in this document.

Club ​

This is the club where the information of the target contact will be moved to.

Sale ​

A sale is equivalent to a shopping cart. It groups a list of articles that will then be sold to the contact.


Macro process and prerequisites ​

As previously mentioned, you must have the following information:

  • the source contact
  • the target contact
  • the club
  • the sale

The contact information transfer process involves two calls:

  1. A first call to migrate data from the source contact to the target contact:
    Migrating information
  2. A second call to update the sale with the updated contact info:
    Updating information in the sale

Migrating information ​

This API endpoint is used to migrate information from the source contact to the target contact.

Reminder:

  • The source contact must have status prospect
  • The target contact must have status temp
  • The club of the source contact must be different from that of the target contact

Important: for this request, you must be authenticated as the source contact

PUT /{clientToken}/contacts/{contactSourceId}/migrate ​

parameterdescriptionexample
targetContactIdID of the contact in IRI format/{clientToken}/contacts/2
targetClubIdID of the club in IRI format/{clientToken}/clubs/1

Example ​

Migration from Contact 1 (prospect) to Contact 2 (temporary) / Club 1

Query

PUT /{clientToken}/contacts/1/migrate

Body

json5
{
    "targetContactId": "/{clientToken}/contacts/2",
    "targetClubId": "/{clientToken}/clubs/1"
}

Response 204 Migration processed


Updating information in the sale ​

This API endpoint is used to update the contact information in the sale.

The updated fields are:

  • Contact ID: contactId
  • Contact number: contactNumber
  • Contact last name: contactFamilyName
  • Contact first name: contactGivenName

PUT /{clientToken}/sale/{saleId}/update_contact ​

Example ​

Updating information for sale 33

Query

PUT /{clientToken}/sale/33/update_contact

Response 204 Process finished