Specific Rules
The Order Management System (OMS) API has specific rules and requirements that must be followed when integrating with the API. This section provides detailed information about the specific rules and requirements for integrating with the OMS API.
Customer
You must always provided 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
    }
}
Example:
{
    "customer": {
        "mega_code": "92320.HB1624",
        "profession": "QA",
        "email": "test@gmail.com",
        "firstname": "Test",
        "lastname": "P2P",
        "delivery_address_id": "AA00001221",
        "billing_address_id": "AA00001221"
    }
}
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 used as the unique identifier for a customer in a specific country, so the email address must be unique. An user can have multiple email addresses, but each email address is associated with a specific country.
- 
Adresses The customer can have multiple addresses, and each address is associated with an address ID. You must provide the address ID when placing an order for a customer. The delivery_address_id field is used to identify the delivery address for the order, and the billing_address_id field is used to identify the billing address for the order. Example: {
 "customer": {
 "delivery_address_id": "AA00001221",
 "billing_address_id": "AA00001221"
 }
 }
- 
Organizations The customer can be associated with an organization, and the organization is identified by the mega_code field. The mega_code field is a unique identifier for the organization. Example: {
 "customer": {
 "mega_code": "92320.HB1624"
 }
 }To create a new company, we must contact Accor's team to create the company in the system. The company will be created with a unique mega_code, which will be used to identify the company in the system. They will also create a company admin account. The company admin account will be used to manage the company's information and users. 
- 
Store user_store is the identifier of the country + language where the user is located. The user_store field is used to identify the country where the user is located. It is in the form of "country_language". Example: {
 
 "user_store": "be_fr"
 }stands for Belgium country and French language. 
- 
Shipping Zone Code The shipping_zone_code field is used to identify the shipping zone for the order. The shipping zone code is a unique identifier for the shipping zone. Example: {
 "shipping_zone_code": "FR-FR"
 }
- 
Delivery instructions The delivery instructions field is used to provide additional instructions for the delivery of the order. Example: {
 "shops": [
 {
 "shop_id": "1",
 "delivery_instructions": "Please deliver to the back door."
 }
 ]
 }
- 
Delivery date selected (delivery-rounds method) If the delivery-rounds method is used, the delivery date selected field is used to specify the delivery date for the order. Example: {
 "shops": [
 {
 "shop_id": "1",
 "delivery_date_selected": "30/09/2024"
 }
 ]
 }The date format is "DD/MM/YYYY". 
- 
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 is used to specify the quantity for the offer. 
- 
Price calculation Based on the offer, the quantity and the Mega code, the price will be calculated. For example, some offers may have a fixed price, while others may have a price based on the quantity. Some offers may have a discount based on the Mega code (price per customer group). 
- 
Product instructions The product instructions field is used to provide additional instructions for the product in the order. Example: {
 "offers": [
 {
 "offer_id": 35308,
 "quantity": 1,
 "instruction": "Please cut the apple into slices."
 }
 ]
 }