Skip to main content

Specific Rules

The Order Management System (OMS) API has specific rules and requirements for integration. This section provides detailed information on these requirements.

Customer​

You must always provide the following information when placing an order:

{
"customer": {
"mega_code": "string", // Unique identifier for the company
"profession": "string", // Profession of the customer
"email": "string", // Email address of the customer, unique identifier for the customer
"firstname": "string", // First name of the customer
"lastname": "string", // Last name of the customer
"delivery_address_id": "string", // Address ID for the delivery address
"billing_address_id": "string", // Address ID for the billing address
"user_store": "string" // Identifier consisting of country and language, formatted as "country_language"
}
}

Example:

{
"customer": {
"mega_code": "92320.HB1624",
"profession": "QA",
"email": "test@gmail.com",
"firstname": "Test",
"lastname": "P2P",
"delivery_address_id": "AA00001221",
"billing_address_id": "AA00001221"
}
}

The user_store field identifies the country and language for the customer, formatted as "country_language" (e.g., "be_fr" for Belgium in French).

User vs. Organization​

The customer object contains information about both:

  • User: The individual person placing the order (email, name, profession)
  • Organization: The company entity associated with the user (companies ID are identified by mega_code)

The mega_code field is the ID of a company/organization.

If the user already exists, we will update the user information. If the user does not exist, we will create a new user. In our system, the email address is the unique identifier for a customer in a specific country; therefore, it must be unique. A user can have multiple email addresses, but each is associated with a specific country.

Addresses​

The customer can have multiple addresses, each associated with an address ID. You must provide the address ID when placing an order. The delivery_address_id field identifies the delivery address, while the billing_address_id field identifies the billing address. For example:

{
"customer": {
"delivery_address_id": "AA00001221",
"billing_address_id": "AA00001221"
}
}

Organizations​

The customer can be associated with an organization, identified by the mega_code. This field is a unique identifier for the organization. For example:

{
"customer": {
"mega_code": "92320.HB1624"
}
}

To create a new company, contact Accor's team. They will create the company in the system with a unique mega_code, which will serve as the organization's identifier. They will also create a company admin account to manage the company's information and users.

Shipping Zone Code​

The shipping_zone_code field is used to identify the shipping zone for the order. This is a unique identifier. Example:

{
"shipping_zone_code": "FR-FR"
}

Delivery Instructions​

The delivery_instruction field is used to provide additional instructions for the delivery of the order. This field is nested within the shops array. Example:

{
"shops": [
{
"shop_id": "1",
"delivery_instruction": "Please deliver to the back door."
}
]
}

Delivery Date Selected (delivery-rounds method)​

If the delivery-rounds method is used, the delivery_date_selected field specifies the delivery date for the order. This field is nested within the shops array. Example:

{
"shops": [
{
"shop_id": "1",
"delivery_date_selected": "2024-09-30"
}
]
}

The date format is "YYYY-MM-DD".

Offers​

The offers field is used to specify the offers for the order. Example:

{
"offers": [
{
"offer_id": "1",
"quantity": 1
}
]
}

The offer_id field is used to identify the offer, and the quantity field specifies the quantity for the offer.

Price Calculation​

The price is calculated based on the offer, the quantity, and the mega_code.

For instance, some offers may have a fixed price, while others are based on quantity. Some offers may also have a discount based on the mega_code (price per customer group).

Product Instructions​

The instruction field is used to provide additional instructions for a product within the order. This field is nested within the offers array. Example:

{
"offers": [
{
"offer_id": 35308,
"quantity": 1,
"instruction": "Please cut the apple into slices."
}
]
}