> For the complete documentation index, see [llms.txt](https://help.citrusad.com/retail-media-interface/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.citrusad.com/retail-media-interface/integration/fr/data-api/order-data-1/syncing-order-data-via-api.md).

# Synchronisation des données de commande via l'API

## Synchronisation des données de commande via le backend (recommandé)

Pour envoyer des données de commande à Epsilon Retail Media, utilisez une commande similaire à la commande ci-dessous. Notez que les données dans le `orders` champ ci-dessous sont des données factices et ne sont fournies ici qu'à titre d'exemple. Ces exemples affichent tous l'**intégration standard**.

{% hint style="info" %}
**Vous intégrez un sellerId de marketplace ?** Veillez à lire la section sellerId de Marketplace ci-dessous.
{% endhint %}

### Commandes d'un seul article

Ci-dessous se trouve le contexte pour un client qui a acheté un seul article :

```http
POST $BASE_URL/v1/orders HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "orders": [
       {
        "customerId": "npc-s243-ir",
        "teamId": "9f48572c-0a5b-4997-9a0e-ed74f4d32dc6",
        "sessionId": "5cat7-9964-4f",
        "dtmcookieid": "DTM_COOKIE_ID",
        "orderDate": "2021-12-02T15:00:00Z",
        "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
        "orderItems": [
            {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                  "sellerId": "seller_id_601_64"
                }
              ]
            }
    ]
}
```

En cas de succès, l'objet suivant sera renvoyé :

```http
HTTP/2 200
{
    "orders": [
        {
            "teamId": "a7e5cat7-9964-4ff3-bbb1-94bf9b53a366",
            "customerId": "npc-s243-ir",
            "sessionId": "5cat7-9964-4f",
            "dtmcookieid": "aaa_bbb_e345D",
            "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
            "orderItems": [
                {
                    "regularUnitPrice": 1.00,
                    "citrusDiscountAmount": null,
                    "gtin": "9891998566P",
                    "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                    "quantity": 3,
                    "substitutedFor": null,
                    "totalOrderItemPriceAfterDiscounts": 3.00,
                    "sellerId": "seller_id_601_64",
                }
            ],
            "orderDate": "2021-12-02T15:00:00Z",
        }
    ]
}
```

{% hint style="warning" %}
**Format d'OrderDate** L'OrderDate au format ci-dessus est lue en heure UTC. Vous devrez effectuer la synchronisation en UTC.

Vous pouvez également définir un décalage pour votre fuseau horaire, en remplaçant `Z` par `+HH:MM` correspondant à votre fuseau horaire. Par exemple : "orderDate" : `“2021-12-02T15:00:00+10:00"` spécifiera que le fuseau horaire est UTC+10.
{% endhint %}

### Commandes multi-articles

Ci-dessous se trouve le contexte pour un client qui a acheté plusieurs articles - il y a plusieurs articles dans le `orderItems` tableau :

```http
POST $BASE_URL/v1/orders HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "orders": [
       {
        "customerId": "npc-s243-ir",
        "teamId": "9f48572c-0a5b-4997-9a0e-ed74f4d32dc6",
        "sessionId": "5cat7-9964-4f",
        "dtmcookieid": "DTM_COOKIE_ID",
        "orderDate": "2021-12-02T15:00:00Z",
        "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
        "orderItems": [
            {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                  "sellerId": "seller_id_601_64"
                }
              ]
            },
          {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                  "sellerId": "seller_id_601_64"
                }
              ]
            }
    ]
}
```

En cas de succès, l'objet suivant sera renvoyé :

```http
HTTP/2 200
{
    "orders": [
        {
            "teamId": "a7e5cat7-9964-4ff3-bbb1-94bf9b53a366",
            "customerId": "npc-s243-ir",
            "sessionId": "5cat7-9964-4f",
            "dtmcookieid": "aaa_bbb_e345D",
            "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
            "orderItems": [
                {
                    "regularUnitPrice": 1.00,
                    "citrusDiscountAmount": null,
                    "gtin": "9891998566P",
                    "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                    "quantity": 3,
                    "substitutedFor": null,
                    "totalOrderItemPriceAfterDiscounts": 3.00,
                    "sellerId": "seller_id_601_64",
                },
                {
                    "regularUnitPrice": 1.00,
                    "citrusDiscountAmount": null,
                    "gtin": "9891998566P",
                    "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                    "quantity": 3,
                    "substitutedFor": null,
                    "totalOrderItemPriceAfterDiscounts": 3.00,
                    "sellerId": "seller_id_601_64",
                }
            ],
            "orderDate": "2021-12-02T15:00:00Z",
        }
    ]
}
```

### Synchronisation de commandes multiples

Si vous synchronisez plusieurs commandes, vous pouvez envoyer jusqu'à 100 articles sous forme de lot à chaque requête. Le nombre de requêtes que vous pouvez effectuer n'est pas limité. L'ordre de la charge utile envoyée est le même que celui du résultat renvoyé. Cela permet aux données de rester cohérentes avec la représentation de la commande dans votre backend.

```http
POST $BASE_URL/v1/orders HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "orders": [
       {
        "customerId": "npc-s243-ir",
        "teamId": "9f48572c-0a5b-4997-9a0e-ed74f4d32dc6",
        "sessionId": "5cat7-9964-4f",
        "dtmcookieid": "DTM_COOKIE_ID",
        "orderDate": "2021-12-02T15:00:00Z",
        "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
        "orderItems": [
            {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                  "sellerId": "seller_id_601_64"
                }
              ]
            },
        {
      		  "customerId": "rw3-v3ag-ol0",
            "teamId": "a7e5cat7-9964-4ff3-bbb1-94bf9b53a366",
            "sessionId": "2m342-2dfe-0f",
      		  "orderDate": "2021-12-02T15:00:00Z",
      		  "id": "i32dm3e4-c158-43d78-43ww32x-m2ide3e3",
      		  "orderItems": [
            {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                  "sellerId": "seller_id_601_64"
                }
              ]
            }
    ]
}
```

En cas de succès, l'objet suivant sera renvoyé :

```http
HTTP/2 200
{
    "orders": [
        {
            "teamId": "a7e5cat7-9964-4ff3-bbb1-94bf9b53a366",
            "customerId": "npc-s243-ir",
            "sessionId": "5cat7-9964-4f",
            "dtmcookieid": "aaa_bbb_e345D",
            "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
            "orderItems": [
                {
                    "regularUnitPrice": 1.00,
                    "citrusDiscountAmount": null,
                    "gtin": "9891998566P",
                    "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                    "quantity": 3,
                    "substitutedFor": null,
                    "totalOrderItemPriceAfterDiscounts": 3.00,
                    "sellerId": "seller_id_601_64",
                }
            ],
            "orderDate": "2021-12-02T15:00:00Z"
        },
        {
            "teamId": "a7e5cat7-9964-4ff3-bbb1-94bf9b53a366",
            "customerId": "npc-s243-ir",
            "sessionId": "5cat7-9964-4f",
            "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
            "orderItems": [
                {
                    "regularUnitPrice": 1.00,
                    "citrusDiscountAmount": null,
                    "gtin": "9891998566P",
                    "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                    "quantity": 3,
                    "substitutedFor": null,
                    "totalOrderItemPriceAfterDiscounts": 3.00,
                    "sellerId": "seller_id_601_64",
                }
            ],
            "orderDate": "2021-12-02T15:00:00Z"
        }
    ]
}
```

## Marketplace sellerId

Si vous intégrez des vendeurs de marketplace, vous devez synchroniser le `sellerId` le cas échéant lors du signalement des commandes. Dans le cas où le produit acheté n'a pas de `sellerId`, il peut être omis.

{% hint style="danger" %}
**Si vous n'intégrez pas de vendeurs de marketplace, vous n'avez pas besoin de spécifier sellerId dans le rapport de commande**
{% endhint %}

Voici un exemple de commande où un produit provient d'un vendeur de marketplace et un autre n'est pas un produit de marketplace :

```http
POST $BASE_URL/v1/orders HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "orders": [
       {
        "customerId": "npc-s243-ir",
        "teamId": "9f48572c-0a5b-4997-9a0e-ed74f4d32dc6",
        "dtmcookieid": "DTM_COOKIE_ID",
        "sessionId": "5cat7-9964-4f",
        "orderDate": "2021-12-02T15:00:00Z",
        "id": "3h30e938-c158-4d78-a0af-b48bbwfrcss4",
        "orderItems": [
            {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                  "sellerId": "seller_id_601_64"
                }
              ]
            },
          {
                  "gtin": "9891998566P",
                  "quantity": 3,
                  "regularUnitPrice": 1.00,
                  "totalOrderItemPriceAfterDiscounts": 3.00,
                  "catalogId": "6adb93d0-7he4-4d4e-9b47-e5d3714c976a",
                  "citrusDiscountAmount": 0.0,
                  "substitutedFor": null,
                }
              ]
            }
    ]
}
```

### Récupération des informations de commande

Si vous souhaitez vérifier les informations de commande dans Epsilon Retail Media, vous ferez une requête GET à l' `/orders/` API avec l'ID de commande.

```http
GET $BASE_URL/v1/orders/<ORDER_ID> HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
```

Vous récupérerez toutes les informations relatives à la commande stockée dans le Epsilon Retail Media système.\
Dans le cas où la commande n'est pas trouvée, elle n'a probablement pas été ingérée dans le Epsilon Retail Media système.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.citrusad.com/retail-media-interface/integration/fr/data-api/order-data-1/syncing-order-data-via-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
