> 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/ja/data-api/order-data-1/syncing-order-data-via-api.md).

# API経由での注文データの同期

## バックエンド経由での注文データの同期（推奨）

注文データを Epsilon Retail Mediaに送信するには、以下のコマンドと同様のコマンドを使用します。なお、以下の `orders` フィールドのデータはダミーデータであり、ここでは例としてのみ提供されています。これらの例はすべて**標準的な統合**を示しています。

{% hint style="info" %}
**マーケットプレイスの sellerId を統合しますか？** 以下のマーケットプレイスの sellerId セクションを必ずお読みください。
{% endhint %}

### 単品の注文

以下は、商品を1点購入した顧客のコンテキストです:

```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"
                }
              ]
            }
    ]
}
```

成功した場合、次のオブジェクトが返されます:

```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" %}
**OrderDate の形式** 上記の形式の OrderDate は UTC 時間として読み取られます。UTC で同期する必要があります。

または、タイムゾーンのオフセットを設定し、 `Z` を `+HH:MM` お使いのタイムゾーンに関連するものに置き換えることもできます。例: “orderDate”: `“2021-12-02T15:00:00+10:00"` はタイムゾーンが UTC+10 であることを指定します。
{% endhint %}

### 複数商品の注文

以下は、複数の商品を購入した顧客のコンテキストです。次の配列には複数の商品が含まれています: `orderItems` 配列:

```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"
                }
              ]
            }
    ]
}
```

成功した場合、次のオブジェクトが返されます:

```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",
        }
    ]
}
```

### 複数の注文の同期

複数の注文を同期する場合、1回のリクエストで最大100件のアイテムをバッチとして送信できます。実行できるリクエストの回数に制限はありません。送信されたペイロードの順序は、返される結果の順序と同じになります。これにより、バックエンドにおける注文表現とデータの整合性を維持することができます。

```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"
                }
              ]
            }
    ]
}
```

成功した場合、次のオブジェクトが返されます:

```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"
        }
    ]
}
```

## マーケットプレイスの sellerId

マーケットプレイスのセラーをオンボーディングする場合は、次を同期する必要があります： `sellerId` 注文をレポートする際、該当する場合。購入された商品に次がない場合： `sellerId`、省略できます。

{% hint style="danger" %}
**マーケットプレイスのセラーをオンボーディングしない場合は、注文レポートで sellerId を指定する必要はありません**
{% endhint %}

以下は、一方の製品がマーケットプレイスの出品者からのもので、もう一方の製品がマーケットプレイス製品ではない注文の例です。

```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,
                }
              ]
            }
    ]
}
```

### 注文情報の取得

内で注文情報を確認したい場合、 Epsilon Retail Mediaへ GET リクエストを送信します `/orders/` 注文 ID を含む API。

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

内に保存されている注文に関連するすべての情報を取得します Epsilon Retail Media システム。\
注文が見つからない場合、おそらく次の中にコミットされていません Epsilon Retail Media システム。


---

# 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/ja/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.
