API Documentation
API Endpoint
https://api.dia-9.comオブジェクト ¶
Customer
Customerオブジェクトはエンドユーザーを表します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| 姓 | last_name | string | |
| 名 | first_name | string | |
| 法人名 | business_name | string | |
| 電話番号 | phone | string | |
| Eメール | string | ||
| 郵便番号 | address_zipcode | string | |
| 都道府県 | address_prefecture | string | |
| 住所1 | address_line_1 | string | |
| 住所2 | address_line_2 | string |
-
サンプル
{ "last_name": "吉井", "first_name": "太郎", "business_name": "株式会社ABC", "phone": "03-3333-4444", "email": "taro@example.com", "address_zipcode": "1580093", "address_prefecture": "東京都", "address_line_1": "港区麻布十番1-2-34", "address_line_2": "麻布十番ビル2階" }
Package
packageは配送するアイテムを表します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| サービス名 | service_brand | string | ポスト投函サイズ、60サイズ、80サイズ、100サイズ、120サイズ、140サイズ、160サイズのいずれか |
| オーダーリファレンス番号 | order_reference | string | |
| 荷物名 | name | string | |
| 価格 | price | string | |
| 個口番号 | number | number | |
| 個口数 | boxes | number | |
| 高さ | height | float | cm |
| 横幅 | width | float | cm |
| 奥行 | depth | float | cm |
| 重さ | weight | float | kg |
| 備考 | attention | string |
-
サンプル
[ { "service_brand": "80サイズ", "order_reference": "AB12345678", "name": "衣類", "price": "880", "number": 1, "boxes": 2, "height": 0.0, "width": 0.0, "depth": 0.0, "weight": 0.0, "attention": "" }, { "service_brand": "80サイズ", "order_reference": "", "name": "サングラス", "price": "880", "number": 2, "boxes": 2, "height": 0.0, "width": 0.0, "depth": 0.0, "weight": 0.0, "attention": "割れ物" } ]
TimeWindow
TimeWindowは時間指定枠を表します。
時間指定枠は、顧客へ配送を行うときに使用可能な枠を表すオブジェクトです。 配送見積のリクエストでは、準備日時を元に最短配送ができる時間指定枠を返却します。
-
<当日>
「現在時刻+5時間後」もしくは、「配送準備日時+1時間後」のいずれか遅い時刻以降で最短のキャパが空いている枠を返却します。キャパがない場合は、空きがあるまで日時を延長します。
-
<翌日>
配送準備日時+1時間後以降最短のキャパが空いている枠を返却します。キャパがない場合は、空きがあるまで日時を延長します。
各時間指定枠には、有効期限プロパティも含まれています。 有効期限は、この枠での配送作成可能な期限のタイムスタンプです。
有効期限が切れた後で配送を作成すると、時間枠の違反として400のレスポンスが届きます。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| 時間枠ID | id | string | UUID形式 |
| 時間枠開始時刻 | starts_at | timestamp | |
| 時間枠終了時刻 | ends_at | timestamp | |
| 有効期限 | expires_at | timestamp |
-
サンプル
{ "id": "04eac8c3-05cf-4d5b-80e3-6121b4229a2e", "starts_at": "2018-08-27T09:00:00+09:00", "ends_at": "2018-08-28T10:00:00+09:00", "expires_at": "2018-08-28T14:46:20+09:00" }
AnytimeWindow
AnytimeWindowは日付のみ指定枠を表します。
Timewindowと異なり、starts_atにはnullが入ります。 配送見積と回収見積で、異なる結果を返却します。
-
配送見積
「配送準備日時+30分」時点の日付を返却します。
-
回収見積
TimeWindowと同様のロジックで算出した時点の日付を返却します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| 時間枠ID | id | string | UUID形式 |
| 時間枠開始時刻 | starts_at | timestamp | null |
| 時間枠終了時刻 | ends_at | timestamp | |
| 有効期限 | expires_at | timestamp |
-
サンプル
{ "id": "04eac8c3-05cf-4d5b-80e3-6121b4229a2e", "starts_at": null, "ends_at": "2018-08-28T10:00:00+09:00", "expires_at": "2018-08-28T14:46:20+09:00" }
UnavailableWindow
UnavailableWindowは利用できない時間枠情報を表します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| 時間枠開始時刻 | starts_at | timestamp | |
| 時間枠終了時刻 | ends_at | timestamp |
-
サンプル
{ "starts_at": "2018-08-28T10:00:00+09:00”, "ends_at": "2018-08-28T12:00:00+09:00", }
Driver
Driverは配送を行うアンカーを表します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| アンカー名 | name | string |
-
サンプル
{ "name": "吉井 次郎" }
- Webhookでの通知は以下の形式となります。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| アンカーID | id | number | |
| アンカー名 | name | string | |
| 電話番号 | phone | string | ステータスが、collecting以降のステータスの際に追加 |
| 車両タイプ | vehicle_type | string | ステータスが、collecting以降のステータスの際に追加。自転車、原付、小型二輪、バイク125cc超、軽四輪のいずれか |
| 位置情報 | location | object | |
| [緯度] | latitude | float | |
| [経度] | longitude | float | |
| [タイムスタンプ] | update | timestamp |
-
サンプル
{ "id": 1, "name": "吉井 次郎", "location": { "latitude": 35.65720395654035, "longitude": 139.7335300316473, "update": "2018-11-22T15:15:03+09:00" } } -
サンプル(collecting以降)
{ "id": 1, "name": "吉井 次郎", "phone": "090-0000-1111", "vehicle_type": "バイク125cc超", "location": { "latitude": 35.65720395654035, "longitude": 139.7335300316473, "update": "2018-11-22T15:15:03+09:00" } }
Store
Storeは店舗を表します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| 店舗ID | id | string | UUID形式 |
| 店舗IDエイリアス | id_alias | string | 任意の管理用番号 |
| 店舗名 | store_name | string | |
| 郵便番号 | store_address_zipcode | string | |
| 都道府県 | store_address_prefecture | string | |
| 住所1 | store_address_line_1 | string | |
| 住所2 | store_address_line_2 | string | |
| 電話番号 | store_phone | string | |
| タイプ | store_type | string | 以下store_typeのいずれか |
| 配送対応可否 | offers_delivery | boolean | 配達の集荷先として利用するか否か |
| 回収対応可否 | offers_fetches | boolean | 回収の配送先として利用するか否か |
| 集荷時の対応 | pickup_proof | string | 以下pickup_proofのいずれか |
| 届け時の対応 | delivery_proof | string | signature固定 |
store_type
| 項目名 | 説明 |
|---|---|
| standalone_store | 路面店 |
| in_mall_store | モール内 |
| consolidation_store | ビルイン |
pickup_proof
| 項目名 | 説明 |
|---|---|
| barcode | バーコード読み取り |
| signature | サイン |
| selfcheck | セルフチェック |
-
サンプル
{ "id": "1724e928-f458-468d-9987-1c38a227e172", "id_alias": "S0001", "store_name": "ライフスタイルショップ", "store_address_zipcode": "123-2345", "store_address_prefecture": "東京都", "store_address_line_1": "港区麻布十番1-2-3", "store_address_line_2": "", "store_phone": "03-1111-2222", "store_type": "standalone_store", "offers_delivery": true, "offers_fetches": true, "pickup_proof": "barcode", "delivery_proof": "signature" }
Exception
Exceptionは配送がキャンセルまたは返品される原因となった内容を表します。
| 項目名 | 引数 | 型 | 備考 |
|---|---|---|---|
| コード | code | number | |
| 説明 | description | string | |
| 補足説明 | exception_comment | string | アンカーが入力する補足説明 |
exceptionコード一覧
| code | description |
|---|---|
| 1 | 既にECサイトでキャンセル済み |
| 2 | 店舗がしまっている |
| 3 | 不在 |
| 4 | 荷物が無い |
| 5 | 容量やサイズで運べない |
| 6 | 受取が拒否された |
| 7 | 住所や店舗が違う |
| 8 | その他、フリーコメント |
-
サンプル
{ "code": 3, "description": "不在", "exception_comment": "" }
時間枠 ¶
DIAq APIでは配送、回収依頼を行える時間帯を枠として定義し、
それぞれの枠に固有のIDを定めています。
時間枠の指定にはこの固有のIDを用いて行います。
| 時間帯 | 割増 | ID |
|---|---|---|
| 時間指定なし | 9fad40c3-1347-4ce8-bd06-61c180391f4b | |
| 6時 ~ 7時 | ○ | 8ef796d1-927d-4ce3-ba15-77d798a5e173 |
| 7時 ~ 8時 | ○ | bcee2ebd-64a9-4152-81e8-bc1fe656adac |
| 8時 ~ 9時 | c82054fe-98c7-4558-b11b-b1f619e509e5 | |
| 9時 ~ 10時 | ab006a6e-f07c-42dc-a6fc-8d2b58fb97cc | |
| 10時 ~ 11時 | cf9cd8d4-ca5e-495c-85e1-78781c5d6abc | |
| 11時 ~ 12時 | 9aacd372-1a01-4514-9cdb-ecab0d70ab8c | |
| 12時 ~ 13時 | f30316b2-8e9e-40cf-827c-09a3e88c3ea3 | |
| 13時 ~ 14時 | 14e83275-8fa5-457a-b67b-9d2e88498629 | |
| 14時 ~ 15時 | 054d9435-c6d7-4816-8afc-f6530ea92e7d | |
| 15時 ~ 16時 | 96823b8f-0df6-4c24-9b50-8eeadd6e21e6 | |
| 16時 ~ 17時 | faf4bda3-9bd3-4a26-876c-31c018675178 | |
| 17時 ~ 18時 | 3a4ca164-27ef-4254-9b7f-3e508808b3e7 | |
| 18時 ~ 19時 | 910b4f50-38cb-4ab3-9f60-a6ac92cc1df5 | |
| 19時 ~ 20時 | 30a186e2-99ab-4db7-afba-d6732947a41c | |
| 20時 ~ 21時 | 9d2863ff-30da-45a6-a6e5-7e209b3fb5ce | |
| 21時 ~ 22時 | 96f60771-d95e-4bbc-8262-37ee6d6eba2f | |
| 22時 ~ 23時 | ○ | 9d3653d8-6e71-49a3-ace3-835f537fa5d0 |
| 23時 ~ 0時 | ○ | fc6c3773-c9de-48d6-9304-a6b31ee7ecec |
時間枠取得 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
[
{
"id": "9fad40c3-1347-4ce8-bd06-61c180391f4b",
"starts": 0,
"ends": 0,
"status": "anytime",
"is_extra_charge": false
},
{
"id": "8ef796d1-927d-4ce3-ba15-77d798a5e173",
"starts": 6,
"ends": 7,
"status": "time",
"is_extra_charge": true
},
{
"id": "bcee2ebd-64a9-4152-81e8-bc1fe656adac",
"starts": 7,
"ends": 8,
"status": "time",
"is_extra_charge": true
},
{
"id": "c82054fe-98c7-4558-b11b-b1f619e509e5",
"starts": 8,
"ends": 9,
"status": "time",
"is_extra_charge": false
},
{
"id": "ab006a6e-f07c-42dc-a6fc-8d2b58fb97cc",
"starts": 9,
"ends": 10,
"status": "time",
"is_extra_charge": false
},
{
"id": "cf9cd8d4-ca5e-495c-85e1-78781c5d6abc",
"starts": 10,
"ends": 11,
"status": "time",
"is_extra_charge": false
},
{
"id": "9aacd372-1a01-4514-9cdb-ecab0d70ab8c",
"starts": 11,
"ends": 12,
"status": "time",
"is_extra_charge": false
},
{
"id": "f30316b2-8e9e-40cf-827c-09a3e88c3ea3",
"starts": 12,
"ends": 13,
"status": "time",
"is_extra_charge": false
},
{
"id": "14e83275-8fa5-457a-b67b-9d2e88498629",
"starts": 13,
"ends": 14,
"status": "time",
"is_extra_charge": false
},
{
"id": "054d9435-c6d7-4816-8afc-f6530ea92e7d",
"starts": 14,
"ends": 15,
"status": "time",
"is_extra_charge": false
},
{
"id": "96823b8f-0df6-4c24-9b50-8eeadd6e21e6",
"starts": 15,
"ends": 16,
"status": "time",
"is_extra_charge": false
},
{
"id": "faf4bda3-9bd3-4a26-876c-31c018675178",
"starts": 16,
"ends": 17,
"status": "time",
"is_extra_charge": false
},
{
"id": "3a4ca164-27ef-4254-9b7f-3e508808b3e7",
"starts": 17,
"ends": 18,
"status": "time",
"is_extra_charge": false
},
{
"id": "910b4f50-38cb-4ab3-9f60-a6ac92cc1df5",
"starts": 18,
"ends": 19,
"status": "time",
"is_extra_charge": false
},
{
"id": "30a186e2-99ab-4db7-afba-d6732947a41c",
"starts": 19,
"ends": 20,
"status": "time",
"is_extra_charge": false
},
{
"id": "9d2863ff-30da-45a6-a6e5-7e209b3fb5ce",
"starts": 20,
"ends": 21,
"status": "time",
"is_extra_charge": false
},
{
"id": "96f60771-d95e-4bbc-8262-37ee6d6eba2f",
"starts": 21,
"ends": 22,
"status": "time",
"is_extra_charge": false
},
{
"id": "9d3653d8-6e71-49a3-ace3-835f537fa5d0",
"starts": 22,
"ends": 23,
"status": "time",
"is_extra_charge": true
},
{
"id": "fc6c3773-c9de-48d6-9304-a6b31ee7ecec",
"starts": 23,
"ends": 0,
"status": "time",
"is_extra_charge": true
}
]Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}時間枠取得GET/v1/time_zones
レスポンス
| プロパティ名 | 内容 | 型 |
|---|---|---|
| id | 固有のID(UUID形式) | string |
| starts | 時間枠の開始時間 | number |
| ends | 時間枠の終了時間 | number |
| status | "anytime"もしくは、“time” | string |
| is_extra_charge | 割増適用の時間帯かどうか | boolean |
店舗 ¶
荷物の集荷先・回収の戻り先となる店舗を登録してください。 開発者向け管理画面からも登録・編集が可能です。
作成 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"id_alias": "S0003",
"store_name": "新宿中央通り店",
"store_address_zipcode": "135-3456",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store",
"pickup_proof": "barcode",
"opening_time": "09:00",
"closing_time": "18:00"
}Headers
Content-Type: application/jsonBody
{
"id": "5b94dbd8-fd45-49ce-9755-763d93ab6cf9",
"id_alias": "S0003",
"store_name": "新宿中央通り店",
"store_address_zipcode": "135-3456",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store",
"offers_delivery": true,
"offers_fetches": true,
"pickup_proof": "barcode",
"delivery_proof": "signature",
"opening_time": "09:00",
"closing_time": "18:00"
}リクエストのデータが不正な場合は、400 BadRequest応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}作成POST/v1/stores
店舗情報を作成します。
リクエスト
| プロパティ名 | 内容 | 型 | 必須 | 備考 |
|---|---|---|---|---|
| id_alias | 店舗IDエイリアス | string | 100文字まで | |
| store_name | 店舗名 | string | ○ | 100文字まで |
| store_address_zipcode | 郵便番号 | string | ○ | 【正規表現】 /\A\d{3}[-]\d{4}\z/ |
| store_address_prefecture | 都道府県 | string | ○ | |
| store_address_line_1 | 住所1 | string | ○ | 100文字まで 市区町村から入力してください。(都道府県名は不要です。) |
| store_address_line_2 | 住所2 | string | 100文字まで 特記事項等、フリーワードで入力してください。(住所に続いてアンカーアプリに表示されます。) |
|
| store_phone | 電話番号 | string | ○ | 13文字まで 【正規表現】 /(\A0\d{1,3}-\d{2,4}-\d{3,4}\Z)|(\A0\d{9,10}\Z)/ |
| store_type | 店舗タイプ | string | 以下、store_typeのいずれかを指定 | |
| pickup_proof | 集荷サイン | string | 以下、pickup_proofのいずれかを指定 | |
| opening_time | 営業時間-開始 | string | 100文字まで | |
| closing_time | 営業時間-終了 | string | 100文字まで |
store_type
| 項目名 | 説明 |
|---|---|
| standalone_store | 路面店 |
| in_mall_store | モール内 |
| consolidation_store | ビルイン |
※指定の無い場合は、standalone_store(路面店)として登録されます。
pickup_proof
| 項目名 | 説明 |
|---|---|
| barcode | バーコード読み取り |
| signature | サイン |
| selfcheck | セルフチェック |
※指定の無い場合は、signature(サイン)として登録されます。
一覧取得 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
[
{
"id": "1724e928-f458-468d-9987-1c38a227e172",
"id_alias": "S0001",
"store_name": "ライフスタイルショップ",
"store_address_zipcode": "123-2345",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store",
"offers_delivery": true,
"offers_fetches": true,
"pickup_proof": "barcode",
"delivery_proof": "signature"
}
]Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}一覧取得GET/v1/stores{?id_alias,page,per_page,store_name,store_address_zipcode,store_address_prefecture,store_address_line_1,store_address_line_2,store_phone}
店舗情報を取得します。
処理概要
- 店舗情報の一覧を取得します。店舗IDエイリアスを指定して店舗を指定することができます。
- id_alias
string(optional) Example: S0001店舗IDエイリアス
- page
number(optional) Example: 1ページ指定
- per_page
number(optional) Default: 251ページ当たりの取得件数
- store_name
string(optional) Example: ライフスタイル店舗名
- store_address_zipcode
string(optional) Example: 123-2345郵便番号
- store_address_prefecture
string(optional) Example: 東京都都道府県
- store_address_line_1
string(optional) Example: 麻布十番住所1
- store_address_line_2
string(optional) Example: 麻布十番ビル302住所2
- store_phone
string(optional) Example: 03-1111電話番号
指定して取得 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"id": "1724e928-f458-468d-9987-1c38a227e172",
"id_alias": "S0001",
"store_name": "ライフスタイルショップ",
"store_address_zipcode": "123-2345",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store",
"offers_delivery": true,
"offers_fetches": true,
"pickup_proof": "barcode",
"delivery_proof": "signature"
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}指定して取得GET/v1/stores/{id}
処理概要
- 店舗IDを指定して店舗情報を取得します。
- id
string(optional) Example: 1724e928-f458-468d-9987-1c38a227e172店舗ID
更新 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"store_phone": "03-3333-1111",
"store_type": "standalone_store"
}Body
{
"id": "5b94dbd8-fd45-49ce-9755-763d93ab6cf9",
"id_alias": "S0002",
"store_name": "新宿中央通り店",
"store_address_zipcode": "135-3456",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-1111",
"store_type": "standalone_store",
"offers_delivery": true,
"offers_fetches": true,
"pickup_proof": "barcode",
"delivery_proof": "signature",
"opening_time": "09:00",
"closing_time": "18:00"
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}指定した店舗が存在しない場合、404 NotFound応答となります。
Body
{
"error": ""
}更新PUT/v1/stores/{id}
処理概要
- 店舗IDを指定して、登録済み店舗を更新します。
変更可能なプロパティ
| プロパティ名 | 内容 | 型 | 備考 |
|---|---|---|---|
| id_alias | 店舗IDエイリアス | string | 100文字まで |
| store_name | 店舗名 | string | 100文字まで |
| store_address_zipcode | 郵便番号 | string | 【正規表現】 /\A\d{3}[-]\d{4}\z/ |
| store_address_prefecture | 都道府県 | string | |
| store_address_line_1 | 住所1 | string | 100文字まで 市区町村から入力してください。(都道府県名は不要です。) |
| store_address_line_2 | 住所2 | string | 100文字まで 特記事項等、フリーワードで入力してください。(住所に続いてアンカーアプリに表示されます。) |
| store_phone | 電話番号 | string | 13文字まで 【正規表現】 /(\A0\d{1,3}-\d{2,4}-\d{3,4}\Z)|(\A0\d{9,10}\Z)/ |
| store_type | 店舗タイプ | string | 以下、store_typeのいずれかを指定 |
| pickup_proof | 集荷サイン | string | 以下、pickup_proofのいずれかを指定 |
| opening_time | 営業時間-開始 | string | 100文字まで |
| closing_time | 営業時間-終了 | string | 100文字まで |
store_type
| 項目名 | 説明 |
|---|---|
| standalone_store | 路面店 |
| in_mall_store | モール内 |
| consolidation_store | ビルイン |
pickup_proof
| 項目名 | 説明 |
|---|---|
| barcode | バーコード読み取り |
| signature | サイン |
| selfcheck | セルフチェック |
- id
string(required) Example: 5b94dbd8-fd45-49ce-9755-763d93ab6cf9店舗ID
削除 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}指定した店舗が存在しない場合、404 NotFound応答となります。
Body
{
"error": ""
}削除DELETE/v1/stores/{id}
処理概要
- 店舗IDを指定して、登録済み店舗を削除します。
- id
string(required) Example: 5b94dbd8-fd45-49ce-9755-763d93ab6cf9店舗ID
件数取得 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
{
"counts": 1
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}件数取得GET/v1/stores/counts{?id_alias,store_name,store_address_zipcode,store_address_prefecture,store_address_line_1,store_address_line_2,store_phone}
処理概要
- 登録済みの店舗件数を取得します。
- id_alias
string(optional) Example: S0001店舗IDエイリアス
- store_name
string(optional) Example: ライフスタイル店舗名
- store_address_zipcode
string(optional) Example: 123-2345郵便番号
- store_address_prefecture
string(optional) Example: 東京都都道府県
- store_address_line_1
string(optional) Example: 麻布十番住所1
- store_address_line_2
string(optional) Example: 麻布十番ビル302住所2
- store_phone
string(optional) Example: 03-1111電話番号
配送 ¶
店舗からエンドユーザーへの配送依頼の作成・取得を行います。
配送見積 ¶
配送見積では、EC画面にて受付可能枠に基づく表示を可能にします。
配送依頼を作成する前に、配送枠のキャパ確認をするために配送見積を作成する必要があります。
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"ready_by": "2018-10-25T04:45:00+09:00",
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階"
},
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
]
}Headers
Content-Type: application/jsonBody
{
"id": "cc8ffe5e-8f6d-44c9-9ab7-096565eb051f",
"object": "delivery_estimate",
"ready_by": "2018-10-25T04:45:00+09:00",
"delivery_windows": [
{
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
{
"id": "199458e9-f037-4fac-8f31-65452d83bb07",
"starts_at": null,
"ends_at": "2018-11-26T00:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
}
],
"unavailable_windows": [],
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階"
},
"store": {
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"store_name": "ライフスタイルショップ",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store"
},
"distance": 3087,
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
]
}リクエストのデータが不正な場合は、400 BadRequest応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}作成POST/v1/delivery_estimates/
処理概要
-
配送の見積もりを行い、配送可能な時間枠の確認と確保を行います。
-
ready_byは14日先の日付まで指定可能です。15日以上の日付を指定された場合は、400エラーが返却されます。
リクエスト
| プロパティ名 | 内容 | 型 | 必須 | 備考 |
|---|---|---|---|---|
| store_id | 店舗ID | string | ○ | UUID形式 |
| ready_by | 集荷準備日時 | timestamp | ○ | サポートしているフォーマットはISO8601となります。その他のフォーマットにつきましてはエラーが出る可能性がございます。 |
| customer | 顧客 | object | ○ | |
| [address_zipcode] | 郵便番号 | string | 【正規表現】 /\A\d{3}[-]\d{4}\z/ |
|
| [address_prefecture] | 都道府県 | string | ○ | |
| [address_line_1] | 住所1 | string | ○ | 100文字まで |
| [address_line_2] | 住所2 | string | 100文字まで | |
| packages | 荷物 | array | ○ | |
| [service_brand] | サービス名 | string | ○ | |
| [order_reference] | オーダーリファレンス番号 | string | ||
| [name] | 名前 | string | ○ | 100文字まで |
| [boxes] | 個口数 | number | ○ | 1~10の数値 |
| [number] | 個口番号 | number | 1~10の数値 | |
| [height] | 高さ | float | ||
| [width] | 横幅 | float | ||
| [depth] | 奥行 | float | ||
| [weight] | 重さ | float | ||
| [attention] | 備考 | string | 200文字まで |
レスポンス
-
delivery_windowsには最短で確保できたTimeWindowと最短で確保できたAnytimeWindow枠が返却されます。見積作成で確保した時間枠以外を確保するには、時間枠の確保を利用してください。
-
priceは最短で確保したTimeWindowが割増対象の時間枠の場合、割増料金が加算された金額が返却されます。
| プロパティ名 | 内容 | 型 |
|---|---|---|
| id | 見積ID | string |
| object | オブジェクト名 | string |
| delivery_windows | 時間指定枠 | array |
| [id] | id | string |
| [starts_at] | 時間枠開始時刻 | timestamp |
| [ends_at] | 時間枠終了時刻 | timestamp |
| [expires_at] | 有効期限 | timestamp |
| unavailable_windows | 売切枠 | array |
| [starts_at] | 売切枠開始時刻 | timestamp |
| [ends_at] | 売切枠終了時刻 | timestamp |
| [expires_at] | 有効期限 | timestamp |
| customer | 顧客 | object |
| [address_zipcode] | 郵便番号 | string |
| [address_prefecture] | 都道府県 | string |
| [address_line_1] | 住所1 | string |
| [address_line_2] | 住所2 | string |
| store | 店舗 | object |
| [store_id] | 店舗ID | string |
| [store_name] | 店舗名 | string |
| [store_address_prefecture] | 都道府県 | string |
| [store_address_line_1] | 住所1 | string |
| [store_address_line_2] | 住所2 | string |
| [store_phone] | 電話番号 | string |
| [store_type] | 店舗タイプ | string |
| distance | 配送距離 | number |
| packages | 荷物 | array |
| [service_brand] | サービス名 | string |
| [order_reference] | オーダーリファレンス番号 | string |
| [name] | 名前 | string |
| [number] | 個口番号 | number |
| [boxes] | 個口数 | number |
| [price] | 価格 | string |
| [height] | 高さ | float |
| [width] | 横幅 | float |
| [depth] | 奥行 | float |
| [weight] | 重さ | float |
| [attention] | 注意事項 | string |
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
{
"id": null,
"object": "delivery_estimate",
"ready_by": "2018-10-25T04:45:00+09:00",
"delivery_windows": [
{
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
{
"id": "199458e9-f037-4fac-8f31-65452d83bb07",
"starts_at": null,
"ends_at": "2018-11-26T00:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
}
],
"unavailable_windows": [],
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階"
},
"store": {
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"store_name": "ライフスタイルショップ",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store"
},
"distance": 3087,
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
]
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}指定した時間枠が存在しない場合は、404 NotFound応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}取得GET/v1/delivery_estimates/{id}
処理概要
- 作成済みの見積もり情報を取得します。
レスポンス
- 配送見積作成のレスポンスと同等
- id
string(required) Example: 608e7c2c-3002-4d25-8242-075365affd9d配送見積作成で取得した見積ID
配送依頼 ¶
アンカーに店舗からエンドユーザーへ荷物の配送を依頼する注文データを作成します。
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"ready_by": "2018-10-25T04:45:00+09:00",
"delivery_window_id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階",
"last_name": "吉沢",
"first_name": "健二",
"business_name": "株式会社カンパニー",
"phone": "03-1234-5678",
"email": "efg@example.co.jp"
},
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"pickup_comments": "集荷時は田中に声を掛けてください。",
"destination_comments": ""
}Headers
Content-Type: application/jsonBody
{
"id": "9c591252-cc98-4820-b8cf-28e159283622",
"object": "delivery",
"tracking_code": "031015293758",
"status": "created",
"ready_by": "2018-10-25T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"delivery_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階",
"last_name": "吉沢",
"first_name": "健二",
"business_name": "株式会社カンパニー",
"phone": "03-1234-5678",
"email": "efg@example.co.jp"
},
"store": {
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"store_name": "ライフスタイルショップ",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store"
},
"pickup_comments": "集荷時は田中に声を掛けてください。",
"destination_comments": "",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3087,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T20:00:00.000+09:00"
}リクエストのデータが不正な場合は、400 BadRequest応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}作成POST/v1/deliveries/
処理概要
-
配送見積で取得した時間枠を利用して配送依頼を作成します。
-
until(配送完了の目安時刻「まで」)は、AnytimeWindowの配送依頼作成を行う際に指定できます。 AnytimeWindow以外の時間枠で値を設定した場合,400 BadRequest応答となります。
-
untilは 「HH:mm」(24時間表記) の形式で指定してください。
リクエスト
| プロパティ名 | 内容 | 型 | 必須 | 備考 |
|---|---|---|---|---|
| store_id | 店舗ID | string | ○ | UUID形式 |
| ready_by | 集荷準備日時 | timestamp | ○ | サポートしているフォーマットはISO8601となります。その他のフォーマットにつきましてはエラーが出る可能性がございます。 |
| delivery_window_id | 配送予約枠ID | string | ○ | UUID形式 |
| customer | 顧客 | object | ○ | |
| [address_zipcode] | 郵便番号 | string | 【正規表現】 /\A\d{3}[-]\d{4}\z/ |
|
| [address_prefecture] | 都道府県 | string | ○ | |
| [address_line_1] | 住所1 | string | ○ | 100文字まで |
| [address_line_2] | 住所2 | string | 100文字まで | |
| [last_name] | 姓 | string | ○ | 50文字まで |
| [first_name] | 名 | string | ○ | 50文字まで |
| [business_name] | 法人名 | string | 100文字まで | |
| [phone] | 電話番号 | string | ○ | 13文字まで 【正規表現】 /(\A0\d{1,3}-\d{2,4}-\d{3,4}\Z)|(\A0\d{9,10}\Z)/ |
| [email] | Eメール | string | 200文字まで 【正規表現】 /\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\z/i |
|
| packages | 荷物 | array | ○ | |
| [service_brand] | サービス名 | string | ○ | |
| [order_reference] | オーダーリファレンス番号 | string | ||
| [name] | 名前 | string | ○ | 100文字まで |
| [boxes] | 個口数 | number | ○ | 1~10の数値 |
| [number] | 個口番号 | number | ○ | 1~10の数値 |
| [height] | 高さ | float | ||
| [width] | 横幅 | float | ||
| [depth] | 奥行 | float | ||
| [weight] | 重さ | float | ||
| [attention] | 備考 | string | 200文字まで | |
| pickup_comments | 集荷先コメント | string | ||
| destination_comments | 配送先コメント | string | ||
| until | 配送完了の目安時刻「まで」 | string | 【正規表現】 /\A([01][0-9]|2[0-3]):[0-5][0-9]\z/ |
レスポンス
| プロパティ名 | 内容 | 型 |
|---|---|---|
| id | 配送ID | string |
| object | オブジェクト名 | string |
| tracking_code | オーダーリファレンス番号 | string |
| status | 配送ステータス | string |
| ready_by | 集荷準備日時 | timestamp |
| driver | アンカー名 | string |
| delivered_at | 配送完了日時 | timestamp |
| delivery_window | 配送時間枠 | object |
| [id] | 時間枠ID | string |
| [starts_at] | 時間枠開始時刻 | timestamp |
| [ends_at] | 時間枠終了時刻 | timestamp |
| [expires_at] | 有効期限 | timestamp |
| customer | 顧客 | object |
| [address_zipcode] | 郵便番号 | string |
| [address_prefecture] | 都道府県 | string |
| [address_line_1] | 住所1 | string |
| [address_line_2] | 住所2 | string |
| [last_name] | 姓 | string |
| [first_name] | 名 | string |
| [business_name] | 法人名 | string |
| [phone] | 電話番号 | string |
| [email] | Eメール | string |
| store | 店舗 | object |
| [store_id] | 店舗ID | string |
| [store_name] | 店舗名 | string |
| [store_address_prefecture] | 都道府県 | string |
| [store_address_line_1] | 住所1 | string |
| [store_address_line_2] | 住所2 | string |
| [store_phone] | 電話番号 | string |
| [store_type] | 店舗タイプ | string |
| pickup_comments | 集荷時コメント | string |
| destination_comments | 配送時コメント | string |
| pickup_driver_comments | 集荷時アンカーメモ | string |
| destination_driver_comments | 配送時アンカーメモ | string |
| store_signature | ストア対応方法 | string |
| customer_signature | 顧客対応方法 | string |
| packages | 荷物 | array |
| [service_brand] | サービス名 | string |
| [order_reference] | オーダーリファレンス番号 | string |
| [name] | 名前 | string |
| [number] | 個口番号 | number |
| [boxes] | 個口数 | number |
| [price] | 価格 | string |
| [height] | 高さ | float |
| [width] | 横幅 | float |
| [depth] | 奥行 | float |
| [weight] | 重さ | float |
| [attention] | 注意事項 | string |
| distance | 配送距離 | number |
| etc_price | 立替金 | string |
| etc_price_reason | 立替金理由 | string |
| exception | 例外情報 | object |
| update | 更新日時 | timestamp |
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
[
{
"id": "9c591252-cc98-4820-b8cf-28e159283622",
"object": "delivery",
"tracking_code": "031015293758",
"status": "created",
"ready_by": "2018-10-25T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"delivery_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階",
"last_name": "吉沢",
"first_name": "健二",
"business_name": "株式会社カンパニー",
"phone": "03-1234-5678",
"email": "efg@example.co.jp"
},
"store": {
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"store_name": "ライフスタイルショップ",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store"
},
"pickup_comments": "集荷時は田中に声を掛けてください。",
"destination_comments": "",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3087,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T20:00:00.000+09:00"
}
]Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}一覧取得GET/v1/deliveries{?page,per_page,store_id,status,since,until,order_reference}
処理概要
- 作成済みの配送依頼情報の一覧を取得します。
レスポンス
- 配送依頼作成のレスポンスの配列
- page
number(optional) Example: 1ページ指定
- per_page
number(optional) Default: 251ページ当たりの取得件数
- store_id
string(optional) Example: 1724e928-f458-468d-9987-1c38a227e172店舗ID
- status
number(optional) Example: 0ステータスのクエリ値
- since
string(optional) Example: 2018-10-24T16:00:00+09:00指定時刻以降に終了する配送依頼に限定する
- until
string(optional) Example: 2018-10-24T17:00:00+09:00指定時刻までに終了する配送依頼に限定する
- order_reference
string(optional) Example: x1234オーダーリファレンス番号
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
{
"id": "9c591252-cc98-4820-b8cf-28e159283622",
"object": "delivery",
"tracking_code": "031015293758",
"status": "created",
"ready_by": "2018-10-25T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"delivery_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階",
"last_name": "吉沢",
"first_name": "健二",
"business_name": "株式会社カンパニー",
"phone": "03-1234-5678",
"email": "efg@example.co.jp"
},
"store": {
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"store_name": "ライフスタイルショップ",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store"
},
"pickup_comments": "集荷時は田中に声を掛けてください。",
"destination_comments": "",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3087,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T20:00:00.000+09:00"
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}指定したIDで配送依頼が見つからなかった場合、404エラーを返します。
Body
{
"error": ""
}指定して取得GET/v1/deliveries/{id}
処理概要
- 作成済みの配送依頼情報を取得します
レスポンス
- 配送依頼作成のレスポンスと同等
- id
string(required) Example: 9c591252-cc98-4820-b8cf-28e159283622配送依頼作成で取得した配送ID
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"destination_comments": "ゲートでは暗証番号1234を入力してください。"
}Headers
Content-Type: application/jsonBody
{
"id": "9c591252-cc98-4820-b8cf-28e159283622",
"object": "delivery",
"tracking_code": "031015293758",
"status": "created",
"ready_by": "2018-10-25T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"delivery_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "123-1234",
"address_prefecture": "東京都",
"address_line_1": "港区東麻布99-99-11",
"address_line_2": "東麻布ビル99階",
"last_name": "吉沢",
"first_name": "健二",
"business_name": "株式会社カンパニー",
"phone": "03-1234-5678",
"email": "efg@example.co.jp"
},
"store": {
"store_id": "1724e928-f458-468d-9987-1c38a227e172",
"store_name": "ライフスタイルショップ",
"store_address_prefecture": "東京都",
"store_address_line_1": "港区麻布十番1-2-3",
"store_address_line_2": "",
"store_phone": "03-1111-2222",
"store_type": "standalone_store"
},
"pickup_comments": "集荷時は田中に声を掛けてください。",
"destination_comments": "ゲートでは暗証番号1234を入力してください。",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3087,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T22:00:00.000+09:00"
}更新PUT/v1/deliveries/{id}
処理概要
-
作成済みの配送依頼情報を更新します。
-
更新はアンカーが決まる前(ステータス:created)のみ可能です。
アンカー決定後の配送依頼に更新を行うと404 NotFound応答となります。
変更可能タイミング・項目
| 項目 | オブジェクト | created | created以外 |
|---|---|---|---|
| ストア | store_id | × | × |
| 集荷可能日時 | ready_by | × | × |
| 時間枠 | delivery_window_id | × | × |
| エンドユーザー | customer | ○ | × |
| 荷物情報 | packages | ○ | × |
| 集荷時コメント | pickup_comments | ○ | × |
| 配送時コメント | destination_comments | ○ | × |
レスポンス
- 配送依頼作成のレスポンスと同等
- id
string(required) Example: 9c591252-cc98-4820-b8cf-28e159283622配送依頼作成で取得した配送ID
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHU| 更新前ステータス | 更新後ステータス |
|---|---|
| created | canceled |
| assigned | canceled |
| collecting | canceled |
| arrived_origin | canceled |
| delivering | returning |
| arrived_goal | returning |
| 対象ステータス |
|---|
| delivered |
| canceled |
| returning |
| returned |
キャンセルDELETE/v1/deliveries/{id}
処理概要
- 作成済みの配送依頼情報をキャンセルします。
- id
string(required) Example: 9c591252-cc98-4820-b8cf-28e159283622配送依頼作成で取得した配送ID
回収 ¶
エンドユーザーから店舗への回収依頼の作成・取得を行います。
回収見積 ¶
回収見積では、EC画面にて受付可能枠に基づく表示を可能にします。
回収依頼を作成する前に、配送枠のキャパ確認をするために回収見積を作成する必要があります。
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"deliver_by": "2018-10-25T04:45:00+09:00",
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": ""
},
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
]
}Headers
Content-Type: application/jsonBody
{
"id": "cc8ffe5e-8f6d-44c9-9ab7-096565eb051f",
"object": "fetch_estimate",
"deliver_by": "2018-10-25T04:45:00+09:00",
"fetch_windows": [
{
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
{
"id": "199458e9-f037-4fac-8f31-65452d83bb07",
"starts_at": null,
"ends_at": "2018-11-26T00:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
}
],
"unavailable_windows": [],
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": ""
},
"store": {
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"store_name": "新宿中央通り店",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store"
},
"distance": 3087,
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
]
}リクエストのデータが不正な場合は、400 BadRequest応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}作成POST/v1/fetch_estimates/
処理概要
-
回収の見積もりを行い、回収可能な時間枠の確認を行う。
-
deliver_byは14日先の日付まで指定可能です。15日以上の日付を指定された場合は、400エラーが返却されます。
リクエスト
| プロパティ名 | 内容 | 型 | 必須 | 備考 |
|---|---|---|---|---|
| store_id | 店舗ID | string | ○ | UUID形式 |
| deliver_by | 配送完了期限日時 | timestamp | ○ | サポートしているフォーマットはISO8601となります。その他のフォーマットにつきましてはエラーが出る可能性がございます。 |
| customer | 顧客 | object | ○ | |
| [address_zipcode] | 郵便番号 | string | 【正規表現】 /\A\d{3}[-]\d{4}\z/ |
|
| [address_prefecture] | 都道府県 | string | ○ | |
| [address_line_1] | 住所1 | string | ○ | 100文字まで |
| [address_line_2] | 住所2 | string | 100文字まで | |
| [last_name] | 姓 | string | ○ | 50文字まで |
| [first_name] | 名 | string | ○ | 50文字まで |
| [phone] | 電話番号 | string | ○ | 13文字まで 【正規表現】 /(\A0\d{1,3}-\d{2,4}-\d{3,4}\Z)|(\A0\d{9,10}\Z)/ |
| [email] | Eメール | string | 200文字まで 【正規表現】 /\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\z/i |
|
| packages | 荷物 | array | ○ | |
| [service_brand] | サービス名 | string | ○ | |
| [order_reference] | オーダーリファレンス番号 | string | ||
| [name] | 名前 | string | ○ | |
| [boxes] | 個口数 | number | ○ | 1~10の数値 |
| [number] | 個口番号 | number | 1~10の数値 | |
| [height] | 高さ | float | ||
| [width] | 横幅 | float | ||
| [depth] | 奥行 | float | ||
| [weight] | 重さ | float | ||
| [attention] | 備考 | string | 200文字まで |
レスポンス
-
レスポンスのfetch_windowsには最短で確保できたTimeWindowと最短で確保できたAnytimeWindow枠が返却されます。見積作成で確保した時間枠以外を確保するには、時間枠の確保を利用してください。
-
priceは最短で確保したTimeWindowが割増対象の時間枠の場合、割増料金が加算された金額が返却されます。
| プロパティ名 | 内容 | 型 |
|---|---|---|
| id | 見積ID | string |
| object | オブジェクト名 | string |
| fetch_windows | 時間指定枠 | array |
| [id] | id | string |
| [starts_at] | 時間枠開始時刻 | timestamp |
| [ends_at] | 時間枠終了時刻 | timestamp |
| [expires_at] | 有効期限 | timestamp |
| unavailable_windows | 売切枠 | array |
| [starts_at] | 売切枠開始時刻 | timestamp |
| [ends_at] | 売切枠終了時刻 | timestamp |
| [expires_at] | 有効期限 | timestamp |
| customer | 顧客 | object |
| [address_zipcode] | 郵便番号 | object |
| [address_prefecture] | 都道府県 | string |
| [address_line_1] | 住所1 | string |
| [address_line_2] | 住所2 | string |
| store | 店舗 | object |
| [store_id] | 店舗ID | string |
| [store_name] | 店舗名 | string |
| [store_address_prefecture] | 都道府県 | string |
| [store_address_line_1] | 住所1 | string |
| [store_address_line_2] | 住所2 | string |
| distance | 配送距離 | number |
| packages | 荷物 | array |
| [service_brand] | サービス名 | string |
| [order_reference] | オーダーリファレンス番号 | string |
| [name] | 名前 | string |
| [price] | 価格 | string |
| [number] | 個口番号 | number |
| [boxes] | 個口数 | number |
| [height] | 高さ | float |
| [width] | 横幅 | float |
| [depth] | 奥行 | float |
| [weight] | 重さ | float |
| [attention] | 注意事項 | string |
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
{
"id": null,
"object": "fetch_estimate",
"deliver_by": "2018-10-25T04:45:00+09:00",
"fetch_windows": [
{
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
{
"id": "199458e9-f037-4fac-8f31-65452d83bb07",
"starts_at": null,
"ends_at": "2018-11-26T00:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
}
],
"unavailable_windows": [],
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": ""
},
"store": {
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"store_name": "新宿中央通り店",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store"
},
"distance": 3087,
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
]
}取得GET/v1/fetch_estimates/{id}
- 作成済みの見積もり情報を取得
レスポンス
- 回収見積作成のレスポンスと同等
- id
string(required) Example: 56f12bee-b342-4809-904d-d188720080e8回収見積作成で取得した見積ID
回収依頼 ¶
アンカーにエンドユーザーから店舗へ荷物の配送を依頼する注文データを作成します。
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"ready_by": "2018-10-25T04:45:00+09:00",
"fetch_window_id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": "",
"last_name": "鈴木",
"first_name": "慶介",
"business_name": "",
"phone": "03-9876-5432",
"email": "abc@example.com"
},
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"pickup_comments": "インターホンで7603をコールしてください。",
"destination_comments": ""
}Headers
Content-Type: application/jsonBody
{
"id": "55f4f814-0965-4c3c-9b07-123b0ec46913",
"object": "fetch",
"tracking_code": "031052904890",
"status": "created",
"deliver_by": "2018-10-28T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"fetch_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": "",
"last_name": "鈴木",
"first_name": "慶介",
"business_name": "",
"phone": "03-9876-5432",
"email": "abc@example.com"
},
"store": {
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"store_name": "新宿中央通り店",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store"
},
"pickup_comments": "インターホンで7603をコールしてください。",
"destination_comments": "",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3065,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T20:00:00.000+09:00"
}リクエストのデータが不正な場合は、400 BadRequest応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}作成POST/v1/fetches/
処理概要
-
回収見積で取得した時間枠を利用して回収依頼を作成します。
-
after(回収開始の目安時刻「から」)は、AnytimeWindowの回収依頼作成を行う際に指定できます。 AnytimeWindow以外の時間枠で値を設定した場合,400 BadRequest応答となります。
-
afterは 「HH:mm」(24時間表記) の形式で指定してください。
リクエスト
| プロパティ名 | 内容 | 型 | 必須 | 備考 |
|---|---|---|---|---|
| store_id | 店舗ID | string | ○ | UUID形式 |
| deliver_by | 配送完了期限日時 | timestamp | ○ | サポートしているフォーマットはISO8601となります。その他のフォーマットにつきましてはエラーが出る可能性がございます。 |
| fetch_window_id | 回収予約枠ID | string | ○ | UUID形式 |
| customer | 顧客 | object | ○ | |
| [address_zipcode] | 郵便番号 | string | 【正規表現】 /\A\d{3}[-]\d{4}\z/ |
|
| [address_prefecture] | 都道府県 | string | ○ | |
| [address_line_1] | 住所1 | string | ○ | 100文字まで |
| [address_line_2] | 住所2 | string | 100文字まで | |
| [last_name] | 姓 | string | ○ | 50文字まで |
| [first_name] | 名 | string | ○ | 50文字まで |
| [phone] | 電話番号 | string | ○ | 13文字まで 【正規表現】 /(\A0\d{1,3}-\d{2,4}-\d{3,4}\Z)|(\A0\d{9,10}\Z)/ |
| [email] | Eメール | string | 200文字まで 【正規表現】 /\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\z/i |
|
| packages | 荷物 | array | ○ | |
| [service_brand] | サービス名 | string | ○ | |
| [order_reference] | オーダーリファレンス番号 | string | ||
| [name] | 名前 | string | ○ | 100文字まで |
| [boxes] | 個口数 | number | ○ | 1~10の数値 |
| [number] | 個口番号 | number | ○ | 1~10の数値 |
| [height] | 高さ | float | ||
| [width] | 横幅 | float | ||
| [depth] | 奥行 | float | ||
| [weight] | 重さ | float | ||
| [attention] | 備考 | string | 200文字まで | |
| pickup_comments | 集荷先コメント | string | ||
| destination_comments | 配送先コメント | string | ||
| after | 回収開始の目安時刻「から」 | string | 【正規表現】 /\A([01][0-9]|2[0-3]):[0-5][0-9]\z/ |
レスポンス
| プロパティ名 | 内容 | 型 |
|---|---|---|
| id | 配送ID | string |
| object | オブジェクト名 | string |
| tracking_code | オーダーリファレンス番号 | string |
| status | 配送ステータス | string |
| deliver_by | 配送完了期限日時 | timestamp |
| driver | アンカー名 | string |
| delivered_at | 配送完了日時 | timestamp |
| fetch_window | 回収時間枠 | object |
| [id] | 時間枠ID | string |
| [starts_at] | 時間枠開始時刻 | timestamp |
| [ends_at] | 時間枠終了時刻 | timestamp |
| [expires_at] | 有効期限 | timestamp |
| customer | 顧客 | object |
| [address_zipcode] | 郵便番号 | string |
| [address_prefecture] | 都道府県 | string |
| [address_line_1] | 住所1 | string |
| [address_line_2] | 住所2 | string |
| [last_name] | 姓 | string |
| [first_name] | 名 | string |
| [business_name] | 法人名 | string |
| [phone] | 電話番号 | string |
| [email] | Eメール | string |
| store | 店舗 | object |
| [store_id] | 店舗ID | string |
| [store_name] | 店舗名 | string |
| [store_address_prefecture] | 都道府県 | string |
| [store_address_line_1] | 住所1 | string |
| [store_address_line_2] | 住所2 | string |
| [store_phone] | 電話番号 | string |
| [store_type] | 店舗タイプ | string |
| pickup_comments | 集荷時コメント | string |
| destination_comments | 配送時コメント | string |
| pickup_driver_comments | 集荷時アンカーメモ | string |
| destination_driver_comments | 配送時アンカーメモ | string |
| store_signature | ストア対応方法 | string |
| customer_signature | 顧客対応方法 | string |
| packages | 荷物 | array |
| [service_brand] | サービス名 | string |
| [order_reference] | オーダーリファレンス番号 | string |
| [name] | 名前 | string |
| [number] | 個口番号 | number |
| [boxes] | 個口数 | number |
| [price] | 価格 | string |
| [height] | 高さ | float |
| [width] | 横幅 | float |
| [depth] | 奥行 | float |
| [weight] | 重さ | float |
| [attention] | 注意事項 | string |
| distance | 配送距離 | number |
| etc_price | 立替金 | string |
| etc_price_reason | 立替金理由 | string |
| exception | 例外情報 | object |
| update | 更新日時 | timestamp |
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
[
{
"id": "55f4f814-0965-4c3c-9b07-123b0ec46913",
"object": "fetch",
"tracking_code": "031052904890",
"status": "created",
"deliver_by": "2018-10-28T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"fetch_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": "",
"last_name": "鈴木",
"first_name": "慶介",
"business_name": "",
"phone": "03-9876-5432",
"email": "abc@example.com"
},
"store": {
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"store_name": "新宿中央通り店",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store"
},
"pickup_comments": "インターホンで7603をコールしてください。",
"destination_comments": "",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3065,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T20:00:00.000+09:00"
}
]一覧取得GET/v1/fetches{?page,per_page,store_id,status,since,until,order_reference}
処理概要
- 作成済みの回収依頼情報を複数取得します。
レスポンス
- 回収依頼作成のレスポンスの配列
- page
number(optional) Example: 1ページ指定
- per_page
number(optional) Example: 251ページ当たりの取得件数
- store_id
string(optional) Example: 1724e928-f458-468d-9987-1c38a227e172店舗ID
- status
number(optional) Example: 0ステータスのクエリ値
- since
string(optional) Example: 2018-10-24T16:00:00+09:00指定時刻以降に終了する回収依頼に限定する
- until
string(optional) Example: 2018-10-24T17:00:00+09:00指定時刻までに終了する回収依頼に限定する
- order_reference
string(optional) Example: x1234オーダーリファレンス番号
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUHeaders
Content-Type: application/jsonBody
{
"id": "55f4f814-0965-4c3c-9b07-123b0ec46913",
"object": "fetch",
"tracking_code": "031052904890",
"status": "created",
"deliver_by": "2018-10-28T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"fetch_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": "",
"last_name": "鈴木",
"first_name": "慶介",
"business_name": "",
"phone": "03-9876-5432",
"email": "abc@example.com"
},
"store": {
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"store_name": "新宿中央通り店",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store"
},
"pickup_comments": "インターホンで7603をコールしてください。",
"destination_comments": "",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3065,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T20:00:00.000+09:00"
}指定して取得GET/v1/fetches/{id}
処理概要
- 作成済みの回収依頼情報を取得します
レスポンス
- 回収依頼作成のレスポンスと同等
- id
string(required) Example: 55f4f814-0965-4c3c-9b07-123b0ec46913回収依頼作成で取得した配送ID
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"destination_comments": "ゲートでは暗証番号1234を入力してください。"
}Headers
Content-Type: application/jsonBody
{
"id": "55f4f814-0965-4c3c-9b07-123b0ec46913",
"object": "fetch",
"tracking_code": "031052904890",
"status": "created",
"deliver_by": "2018-10-28T04:45:00+09:00",
"driver": null,
"delivered_at": null,
"fetch_window": {
"id": "5db8a7e7-2052-45ed-9455-d7256fd5e77c",
"starts_at": "2018-10-25T06:00:00+09:00",
"ends_at": "2018-10-25T07:00:00+09:00",
"expires_at": "2018-10-22T18:52:18+09:00"
},
"customer": {
"address_zipcode": "657-8901",
"address_prefecture": "東京都",
"address_line_1": "新宿区高田馬場99-99-1",
"address_line_2": "",
"last_name": "鈴木",
"first_name": "慶介",
"business_name": "",
"phone": "03-9876-5432",
"email": "abc@example.com"
},
"store": {
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"store_name": "新宿中央通り店",
"store_address_prefecture": "東京都",
"store_address_line_1": "新宿区西新宿4-5-6",
"store_address_line_2": "西新宿ビル1階",
"store_phone": "03-3333-4444",
"store_type": "consolidation_store"
},
"pickup_comments": "インターホンで7603をコールしてください。",
"destination_comments": "ゲートでは暗証番号1234を入力してください。",
"pickup_driver_comments": "",
"destination_driver_comments": "",
"store_signature": "barcode",
"customer_signature": "signature",
"packages": [
{
"service_brand": "80サイズ",
"order_reference": "",
"name": "衣料",
"boxes": 2,
"number": 1,
"price": "880",
"height": 0,
"width": 0,
"depth": 0,
"weight": 0,
"attention": ""
},
{
"service_brand": "80サイズ",
"order_reference": "x1234",
"name": "花瓶",
"boxes": 2,
"number": 2,
"price": "880",
"height": 60.5,
"width": 54,
"depth": 40,
"weight": 5,
"attention": "割れ物"
}
],
"distance": 3065,
"etc_price": "0",
"etc_price_reason": "",
"exception": null,
"update": "2018-10-24T22:00:00.000+09:00"
}更新PUT/v1/fetches/{id}
処理概要
-
作成済みの回収依頼情報を更新します。
-
更新はアンカーが決まる前(ステータス:created)のみ可能です。
アンカー決定後の回収依頼に更新を行うと404 NotFound応答となります。
レスポンス
- 回収依頼作成のレスポンスと同等
- id
string(required) Example: 55f4f814-0965-4c3c-9b07-123b0ec46913回収依頼作成で取得した配送ID
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHU| 更新前ステータス | 更新後ステータス |
|---|---|
| created | canceled |
| assigned | canceled |
| collecting | canceled |
| arrived_origin | canceled |
| delivering | returning |
| arrived_goal | returning |
| 対象ステータス |
|---|
| delivered |
| canceled |
| returning |
| returned |
キャンセルDELETE/v1/fetches/{id}
処理概要
- 作成済みの回収依頼情報をキャンセルします。
- id
string(required) Example: 55f4f814-0965-4c3c-9b07-123b0ec46913回収依頼作成で取得した配送ID
時間枠確保 ¶
時間枠の確保 ¶
Headers
Content-Type: application/json
Api-Key: prod_coGaRKvCl5fjor6X8GHUBody
{
"store_id": "8117ba12-ece6-462e-884a-8df46225fa73",
"reserve_date": "2018-10-26",
"time_zone_id": "f30316b2-8e9e-40cf-827c-09a3e88c3ea3"
}Headers
Content-Type: application/jsonBody
{
"id": "9937783e-c09d-4e13-93c5-a57fc6e05474",
"starts_at": "2018-10-26T12:00:00+09:00",
"ends_at": "2018-10-26T13:00:00+09:00",
"expires_at": "2018-10-24T23:00:00+09:00"
}リクエストのデータが不正な場合は、400 BadRequest応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}Headers
Content-Type: application/jsonBody
{
"error": "401 Unauthorized"
}指定した時間枠が予約できない場合は、404 NotFound応答となります。
Headers
Content-Type: application/jsonBody
{
"error": ""
}時間枠の確保POST/v1/reserve_windows
- 配送見積作成/回収見積作成で取得した最短で確保可能な時間枠と異なる時間枠の確保を行います。
リクエスト
| プロパティ名 | 内容 | 型 | 必須 | 備考 |
|---|---|---|---|---|
| store_id | 店舗ID | string | ○ | UUID形式 |
| reserve_date | 予約対象日 | string | ○ | |
| time_zone_id | 時間枠ID | string | ○ | UUID形式 |
レスポンス
- TimeWindowオブジェクトまたはAnytimeWindowオブジェクトが返却されます。
Webhook ¶
管理画面でWebhookのURLを設定していただくと、DIAq APIは配送・回収が完了するまでのイベントを指定のURLにPOSTします。
Webhook URLにはHTTPS方式を指定する必要があります。
開発用のAPIキーで作成していただいた配送・回収についても、管理画面で配送・回収ステータスを進めていただくことで、POSTされます。
イレギュラーなく配送が完了する場合
| アンカー操作 | 操作前ステータス | 操作後ステータス | |
|---|---|---|---|
| 注文を受ける | created | assigned | サンプル |
| 集荷に向かう | assigned | collecting | サンプル |
| 集荷地点登録 | collecting | arrived_origin | サンプル |
| 集荷完了 | arrived_origin | delivering | サンプル |
| 配送地点登録 | delivering | arrived_goal | サンプル |
| 受領サイン | arrived_goal | delivered | サンプル |
キャンセルが発生した場合
| 操作前ステータス | 操作後ステータス | |
|---|---|---|
| created | canceled | サンプル |
| assigned | canceled | サンプル |
| collecting | canceled | サンプル |
| arrived_origin | canceled | サンプル |
| delivering | returning | サンプル |
| arrived_goal | returning | サンプル |
返送が完了した場合
| アンカー操作 | 操作前ステータス | 操作後ステータス | |
|---|---|---|---|
| 受領サイン | returning | returned | サンプル |
Generated by aglio on 05 Apr 2024