# Orders

In this section we'll see how to interact with SSM API in order to manage orders of a shop.

# Add order

# Endpoint

POST https://api.supersalesmanagerapp.com/api/app/commands/create

# Body

The add order request should contains this body:

{
    "customer": {
        "name": "Amine Bioudi",
        "phone": "0614158910",
        "address": "Rue 201 numero 2 el fida casablanca"
    },
    "order": [
        {
            "name": "Playstation 3",
            "sku": "PLY-3",
            "image": "https://cdn.ssm.com?image=1234",
            "link": "https://store.com/products/3",
            "price": 1560.99,
            "qte": 2
        },
        {
            "name": "Playstation 5",
            "sku": "PLY-5",
            "image": "https://cdn.ssm.com?image=1234",
            "link": "https://store.com/products/5",
            "price": 6089.99,
            "qte": 3
        }       
    ]
}

# Customer

For each order we have a customer object containing these attributes:

Attribute Description Required
name The complete name of the customer. Yes
phone The phone of the customer. Yes
address The address of the customer. Yes

# Order

The order can contains one or many products and each product is defined by:

Attribute Description Required
name The name of product. Yes
sku The sku of product must be unique. Yes
image The image link of product. No
link The link of product in the shop. Yes
price The selling price of product. Yes
qte The qte of product. Yes

# Response

If the order is added successfully you should recieve this response.

{
    "_response": {
        "code": "API_C_201_00",
        "message": "Order was added successfully !"
    }
}