Back to top

zaico API Document

このドキュメントはZAICO APIの機能と使うために必要なパラメータなどを説明するものです。
2024年3月15日更新

認証

認証について

GET

概要

ZAICO APIは認証にBearerトークン認証を採用しています。 リクエストを送る際、HTTPヘッダにAuthorization: Bearerをつけてください。

Authorization: Bearer YOUR_TOKEN_HERE

在庫データ

在庫データ一覧取得

GET/api/v1/inventories

処理概要

  • 自分のアカウントに登録されている在庫データのすべてを返します

  • 在庫データが1件も無い場合は、空の配列を返します

  • 棚卸日は設定されている場合のみ表示されます

  • 発注点は設定されている場合のみ表示されます

  • 在庫データが1000件以上ある場合はページネーションで分割され、1000件ごと在庫データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます。サンプルプログラムなど詳しくはこちらのページをご覧ください( https://www.zaico.co.jp/2019/03/29/zaico-api-update-get-inventories/ )

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは在庫一覧でのみ返されます

  • 条件を指定して検索できます。検索できる項目は「title」、「category」、「place」、「code」と追加項目の5つです。検索する場合は以下のようにリクエストを送ってください。(下記の例は全部の項目に該当する在庫データを検索するものです。必要な項目のクエリを発行ください。)

    • 1つの項目に複数の値をいれて検索することはできません。
    • 「code(QRコード・バーコードの値)」は完全一致での検索となります。
    • 追加項目は一つだけ条件を指定することができ、また完全一致での検索となります。追加項目の検索はパラメータ「optional_attributes_name」に追加項目名を、「optional_attributes_value」に追加項目の値を指定してください。
    Ref:
    https://web.zaico.co.jp/api/v1/inventories/?title={TITLE}&category={CATEGORY}&place={PLACE}&code={CODE}&optional_attributes_name={OPTIONAL_ATTRIBUTES_NAME}&optional_attributes_value={OPTIONAL_ATTRIBUTES_VALUE}
    例:
    https://web.zaico.co.jp/api/v1/inventories/?title=在庫データ&category=物品&place=ZAICO倉庫&code=123456789&optional_attributes_name=担当者&optional_attributes_value=宮下

Example URI

GET https://web.zaico.co.jp/api/v1/inventories
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Link: <https://web.zaico.co.jp/api/v1/inventories?page=1>; rel="first", <https://web.zaico.co.jp/api/v1/inventories?page=前のページ>; rel="prev", <https://web.zaico.co.jp/api/v1/inventories?page=次のページ>; rel="next", <https://web.zaico.co.jp/api/v1/inventories?page=最後のページ>; rel="last"
Total-Count: 在庫データ件数
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "unit": "個",
  "category": "製品",
  "state": "新品",
  "place": "ZAICO倉庫",
  "etc": "備考",
  "group_tag": "グループタグ",
  "code": "tw201800000000",
  "item_image": {
    "url": "itemimageurl"
  },
  "stocktake_attributes": {
    "checked_at": "2018-03-27T09:38:19+09:00"
  },
  "optional_attributes": [
    "name: `追加項目名`",
    "value: `追加項目値`"
  ],
  "quantity_management_attributes": {
    "order_point_quantity": 5
  },
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "",
  "create_user_name": "田村 太郎",
  "update_user_name": "田村 次郎",
  "user_group": "基本グループ"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "在庫データタイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数(フルプランのみ)"
    },
    "unit": {
      "type": "string",
      "description": "単位"
    },
    "category": {
      "type": "string",
      "description": "カテゴリ"
    },
    "state": {
      "type": "string",
      "description": "状態"
    },
    "place": {
      "type": "string",
      "description": "保管場所"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    },
    "group_tag": {
      "type": "string",
      "description": "グループタグ(フルプランのみ)"
    },
    "code": {
      "type": "string",
      "description": "バーコードの値"
    },
    "item_image": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "画像URL"
        }
      }
    },
    "stocktake_attributes": {
      "type": "object",
      "properties": {
        "checked_at": {
          "type": "string",
          "description": "棚卸日"
        }
      }
    },
    "optional_attributes": {
      "type": "array",
      "items": [
        {
          "type": "string"
        },
        {
          "type": "string"
        }
      ]
    },
    "quantity_management_attributes": {
      "type": "object",
      "properties": {
        "order_point_quantity": {
          "type": "number",
          "description": "発注点"
        }
      }
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    },
    "create_user_name": {
      "type": "string",
      "description": "作成者"
    },
    "update_user_name": {
      "type": "string",
      "description": "更新者"
    },
    "user_group": {
      "type": "string",
      "description": "ユーザーグループ"
    }
  }
}

在庫データ作成

POST/api/v1/inventories

処理概要

  • 在庫データを作成します

注意事項

  • タイトルのみあれば作成可能です

  • 画像もつけてデータを作成する場合は、画像をbase64エンコードして送ってください

  • 送られたパラメータにタイトルが無い場合やデータが無い場合はエラーを返します

  • パースできないJSONを送るとエラーを返します

  • 存在しないユーザーグループを送るとエラーを返します

  • 変更履歴のメモも一緒に保存することが可能です。詳しくは下記Bodyをご覧ください

  • 棚卸日はstocktake_attributes: { checked_at: 日付 }で登録・変更が可能です

  • 発注点を設定することも可能です

Example URI

POST https://web.zaico.co.jp/api/v1/inventories
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "title": "在庫データ",
  "quantity": 10,
  "unit": "個",
  "category": "製品",
  "state": "新品",
  "place": "ZAICO倉庫",
  "etc": "備考",
  "group_tag": "グループタグ",
  "user_group": "ユーザーグループ",
  "code": "tw201800000000",
  "item_image": "base64-encoded-image",
  "stocktake_attributes": {
    "checked_at": "2018-03-27T09:38:19+09:00"
  },
  "optional_attributes": [
    "name: `追加項目名`",
    "value: `追加項目値`"
  ],
  "quantity_management_attributes": {
    "order_point_quantity": 5
  },
  "inventory_history": {
    "memo": "変更履歴メモ"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "在庫データタイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "unit": {
      "type": "string",
      "description": "単位"
    },
    "category": {
      "type": "string",
      "description": "カテゴリ"
    },
    "state": {
      "type": "string",
      "description": "状態"
    },
    "place": {
      "type": "string",
      "description": "保管場所"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    },
    "group_tag": {
      "type": "string",
      "description": "グループタグ(フルプランのみ)"
    },
    "user_group": {
      "type": "string",
      "description": "ユーザーグループ(カンマ区切りで複数指定可)"
    },
    "code": {
      "type": "string",
      "description": "バーコードの値"
    },
    "item_image": {
      "type": "string"
    },
    "stocktake_attributes": {
      "type": "object",
      "properties": {
        "checked_at": {
          "type": "string",
          "description": "棚卸日"
        }
      }
    },
    "optional_attributes": {
      "type": "array",
      "items": [
        {
          "type": "string"
        },
        {
          "type": "string"
        }
      ]
    },
    "quantity_management_attributes": {
      "type": "object",
      "properties": {
        "order_point_quantity": {
          "type": "number",
          "description": "発注点"
        }
      }
    },
    "inventory_history": {
      "type": "object",
      "properties": {
        "memo": {
          "type": "string",
          "description": "変更履歴のメモ"
        }
      }
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully created.",
  "data_id": 123456
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "作成した在庫データのID"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 400,
  "status": "error",
  "message": "error message"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 406,
  "status": "error",
  "message": "UserGroup is NOT exist"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

在庫データ個別取得

GET/api/v1/inventories/{id}

処理概要

  • 在庫データを1件のみ取得します

  • 棚卸日は設定されている場合のみ表示されます

  • 発注点は設定されている場合のみ表示されます

注意事項

  • 在庫データが無い場合は404を返します

Example URI

GET https://web.zaico.co.jp/api/v1/inventories/1
URI Parameters
HideShow
id
number (required) Example: 1

在庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "unit": "個",
  "category": "製品",
  "state": "新品",
  "place": "ZAICO倉庫",
  "etc": "備考",
  "group_tag": "グループタグ",
  "code": "tw201800000000",
  "item_image": {
    "url": "itemimageurl"
  },
  "stocktake_attributes": {
    "checked_at": "2018-03-27T09:38:19+09:00"
  },
  "optional_attributes": [
    "name: `追加項目名`",
    "value: `追加項目値`"
  ],
  "quantity_management_attributes": {
    "order_point_quantity": 5
  },
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "",
  "create_user_name": "田村 太郎",
  "update_user_name": "田村 次郎",
  "user_group": "基本グループ"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "在庫データタイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数(フルプランのみ)"
    },
    "unit": {
      "type": "string",
      "description": "単位"
    },
    "category": {
      "type": "string",
      "description": "カテゴリ"
    },
    "state": {
      "type": "string",
      "description": "状態"
    },
    "place": {
      "type": "string",
      "description": "保管場所"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    },
    "group_tag": {
      "type": "string",
      "description": "グループタグ(フルプランのみ)"
    },
    "code": {
      "type": "string",
      "description": "バーコードの値"
    },
    "item_image": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "画像URL"
        }
      }
    },
    "stocktake_attributes": {
      "type": "object",
      "properties": {
        "checked_at": {
          "type": "string",
          "description": "棚卸日"
        }
      }
    },
    "optional_attributes": {
      "type": "array",
      "items": [
        {
          "type": "string"
        },
        {
          "type": "string"
        }
      ]
    },
    "quantity_management_attributes": {
      "type": "object",
      "properties": {
        "order_point_quantity": {
          "type": "number",
          "description": "発注点"
        }
      }
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    },
    "create_user_name": {
      "type": "string",
      "description": "作成者"
    },
    "update_user_name": {
      "type": "string",
      "description": "更新者"
    },
    "user_group": {
      "type": "string",
      "description": "ユーザーグループ"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Inventory not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

在庫データ更新

PUT/api/v1/inventories/{id}

処理概要

  • 特定の在庫データを更新します

注意事項

  • タイトルのみあれば作成可能です

  • 画像もつけてデータを作成する場合は、画像をbase64エンコードして送ってください

  • 該当する在庫データが無い場合はエラーを返します

  • パースできないJSONを送るとエラーを返します

  • 存在しないユーザーグループを送るとエラーを返します

  • 変更履歴のメモも一緒に保存することが可能です。詳しくは下記Bodyをご覧ください

  • 棚卸日はstocktake_attributes: { checked_at: 日付 }で登録・変更が可能です

  • 発注点を設定することも可能です

  • ユーザーグループが未指定または空の場合は場合は更新しません

Example URI

PUT https://web.zaico.co.jp/api/v1/inventories/1
URI Parameters
HideShow
id
number (required) Example: 1

在庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "title": "在庫データ",
  "quantity": 10,
  "unit": "個",
  "category": "製品",
  "state": "新品",
  "place": "ZAICO倉庫",
  "etc": "備考",
  "group_tag": "グループタグ",
  "user_group": "ユーザーグループ",
  "code": "tw201800000000",
  "item_image": "base64-encoded-image",
  "stocktake_attributes": {
    "checked_at": "2018-03-27T09:38:19+09:00"
  },
  "optional_attributes": [
    "name: `追加項目名`",
    "value: `追加項目値`"
  ],
  "quantity_management_attributes": {
    "order_point_quantity": 5
  },
  "inventory_history": {
    "memo": "変更履歴メモ"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "在庫データタイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "unit": {
      "type": "string",
      "description": "単位"
    },
    "category": {
      "type": "string",
      "description": "カテゴリ"
    },
    "state": {
      "type": "string",
      "description": "状態"
    },
    "place": {
      "type": "string",
      "description": "保管場所"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    },
    "group_tag": {
      "type": "string",
      "description": "グループタグ(フルプランのみ)"
    },
    "user_group": {
      "type": "string",
      "description": "ユーザーグループ(カンマ区切りで複数指定可)"
    },
    "code": {
      "type": "string",
      "description": "バーコードの値"
    },
    "item_image": {
      "type": "string"
    },
    "stocktake_attributes": {
      "type": "object",
      "properties": {
        "checked_at": {
          "type": "string",
          "description": "棚卸日"
        }
      }
    },
    "optional_attributes": {
      "type": "array",
      "items": [
        {
          "type": "string"
        },
        {
          "type": "string"
        }
      ]
    },
    "quantity_management_attributes": {
      "type": "object",
      "properties": {
        "order_point_quantity": {
          "type": "number",
          "description": "発注点"
        }
      }
    },
    "inventory_history": {
      "type": "object",
      "properties": {
        "memo": {
          "type": "string",
          "description": "変更履歴のメモ"
        }
      }
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully updated."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 400,
  "status": "error",
  "message": "error message"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Inventory not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 406,
  "status": "error",
  "message": "UserGroup is NOT exist"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

在庫データ削除

DELETE/api/v1/inventories/{id}

処理概要

  • 特定の在庫データを削除します

注意事項

  • 該当する在庫データが無い場合はエラーを返します

Example URI

DELETE https://web.zaico.co.jp/api/v1/inventories/1
URI Parameters
HideShow
id
number (required) Example: 1

在庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully deleted."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Inventory not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

出庫データ

出庫データ一覧取得

出庫データ一覧取得
GET/api/v1/packing_slips/

処理概要

  • 自分のアカウントに登録されている出庫データのすべてを返します

  • 出庫データが1件も無い場合は、空の配列を返します

  • 出庫データが100件以上ある場合はページネーションで分割され、100件ごと出庫データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます。

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは納品一覧でのみ返されます

  • 各出庫データの項目について以下のようになります

    • id : 出庫データID
    • num : 出庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • status : 出庫データの状態
      • 以下の3つのいずれかが設定されています
      • before_delivery : 出庫前
      • during_delivery : 出庫中
      • completed_delivery : 出庫済
    • total_amount : 出庫データの合計金額
    • delivery_date : 出庫日
    • estimated_delivery_date : 出庫予定日
      • この出庫予定日は出庫データの物品のうち、最も早い出庫予定日を表示します
    • memo : 出庫メモ
    • created_at : 出庫データ作成日
    • updated_at : 出庫データ更新日
    • deliveries : 出庫データに登録している在庫データ一覧
      • inventory_id : 在庫データID
      • title : 物品名
      • quantity : 出庫数量
      • box_quantity: まとめ換算数量(基本単位で登録された場合はquantityと同じ値)
      • unit : 単位
      • box_unit : まとめ単位(基本単位で登録された場合はunitと同じ値)
      • unit_snapshot : 単位自動換算情報(まとめ単位で登録された場合のみ)
        • piece_name : 基本単位名
        • box_name : まとめ単位名
        • factor : 換算値
      • unit_price : 納品単価
      • subtotal_amount : 小計(box_quantity x box_unit)
      • status : 状態
        • 以下の2つのどちらかが設定されています
        • before_delivery : 出庫前
        • completed_delivery : 出庫済
      • delivery_date : 出庫日
      • estimated_delivery_date : 出庫予定日
      • etc : 摘要・備考
    • shipping_instruction : 発送情報(フルプラン、かつ設定されている場合のみ表示されます)
      • to_name : 宛名
      • to_name_postfix : 敬称
      • to_zip : 郵便番号
      • to_address : 住所
      • building_name : 建物名・部屋番号
      • to_phone_number : 電話番号
      • shipping_client : 発送元
        • id : 発送元ID
        • name : 名前/会社名
        • zip : 郵便番号
        • address : 住所
        • building_name : 建物名・部屋番号
        • phone_number : 電話番号
      • invoice_type_name : 便指定
      • product_name_on_invoice : 品名
      • freight_handling : 荷扱い
      • freight_handling2 : 荷扱い
      • arrival_date : 希望お届け日
      • arrival_hour : 希望お届け時間帯

Example URI

GET https://web.zaico.co.jp/api/v1/packing_slips/
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 10,
    "num": "100",
    "customer_name": "株式会社ZAICO",
    "status": "completed_delivery",
    "total_amount": 1000,
    "delivery_date": "2019-09-01",
    "estimated_delivery_date": null,
    "created_at": "2018-03-27T09:38:19+09:00",
    "updated_at": "2018-03-27T09:38:19+09:00",
    "deliveries": [
      {
        "inventory_id": 1,
        "title": "掃除機",
        "quantity": 3,
        "unit": "台",
        "unit_price": 100,
        "status": "completed_delivery",
        "delivery_date": "2019-09-01",
        "estimated_delivery_date": null,
        "etc": "黒色"
      },
      {
        "inventory_id": 2,
        "title": "テレビ",
        "quantity": 3,
        "unit": "台",
        "unit_price": 100,
        "status": "completed_delivery",
        "delivery_date": "2019-09-01",
        "estimated_delivery_date": null,
        "etc": ""
      },
      {
        "inventory_id": 3,
        "title": "ビール",
        "quantity": 12,
        "box_quantity": "1",
        "unit": "瓶",
        "box_unit": "箱",
        "unit_price": 100,
        "unit_snapshot": {
          "piece_name": "瓶",
          "box_name": "箱",
          "factor": "12"
        },
        "status": "completed_delivery",
        "delivery_date": "2019-09-01",
        "estimated_delivery_date": null,
        "etc": ""
      }
    ],
    "shipping_instruction": {
      "to_name": "在庫商会",
      "to_name_postfix": "御中",
      "to_zip": "1000101",
      "to_address": "東京都大島町元町",
      "building_name": "ザイコ工場",
      "to_phone_number": "0312341234",
      "shipping_client": {
        "id": 1,
        "name": "発送元A",
        "zip": "1234567",
        "address": "東京都港区",
        "building_name": "港ビル",
        "phone_number": "08012345678"
      },
      "invoice_type_name": "ヤマト 発払い",
      "product_name_on_invoice": "化学薬品",
      "freight_handling": "ワレ物注意",
      "freight_handling2": "下載厳禁",
      "arrival_date": "2023-10-31",
      "arrival_hour": "14〜16時"
    }
  },
  {
    "id": 11,
    "num": "1001",
    "customer_name": "株式会社ZAICO",
    "status": "before_delivery",
    "total_amount": 1000,
    "delivery_date": "2019-09-01",
    "estimated_delivery_date": "2019-09-01",
    "created_at": "2018-03-27T09:38:19+09:00",
    "updated_at": "2018-03-27T09:38:19+09:00",
    "deliveries": [
      {
        "inventory_id": 5,
        "title": "掃除機",
        "quantity": 3,
        "unit": "台",
        "unit_price": 100,
        "status": "completed_delivery",
        "delivery_date": "2019-09-01",
        "estimated_delivery_date": "2019-09-01",
        "etc": ""
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

出庫データ作成

出庫データ作成
POST/api/v1/packing_slips/

処理概要

  • 出庫データを作成します

  • パースできないJSONを送るとエラーを返します

  • 登録できる項目について

    • num : 出庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • status : 出庫データの状態
      • 以下の3つのいずれかを指定してください
      • 出庫前の場合は before_delivery
      • 出庫中の場合は during_delivery
      • 出庫済の場合は completed_delivery
      • 出庫済みを指定した場合は、対象の在庫データの数量を減少します
    • delivery_date : 出庫日
      • statusによって必須かどうか変わります
      • status=completed_delivery
        • delivery_dateが必須
      • status=before_delivery
        • delivery_dateは不要
    • memo : 出庫メモ
    • deliveries : 対象となる在庫データの配列
      • 以下のパラメータを含むオブジェクトを配列の要素とします
        • inventory_id : 在庫データID
        • quantity : 出庫数量
        • unit_price : 納品単価
        • estimated_delivery_date : 出庫予定日
        • etc : 摘要・備考
    • shipping_instruction : 発送情報(フルプランのみ設定できます)
      • to_name : 宛名
      • to_name_postfix : 敬称
      • to_zip : 郵便番号
      • to_address : 住所
      • building_name : 建物名・部屋番号
      • to_phone_number : 電話番号
      • shipping_client_id : 発送元ID
      • invoice_type_name : 便指定
        • 指定可能な値 : ヤマト 発払い ヤマト DM便 ヤマト 着払い ヤマト ネコポス 佐川 元払 佐川 着払 ゆうパケット クリックポスト その他
      • product_name_on_invoice : 品名
      • freight_handling : 荷扱い
        • 指定可能な値 : 指定なし ワレ物注意 下載厳禁 天地無用 精密機器 ナマモノ 水濡厳禁 取扱注意 (※「取扱注意」は佐川のみ)
      • freight_handling2 : 荷扱い
        • 指定可能な値 : 指定なし ワレ物注意 下載厳禁 天地無用 精密機器 ナマモノ 水濡厳禁 取扱注意 (※「取扱注意」は佐川のみ)
      • arrival_date : 希望お届け日
      • arrival_hour : 希望お届け時間帯
        • 指定可能な値 : 指定なし 午前中 14〜16時 16〜18時 18〜20時 19〜21時

Example URI

POST https://web.zaico.co.jp/api/v1/packing_slips/
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "num": "100",
  "customer_name": "株式会社ZAICO",
  "status": "completed_delivery",
  "delivery_date": "2019-09-01",
  "deliveries": [
    {
      "inventory_id": 1,
      "quantity": 3,
      "unit_price": 100,
      "estimated_delivery_date": "2019-09-01"
    }
  ],
  "shipping_instruction": {
    "to_name": "在庫商会",
    "to_name_postfix": "御中",
    "to_zip": "1000101",
    "to_address": "東京都大島町元町",
    "building_name": "ザイコ工場",
    "to_phone_number": "0312341234",
    "shipping_client_id": 123,
    "invoice_type_name": "ヤマト 発払い",
    "product_name_on_invoice": "化学薬品",
    "freight_handling": "ワレ物注意",
    "freight_handling2": "下載厳禁",
    "arrival_date": "2023-10-31",
    "arrival_hour": "14〜16時"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "num": {
      "type": "string",
      "description": "出庫データ番号(ユーザーが任意に設定できる番号)"
    },
    "customer_name": {
      "type": "string",
      "description": "取引先名"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "delivery_date": {
      "type": "string",
      "description": "出庫日"
    },
    "deliveries": {
      "type": "array"
    },
    "shipping_instruction": {
      "type": "object",
      "properties": {
        "to_name": {
          "type": "string",
          "description": "宛名"
        },
        "to_name_postfix": {
          "type": "string",
          "description": "敬称"
        },
        "to_zip": {
          "type": "string",
          "description": "郵便番号"
        },
        "to_address": {
          "type": "string",
          "description": "住所"
        },
        "building_name": {
          "type": "string",
          "description": "建物名・部屋番号"
        },
        "to_phone_number": {
          "type": "string",
          "description": "電話番号"
        },
        "shipping_client_id": {
          "type": "number",
          "description": "発送元ID"
        },
        "invoice_type_name": {
          "type": "string",
          "description": "便指定"
        },
        "product_name_on_invoice": {
          "type": "string",
          "description": "品名"
        },
        "freight_handling": {
          "type": "string",
          "description": "荷扱い"
        },
        "freight_handling2": {
          "type": "string",
          "description": "荷扱い"
        },
        "arrival_date": {
          "type": "string",
          "description": "希望お届け日"
        },
        "arrival_hour": {
          "type": "string",
          "description": "希望お届け時間帯"
        }
      }
    }
  },
  "required": [
    "status",
    "deliveries"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully created.",
  "data_id": 12345
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "作成した出庫データID"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Invalid data."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

出庫データ個別取得

出庫データ個別取得
GET/api/v1/packing_slips/{id}

処理概要

  • 出庫データを1件のみ取得します

  • 出庫データの項目について以下のようになります

    • id : 出庫データID
    • num : 出庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • status : 出庫データの状態
      • 以下の3つのいずれかが設定されています
      • before_delivery : 出庫前
      • during_delivery : 出庫中
      • completed_delivery : 出庫済み
    • total_amount : 出庫データの合計金額
    • delivery_date : 出庫日
    • estimated_delivery_date : 出庫予定日
      • この出庫予定日は出庫データの物品のうち、最も早い出庫予定日を表示します
    • memo : 出庫メモ
    • created_at : 出庫データ作成日
    • updated_at : 出庫データ更新日
    • deliveries : 出庫データに登録している在庫データ一覧
      • inventory_id : 在庫データID
      • title : 物品名
      • quantity : 出庫数量
      • box_quantity: まとめ換算数量(基本単位で登録された場合はquantityと同じ値)
      • unit : 単位
      • box_unit : まとめ単位(基本単位で登録された場合はunitと同じ値)
      • unit_snapshot : 単位自動換算情報(まとめ単位で登録された場合のみ)
        • piece_name : 基本単位名
        • box_name : まとめ単位名
        • factor : 換算値
      • unit_price : 納品単価
      • subtotal_amount : 小計(box_quantity x box_unit)
      • status : 状態
        • 以下の2つのどちらかが設定されています
        • before_delivery : 出庫前
        • completed_delivery : 出庫済み
      • delivery_date : 出庫日
      • estimated_delivery_date : 出庫予定日
      • etc: 摘要・備考
    • shipping_instruction : 発送情報(フルプラン、かつ設定されている場合のみ表示されます)
      • to_name : 宛名
      • to_name_postfix : 敬称
      • to_zip : 郵便番号
      • to_address : 住所
      • building_name : 建物名・部屋番号
      • to_phone_number : 電話番号
      • shipping_client : 発送元
        • id : 発送元ID
        • name : 名前/会社名
        • zip : 郵便番号
        • address : 住所
        • building_name : 建物名・部屋番号
        • phone_number : 電話番号
      • invoice_type_name : 便指定
      • product_name_on_invoice : 品名
      • freight_handling : 荷扱い
      • freight_handling2 : 荷扱い
      • arrival_date : 希望お届け日
      • arrival_hour : 希望お届け時間帯

Example URI

GET https://web.zaico.co.jp/api/v1/packing_slips/1
URI Parameters
HideShow
id
number (required) Example: 1

出庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 10,
  "num": "100",
  "customer_name": "株式会社ZAICO",
  "status": "completed_delivery",
  "total_amount": 1000,
  "delivery_date": "2019-09-01",
  "estimated_delivery_date": "2019-09-01",
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at": "2018-03-27T09:38:19+09:00",
  "deliveries": [
    {
      "inventory_id": 1,
      "title": "掃除機",
      "quantity": 3,
      "unit": "台",
      "unit_price": 100,
      "status": "completed_delivery",
      "delivery_date": "2019-09-01",
      "estimated_delivery_date": null,
      "etc": "白色"
    },
    {
      "inventory_id": 2,
      "title": "テレビ",
      "quantity": 3,
      "unit": "台",
      "unit_price": 100,
      "status": "completed_delivery",
      "delivery_date": "2019-09-01",
      "estimated_delivery_date": "2019-09-01",
      "etc": ""
    }
  ],
  "shipping_instruction": {
    "to_name": "在庫商会",
    "to_name_postfix": "御中",
    "to_zip": "1000101",
    "to_address": "東京都大島町元町",
    "building_name": "ザイコ工場",
    "to_phone_number": "0312341234",
    "shipping_client": {
      "id": 1,
      "name": "発送元A",
      "zip": "1234567",
      "address": "東京都港区",
      "building_name": "港ビル",
      "phone_number": "08012345678"
    },
    "invoice_type_name": "ヤマト 発払い",
    "product_name_on_invoice": "化学薬品",
    "freight_handling": "ワレ物注意",
    "freight_handling2": "下載厳禁",
    "arrival_date": "2023-10-31",
    "arrival_hour": "14〜16時"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "num": {
      "type": "string"
    },
    "customer_name": {
      "type": "string",
      "description": "取引先名"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "total_amount": {
      "type": "number"
    },
    "delivery_date": {
      "type": "string",
      "description": "出庫日"
    },
    "estimated_delivery_date": {
      "type": "string",
      "description": "出庫日"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "deliveries": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "inventory_id": {
              "type": "number"
            },
            "title": {
              "type": "string",
              "description": "物品名"
            },
            "quantity": {
              "type": "number",
              "description": "出庫数量"
            },
            "unit": {
              "type": "string",
              "description": "単位"
            },
            "unit_price": {
              "type": "number",
              "description": "納品単価"
            },
            "status": {
              "type": "string"
            },
            "delivery_date": {
              "type": "string"
            },
            "estimated_delivery_date": {
              "type": [
                "string",
                "null"
              ]
            },
            "etc": {
              "type": "string",
              "description": "摘要・備考"
            }
          }
        },
        {
          "type": "object",
          "properties": {
            "inventory_id": {
              "type": "number"
            },
            "title": {
              "type": "string",
              "description": "物品名"
            },
            "quantity": {
              "type": "number",
              "description": "出庫数量"
            },
            "unit": {
              "type": "string",
              "description": "単位"
            },
            "unit_price": {
              "type": "number",
              "description": "納品単価"
            },
            "status": {
              "type": "string"
            },
            "delivery_date": {
              "type": "string"
            },
            "estimated_delivery_date": {
              "type": [
                "string",
                "null"
              ]
            },
            "etc": {
              "type": "string",
              "description": "摘要・備考"
            }
          }
        }
      ]
    },
    "shipping_instruction": {
      "type": "object",
      "properties": {
        "to_name": {
          "type": "string",
          "description": "宛名"
        },
        "to_name_postfix": {
          "type": "string",
          "description": "敬称"
        },
        "to_zip": {
          "type": "string",
          "description": "郵便番号"
        },
        "to_address": {
          "type": "string",
          "description": "住所"
        },
        "building_name": {
          "type": "string",
          "description": "建物名・部屋番号"
        },
        "to_phone_number": {
          "type": "string",
          "description": "電話番号"
        },
        "shipping_client": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "レコードID"
            },
            "name": {
              "type": "string",
              "description": "名前/会社名"
            },
            "zip": {
              "type": "string",
              "description": "郵便番号"
            },
            "address": {
              "type": "string",
              "description": "住所"
            },
            "building_name": {
              "type": "string",
              "description": "建物名・部屋番号"
            },
            "phone_number": {
              "type": "string",
              "description": "電話番号"
            }
          },
          "description": "発送元"
        },
        "invoice_type_name": {
          "type": "string",
          "description": "便指定"
        },
        "product_name_on_invoice": {
          "type": "string",
          "description": "品名"
        },
        "freight_handling": {
          "type": "string",
          "description": "荷扱い"
        },
        "freight_handling2": {
          "type": "string",
          "description": "荷扱い"
        },
        "arrival_date": {
          "type": "string",
          "description": "希望お届け日"
        },
        "arrival_hour": {
          "type": "string",
          "description": "希望お届け時間帯"
        }
      }
    }
  }
}

出庫データ更新

出庫データ更新
PUT/api/v1/packing_slips/{id}

処理概要

  • 出庫データを更新します

  • パースできないJSONを送るとエラーを返します

  • 項目について

    • num : 出庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • memo : 出庫メモ
    • deliveries : 対象となる在庫データの配列
      • 以下のパラメータを含むオブジェクトを配列の要素とします
        • inventory_id : 在庫データID
          • 在庫データIDは対象の物品を特定するために指定するため、これを更新することはできません
        • quantity : 出庫数量
        • unit_price : 納品単価
        • status : 状態
          • 出庫前在庫を更新するときは before_delivery, during_delivery, completed_delivery を指定できます 出庫前在庫を出庫済に更新すると 対象の在庫データの数量を減少します
          • 出庫済在庫の状態を更新することはできません
        • delivery_date : 出庫日
        • estimated_delivery_date : 出庫予定日
        • etc : 摘要・備考
    • shipping_instruction : 発送情報(フルプランのみ設定できます)
      • to_name : 宛名
      • to_name_postfix : 敬称
      • to_zip : 郵便番号
      • to_address : 住所
      • building_name : 建物名・部屋番号
      • to_phone_number : 電話番号
      • shipping_client_id : 発送元ID
      • invoice_type_name : 便指定
        • 指定可能な値 : ヤマト 発払い ヤマト DM便 ヤマト 着払い ヤマト ネコポス 佐川 元払 佐川 着払 ゆうパケット クリックポスト その他
      • product_name_on_invoice : 品名
      • freight_handling : 荷扱い
        • 指定可能な値 : 指定なし ワレ物注意 下載厳禁 天地無用 精密機器 ナマモノ 水濡厳禁 取扱注意 (※「取扱注意」は佐川のみ)
      • freight_handling2 : 荷扱い
        • 指定可能な値 : 指定なし ワレ物注意 下載厳禁 天地無用 精密機器 ナマモノ 水濡厳禁 取扱注意 (※「取扱注意」は佐川のみ)
      • arrival_date : 希望お届け日
      • arrival_hour : 希望お届け時間帯
        • 指定可能な値 : 指定なし 午前中 14〜16時 16〜18時 18〜20時 19〜21時

Example URI

PUT https://web.zaico.co.jp/api/v1/packing_slips/1
URI Parameters
HideShow
id
number (required) Example: 1

出庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "num": "100",
  "customer_name": "株式会社ZAICO",
  "deliveries": [
    {
      "inventory_id": 1,
      "quantity": 3,
      "unit_price": 100,
      "status": "completed_delivery",
      "delivery_date": "2019-11-11",
      "estimated_delivery_date": "2019-11-11"
    },
    {
      "inventory_id": 2,
      "quantity": 5,
      "unit_price": 100,
      "status": "before_delivery",
      "estimated_delivery_date": "2019-11-11"
    }
  ],
  "shipping_instruction": {
    "to_name": "在庫商会",
    "to_name_postfix": "御中",
    "to_zip": "1000101",
    "to_address": "東京都大島町元町",
    "building_name": "ザイコ工場",
    "to_phone_number": "0312341234",
    "shipping_client_id": 123,
    "invoice_type_name": "ヤマト 発払い",
    "product_name_on_invoice": "化学薬品",
    "freight_handling": "ワレ物注意",
    "freight_handling2": "下載厳禁",
    "arrival_date": "2023-10-31",
    "arrival_hour": "14〜16時"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "num": {
      "type": "string",
      "description": "出庫データ番号(ユーザーが任意に設定できる番号)"
    },
    "customer_name": {
      "type": "string",
      "description": "取引先名"
    },
    "deliveries": {
      "type": "array"
    },
    "shipping_instruction": {
      "type": "object",
      "properties": {
        "to_name": {
          "type": "string",
          "description": "宛名"
        },
        "to_name_postfix": {
          "type": "string",
          "description": "敬称"
        },
        "to_zip": {
          "type": "string",
          "description": "郵便番号"
        },
        "to_address": {
          "type": "string",
          "description": "住所"
        },
        "building_name": {
          "type": "string",
          "description": "建物名・部屋番号"
        },
        "to_phone_number": {
          "type": "string",
          "description": "電話番号"
        },
        "shipping_client_id": {
          "type": "number",
          "description": "発送元ID"
        },
        "invoice_type_name": {
          "type": "string",
          "description": "便指定"
        },
        "product_name_on_invoice": {
          "type": "string",
          "description": "品名"
        },
        "freight_handling": {
          "type": "string",
          "description": "荷扱い"
        },
        "freight_handling2": {
          "type": "string",
          "description": "荷扱い"
        },
        "arrival_date": {
          "type": "string",
          "description": "希望お届け日"
        },
        "arrival_hour": {
          "type": "string",
          "description": "希望お届け時間帯"
        }
      }
    }
  },
  "required": [
    "deliveries"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully created.",
  "data_id": 12345
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "作成した出庫データID"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Invalid data."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

出庫データ削除

出庫データ削除
DELETE/api/v1/packing_slips/{id}

処理概要

  • 特定の出庫データを削除します

  • 出庫データの各物品の状態によって在庫データの取り扱いが変わります

    • 出庫前:変化なし
    • 出庫済:在庫データの数量を出庫数量分だけ戻します

Example URI

DELETE https://web.zaico.co.jp/api/v1/packing_slips/1
URI Parameters
HideShow
id
number (required) Example: 1

出庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully deleted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Packing slip not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

出庫物品データ

出庫物品データ一覧取得

出庫物品データ一覧取得
GET/api/v1/deliveries

処理概要

  • 自分のアカウントに登録されている出庫物品データを返します

  • 出庫物品データが1件も無い場合は、空の配列を返します

  • 出庫物品データが1000件以上ある場合はページネーションで分割され、1000件ごと出庫物品データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは出庫物品一覧でのみ返されます

  • 各出庫物品データの項目について以下のようになります

    • packing_slip_id: 出庫データID,
    • inventory_id: 在庫データID,
    • title: 物品名,
    • quantity: 出庫数量,
    • unit: 単位,
    • unit_price: 出庫単価,
    • status: ステータス,
    • delivery_date: 出庫日,
    • estimated_delivery_date: 出庫予定日,
    • etc: 摘要・備考
    • date_of_issue: 納品書に記載される出庫日,
    • created_at: 登録日時
    • updated_at: 更新日時

Example URI

GET https://web.zaico.co.jp/api/v1/deliveries
URI Parameters
HideShow
status
string (optional) Example: before_delivery, during_delivery, completed_delivery

ステータス

  • start_date: 2019-09-01 (string, optional) - 出庫日がこの日以降

  • end_date: 2019-09-01 (string, optional) - 出庫日がこの日以前

  • page: 1 (number, optional) - ページ番号

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "packing_slip_id": 10,
    "inventory_id": 1,
    "title": "掃除機",
    "quantity": 3,
    "unit": "台",
    "unit_price": 100,
    "status": "completed_delivery",
    "delivery_date": "2021",
    "estimated_delivery_date": "Hello, world!",
    "etc": "Hello, world!",
    "date_of_issue": "2021",
    "created_at": "2023-11-16 11:27:24",
    "updated_at": "2023-11-16 11:27:24"
  },
  {
    "packing_slip_id": 10,
    "inventory_id": 1,
    "title": "掃除機",
    "quantity": 3,
    "unit": "台",
    "unit_price": 100,
    "status": "completed_delivery",
    "delivery_date": "2021",
    "estimated_delivery_date": "Hello, world!",
    "etc": "Hello, world!",
    "date_of_issue": "2021",
    "created_at": "2023-11-16 11:27:24",
    "updated_at": "2023-11-16 11:27:24"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

入庫データ

HOST: https://web.zaico.co.jp/

入庫データ一覧取得

入庫データ一覧取得
GET/api/v1/purchases/

処理概要

  • 自分のアカウントに登録されている入庫データのすべてを返します

  • 入庫データが1件も無い場合は、空の配列を返します

  • 入庫データが1000件以上ある場合はページネーションで分割され、1000件ごと入庫データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは入庫物品一覧でのみ返されます

  • 各入庫データの項目について以下のようになります

    • id : 入庫データID
    • num : 入庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • status : 入庫データの状態
      • 以下の5つのいずれかが設定されています
      • none : なし
      • not_ordered : 発注前
      • ordered : 発注済み
      • purchased : 入庫済
      • quotation_requested : 見積依頼済み
    • total_amount : 入庫データの合計金額
    • purchase_date: 入庫日
    • estimated_purchase_date : 入庫予定日
    • create_user_name : 入庫データ作成者名
    • memo : 入庫メモ
    • created_at : 入庫データ作成日
    • updated_at : 入庫データ更新日
    • purchase_items : 入庫データに登録している在庫データ一覧
      • inventory_id : 在庫データID
      • title : 物品名
      • quantity : 入庫数量
      • box_quantity: まとめ換算数量(基本単位で登録された場合はquantityと同じ値)
      • unit : 単位
      • box_unit : まとめ単位(基本単位で登録された場合はunitと同じ値)
      • unit_snapshot : 単位自動換算情報
        • piece_name : 基本単位名
        • box_name : まとめ単位名
        • factor : 換算値
      • unit_price : 仕入単価
      • subtotal_amount : 小計(box_quantity x box_unit)
      • status : 状態
        • 以下の3つのいずれかが設定されています
        • not_ordered : 発注前
        • ordered : 発注済み
        • purchased : 入庫済み
      • purchase_date: 入庫日
      • estimated_purchase_date : 入庫予定日

Example URI

GET https://web.zaico.co.jp/api/v1/purchases/
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 10,
    "num": "100",
    "customer_name": "株式会社ZAICO",
    "status": "ordered",
    "total_amount": 1000,
    "purchase_date": "null",
    "estimated_purchase_date": "2020-01-01",
    "create_user_name": "在庫太郎",
    "created_at": "2019-12-27T09:38:19+09:00",
    "updated_at": "2019-12-27T09:38:19+09:00",
    "purchase_items": [
      {
        "inventory_id": "1",
        "title": "掃除機",
        "quantity": "3",
        "box_quantity": "3",
        "unit": "台",
        "box_unit": "台",
        "unit_price": "100",
        "status": "ordered",
        "purchase_date": "null",
        "estimated_purchase_date": "2020-01-01"
      },
      {
        "inventory_id": "1",
        "title": "掃除機",
        "quantity": "3",
        "box_quantity": "3",
        "unit": "台",
        "box_unit": "台",
        "unit_price": "100",
        "status": "ordered",
        "purchase_date": "null",
        "estimated_purchase_date": "2020-01-01"
      },
      {
        "inventory_id": "2",
        "title": "ビール",
        "quantity": "12",
        "box_quantity": "1",
        "unit": "瓶",
        "box_unit": "箱",
        "unit_price": "100",
        "unit_snapshot": {
          "piece_name": "瓶",
          "box_name": "箱",
          "factor": "12"
        },
        "status": "ordered",
        "purchase_date": "null",
        "estimated_purchase_date": "2020-01-01"
      }
    ]
  },
  {
    "id": 11,
    "num": "1001",
    "customer_name": "株式会社ZAICO",
    "status": "purchased",
    "total_amount": 1000,
    "purchase_date": "2020-01-01",
    "estimated_purchase_date": "null",
    "create_user_name": "在庫太郎",
    "created_at": "2019-12-27T09:38:19+09:00",
    "updated_at": "2019-12-27T09:38:19+09:00",
    "purchase_items": [
      {
        "inventory_id": "5",
        "title": "掃除機",
        "quantity": "3",
        "unit": "台",
        "unit_price": "100",
        "status": "purchased",
        "purchase_date": "2020-01-01",
        "estimated_purchase_date": "null"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

入庫データ作成

入庫データ作成
POST/api/v1/purchases/

処理概要

  • 入庫データを作成します

  • パースできないJSONを送るとエラーを返します

  • 登録できる項目について

    • num : 入庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • status : 入庫データの状態
      • 以下の5つのいずれかを指定してください
      • なしの場合は none
      • 発注前の場合は not_ordered
      • 発注済みの場合は ordered
      • 入庫済の場合は purchased
      • 見積依頼済みの場合は quotation_requested
      • 入庫済を指定した場合は、対象の在庫データの数量を増加します
    • purchase_date : 入庫日
      • statusによって必須かどうか変わります
      • status=purchased
        • purcahse_dateが必須
      • status=not_ordered
        • purchase_dateは不要
    • memo : 入庫メモ
    • purchase_items : 対象となる在庫データの配列
      • 以下のパラメータを含むオブジェクトを配列の要素とします
        • inventory_id : 在庫データID
        • quantity : 入庫数量
        • unit_price : 仕入単価
        • estimated_purchase_date : 入庫予定日
        • etc : 摘要・備考

Example URI

POST https://web.zaico.co.jp/api/v1/purchases/
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "num": "100",
  "customer_name": "株式会社ZAICO",
  "status": "purchased",
  "purchase_date": "2019-09-01",
  "purchase_items": [
    {
      "inventory_id": 1,
      "quantity": 3,
      "unit_price": 100,
      "estimated_purchase_date": "2019-09-01"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "num": {
      "type": "string",
      "description": "入庫データ番号(ユーザーが任意に設定できる番号)"
    },
    "customer_name": {
      "type": "string",
      "description": "取引先名"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "purchase_date": {
      "type": "string",
      "description": "入庫日"
    },
    "purchase_items": {
      "type": "array"
    }
  },
  "required": [
    "status",
    "purchase_items"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully created.",
  "data_id": 12345
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "作成した入庫データID"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Invalid data."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

入庫データ個別取得

入庫データ個別取得
GET/api/v1/purchases/{id}

処理概要

  • 入庫データを1件のみ取得します

  • 入庫データの項目について以下のようになります

    • id : 入庫データID
    • num : 入庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • status : 入庫データの状態
      • 以下の5つのいずれかが設定されています
      • none : なし
      • not_ordered : 発注前
      • ordered : 発注済み
      • purchased : 入庫済
      • quotation_requested : 見積依頼済み
    • total_amount : 入庫データの合計金額
    • purchase_date : 入庫日
    • estimated_purchase_date : 入庫予定日
      • この入庫予定日は入庫データの物品のうち、最も早い入庫予定日を表示します
    • create_user_name : 入庫データ作成者名
    • memo : 入庫メモ
    • created_at : 入庫データ作成日
    • updated_at : 入庫データ更新日
    • deliveries : 入庫データに登録している在庫データ一覧
      • inventory_id : 在庫データID
      • title : 物品名
      • quantity : 入庫数量
      • box_quantity: まとめ換算数量(基本単位で登録された場合はquantityと同じ値)
      • unit : 単位
      • box_unit : まとめ単位(基本単位で登録された場合はunitと同じ値)
      • unit_snapshot : 単位自動換算情報(まとめ単位で登録された場合のみ)
        • piece_name : 基本単位名
        • box_name : まとめ単位名
        • factor : 換算値
      • unit_price : 仕入単価
      • subtotal_amount : 小計(box_quantity x box_unit)
      • status : 状態
        • 以下の3つのいずれかが設定されています
        • not_ordered : 発注前
        • ordered : 発注済み
        • purchased : 入庫済
      • purchase_date : 入庫日
      • estimated_purchase_date : 入庫予定日
      • etc: 摘要・備考

Example URI

GET https://web.zaico.co.jp/api/v1/purchases/10
URI Parameters
HideShow
id
number (required) Example: 10

入庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 10,
  "num": "100",
  "customer_name": "株式会社ZAICO",
  "status": "purchased",
  "total_amount": 1000,
  "purchase_date": "null",
  "estimated_purchase_date": "2020-01-01",
  "create_user_name": "在庫太郎",
  "created_at": "2019-12-27T09:38:19+09:00",
  "updated_at": "2019-12-27T09:38:19+09:00",
  "purchase_items": [
    {
      "inventory_id": "1",
      "title": "掃除機",
      "quantity": "3",
      "unit": "台",
      "unit_price": "100",
      "status": "purchased",
      "purchase_date": "null",
      "estimated_purchase_date": "2020-01-01"
    },
    {
      "inventory_id": "1",
      "title": "掃除機",
      "quantity": "3",
      "unit": "台",
      "unit_price": "100",
      "status": "purchased",
      "purchase_date": "null",
      "estimated_purchase_date": "2020-01-01"
    },
    {
      "inventory_id": "2",
      "title": "ビール",
      "quantity": "12",
      "box_quantity": "1",
      "unit": "瓶",
      "box_unit": "箱",
      "unit_price": "100",
      "unit_snapshot": {
        "piece_name": "瓶",
        "box_name": "箱",
        "factor": "12"
      },
      "status": "ordered",
      "purchase_date": "null",
      "estimated_purchase_date": "2020-01-01"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "num": {
      "type": "string"
    },
    "customer_name": {
      "type": "string",
      "description": "取引先名"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "total_amount": {
      "type": "number"
    },
    "purchase_date": {
      "type": "string",
      "description": "入庫日"
    },
    "estimated_purchase_date": {
      "type": "string",
      "description": "入庫予定日"
    },
    "create_user_name": {
      "type": "string",
      "description": "入庫データ作成者名"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "purchase_items": {
      "type": "array"
    }
  }
}

入庫データ更新

入庫データ更新
PUT/api/v1/purchases/{id}

処理概要

  • 入庫データを更新します

  • パースできないJSONを送るとエラーを返します

  • 項目について

    • num : 入庫データ番号(ユーザーが任意に設定できる番号)
    • customer_name : 取引先名
    • memo : 入庫メモ
    • purchase_items : 対象となる在庫データの配列
      • 以下のパラメータを含むオブジェクトを配列の要素とします
        • inventory_id : 在庫データID
          • 在庫データIDは対象の物品を特定するために指定するため、これを更新することはできません
        • quantity : 入庫数量
        • unit_price : 仕入単価
        • status : 状態
          • 入庫前在庫を更新するときは none, not_ordered, ordered, purchased, quotation_requested を指定できます 入庫前在庫を入庫済に更新すると 対象の在庫データの数量を増加します
          • 入庫済在庫の状態を更新することはできません
        • purchase_date : 入庫日
        • estimated_purchase_date : 入庫予定日
        • etc : 摘要・備考

Example URI

PUT https://web.zaico.co.jp/api/v1/purchases/1
URI Parameters
HideShow
id
number (required) Example: 1

入庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "num": "100",
  "customer_name": "株式会社ZAICO",
  "purchase_items": [
    {
      "inventory_id": 1,
      "quantity": 3,
      "unit_price": 100,
      "status": "purchased",
      "purchase_date": "2019-11-11",
      "estimated_purchase_date": "2019-11-11"
    },
    {
      "inventory_id": 1,
      "quantity": 3,
      "unit_price": 100,
      "status": "ordered",
      "purchase_date": "2019-11-11",
      "estimated_purchase_date": "2019-11-11"
    },
    {
      "inventory_id": 2,
      "quantity": 5,
      "unit_price": 100,
      "status": "not_ordered",
      "estimated_purchase_date": "2019-11-11"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "num": {
      "type": "string",
      "description": "入庫データ番号(ユーザーが任意に設定できる番号)"
    },
    "customer_name": {
      "type": "string",
      "description": "取引先名"
    },
    "purchase_items": {
      "type": "array"
    }
  },
  "required": [
    "purchase_items"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully created.",
  "data_id": 12345
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "作成した入庫データID"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "Invalid data."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

入庫データ削除

入庫データ削除
DELETE/api/v1/purchases/{id}

処理概要

  • 特定の入庫データを削除します

  • 入庫データの各物品の状態によって在庫データの取り扱いが変わります

    • 入庫前:変化なし
    • 入庫済:在庫データの数量を入庫数量分だけ戻します

Example URI

DELETE https://web.zaico.co.jp/api/v1/purchases/1
URI Parameters
HideShow
id
number (required) Example: 1

入庫データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully deleted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Packing slip not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "状態"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

入庫物品データ

入庫物品データ一覧取得

入庫物品データ一覧取得
GET/api/v1/purchases/items

処理概要

  • 自分のアカウントに登録されている入庫物品データを返します

  • 入庫物品データが1件も無い場合は、空の配列を返します

  • 入庫物品データが1000件以上ある場合はページネーションで分割され、1000件ごと入庫物品データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは入庫物品一覧でのみ返されます

  • 各入庫物品データの項目について以下のようになります

    • purchase_id: 入庫データID,
    • inventory_id: 在庫データID,
    • title: 物品名,
    • quantity: 入庫数量,
    • unit: 単位,
    • unit_price: 仕入単価,
    • status: ステータス,
    • purchase_date: 入庫日,
    • estimated_purchase_date: 入庫予定日,
    • etc: 摘要・備考
    • created_at: 登録日時
    • updated_at: 更新日時

Example URI

GET https://web.zaico.co.jp/api/v1/purchases/items
URI Parameters
HideShow
status
string (optional) Example: none, not_ordered, ordered, purchased, quotation_requested

ステータス

  • start_date: 2019-09-01 (string, optional) - 入庫日がこの日以降

  • end_date: 2019-09-01 (string, optional) - 入庫日がこの日以前

  • page: 1 (number, optional) - ページ番号

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "purchase_id": 10,
    "inventory_id": 1,
    "title": "掃除機",
    "quantity": 3,
    "unit": "台",
    "unit_price": 100,
    "status": "purchased",
    "purchase_date": "2021",
    "estimated_purchase_date": "Hello, world!",
    "etc": "Hello, world!",
    "created_at": "2023-11-16 11:27:24",
    "updated_at": "2023-11-16 11:27:24"
  },
  {
    "purchase_id": 10,
    "inventory_id": 2,
    "title": "りんご",
    "quantity": 10,
    "unit": "個",
    "unit_price": 200,
    "status": "purchased",
    "purchase_date": "2021",
    "estimated_purchase_date": "Hello, world!",
    "etc": "Hello, world!",
    "created_at": "2023-11-16 11:27:24",
    "updated_at": "2023-11-16 11:27:24"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

取引先データ

取引先データ一覧取得

GET/api/v1/customers/

処理概要

  • 自分のアカウントに登録されている取引先データのすべてを返します

  • 取引先データが1件も無い場合は、空の配列を返します

  • 取引先データが1000件以上ある場合はページネーションで分割され、1000件ごと取引先データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます。

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは取引先一覧でのみ返されます

    Ref:
    https://web.zaico.co.jp/api/v1/customers?page=1

Example URI

GET https://web.zaico.co.jp/api/v1/customers/
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Link: <https://web.zaico.co.jp/api/v1/customers?page=1>; rel="first", <https://web.zaico.co.jp/api/v1/customers/api/v1/customers?page=1>; rel="last"
Total-Count: 取引先データ件数
Body
{
  "id": 1,
  "name": "取引先A",
  "email": "zaico@example.com",
  "name_postfix": "様",
  "zip": "1234567",
  "address": "東京都港区",
  "building_name": "港ビル",
  "phone_number": "08012345678",
  "etc": "取引先"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "レコードID"
    },
    "name": {
      "type": "string",
      "description": "取引先名"
    },
    "email": {
      "type": "string",
      "description": "メールアドレス"
    },
    "name_postfix": {
      "type": "string",
      "description": "敬称"
    },
    "zip": {
      "type": "string",
      "description": "郵便番号"
    },
    "address": {
      "type": "string",
      "description": "住所"
    },
    "building_name": {
      "type": "string",
      "description": "建物名・部屋番号"
    },
    "phone_number": {
      "type": "string",
      "description": "電話番号"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    }
  }
}

取引先データ作成

POST/api/v1/customers/

処理概要

  • 取引先データを作成します

  • 名前のみあれば作成可能です

  • 敬称は 様 または 御中が指定可能です

  • パースできないJSONを送るとエラーを返します

Example URI

POST https://web.zaico.co.jp/api/v1/customers/
URI Parameters
HideShow
id
number (required) Example: 1

取引先データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "name": "取引先A",
  "email": "zaico@example.com",
  "name_postfix": "様",
  "zip": "1234567",
  "address": "東京都港区",
  "building_name": "港ビル",
  "phone_number": "08012345678",
  "etc": "取引先"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "取引先名"
    },
    "email": {
      "type": "string",
      "description": "メールアドレス"
    },
    "name_postfix": {
      "type": "string",
      "description": "敬称"
    },
    "zip": {
      "type": "string",
      "description": "郵便番号"
    },
    "address": {
      "type": "string",
      "description": "住所"
    },
    "building_name": {
      "type": "string",
      "description": "建物名・部屋番号"
    },
    "phone_number": {
      "type": "string",
      "description": "電話番号"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully created",
  "data_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "コード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "レコードID"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 400,
  "status": "error",
  "message": "error message"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 422,
  "status": "error",
  "message": "error message"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

取引先データ更新

PUT/api/v1/customers/{id}

処理概要

  • 特定の取引先データを更新します

  • 名前のみあれば作成可能です

  • 敬称は 様 または 御中が指定可能です

  • 該当する取引先データが無い場合はエラーを返します

  • パースできないJSONを送るとエラーを返します

Example URI

PUT https://web.zaico.co.jp/api/v1/customers/1
URI Parameters
HideShow
id
number (required) Example: 1

取引先データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "name": "取引先A",
  "email": "zaico@example.com",
  "name_postfix": "様",
  "zip": "1234567",
  "address": "東京都港区",
  "building_name": "港ビル",
  "phone_number": "08012345678",
  "etc": "取引先"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "取引先名"
    },
    "email": {
      "type": "string",
      "description": "メールアドレス"
    },
    "name_postfix": {
      "type": "string",
      "description": "敬称"
    },
    "zip": {
      "type": "string",
      "description": "郵便番号"
    },
    "address": {
      "type": "string",
      "description": "住所"
    },
    "building_name": {
      "type": "string",
      "description": "建物名・部屋番号"
    },
    "phone_number": {
      "type": "string",
      "description": "電話番号"
    },
    "etc": {
      "type": "string",
      "description": "備考"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully updated",
  "data_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "コード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "レコードID"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 400,
  "status": "error",
  "message": "error message"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Customer not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "コード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

取引先データ削除

DELETE/api/v1/customers/{id}

処理概要

  • 特定の取引先データを削除します

  • 該当する取引先データが無い場合はエラーを返します

Example URI

DELETE https://web.zaico.co.jp/api/v1/customers/1
URI Parameters
HideShow
id
number (required) Example: 1

取引先データのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 200,
  "status": "success",
  "message": "Data was successfully deleted",
  "data_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "コード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    },
    "data_id": {
      "type": "number",
      "description": "レコードID"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "Customer not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "コード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "メッセージ"
    }
  }
}

発送元データ

発送元データ一覧取得

GET/api/v1/shipping_clients/

処理概要

  • フルプランのみ参照できます。

  • 自分のアカウントに登録されている発送元データのすべてを返します

  • 発送元データが1件も無い場合は、空の配列を返します

  • 発送元データが1000件以上ある場合はページネーションで分割され、1000件ごと発送元データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます。

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは発送元一覧でのみ返されます

    Ref:
    https://web.zaico.co.jp/api/v1/shipping_clients?page=1

Example URI

GET https://web.zaico.co.jp/api/v1/shipping_clients/
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Link: <https://web.zaico.co.jp/api/v1/shipping_clients?page=1>; rel="first", <https://web.zaico.co.jp/api/v1/shipping_clients?page=1>; rel="last"
Total-Count: 発送元データ件数
Body
[]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object"
}

在庫グループビューデータ

一覧取得

GET/api/v1/inventory_group_items

処理概要

  • フルプランの方のみ利用可能です

  • 自分のアカウントに登録されている在庫グループビューデータのすべてを返します

  • 在庫データが1件も無い場合は、空の配列を返します

  • 発注点は機能を有効にしている場合のみ表示されます

  • 在庫データが1000件以上ある場合はページネーションで分割され、1000件ごと在庫データを返します

  • 任意のページを取得するにはURLにクエリ「page=」をつけることで取得できます。サンプルプログラムなど詳しくはこちらのページをご覧ください( https://www.zaico.co.jp/2019/03/29/zaico-api-update-get-inventories/ )

  • ページ情報はHTTPヘッダ"Link"に最初のページ、前のページ、次のページ、最後のページそれぞれ,(カンマ)で区切られ返されます。最初のページでは「前のページ」、最後のページでは「次のページ」項目は表示されません

  • Link, Total-Countヘッダは在庫一覧でのみ返されます

  • 条件を指定して検索できます。検索できる項目は「group_value」、「title」の2つです。検索する場合は以下のようにリクエストを送ってください。(下記の例は全部の項目に該当する在庫グループビューデータを検索するものです。必要な項目のクエリを発行ください。)

    • 1つの項目に複数の値をいれて検索することはできません。
    Ref:
    https://web.zaico.co.jp/api/v1/inventory_group_items/?group_value={GROUP_VALUE}&title={TITLE}
    例:
    https://web.zaico.co.jp/api/v1/inventory_group_items/?group_value=SKU-1&title=在庫データ

Example URI

GET https://web.zaico.co.jp/api/v1/inventory_group_items
Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Link: <https://web.zaico.co.jp/api/v1/inventory_group_items?page=1>; rel="first", <https://web.zaico.co.jp/api/v1/inventory_group_items?page=前のページ>; rel="prev", <https://web.zaico.co.jp/api/v1/inventory_group_items?page=次のページ>; rel="next", <https://web.zaico.co.jp/api/v1/inventory_group_items?page=最後のページ>; rel="last"
Total-Count: 在庫グループビューデータ件数
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "order_point_quantity": 10,
  "order_point_warning": false,
  "group_value": "グループタグ",
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "タイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数"
    },
    "order_point_quantity": {
      "type": "number",
      "description": "発注点(発注点機能がONの場合のみ)"
    },
    "order_point_warning": {
      "type": "boolean",
      "description": "発注点の警告ON/OFF(発注点機能がONの場合のみ)"
    },
    "group_value": {
      "type": "string",
      "description": "グループタグ"
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    }
  }
}

個別取得

GET/api/v1/inventory_group_items/{id}

処理概要

  • 在庫グループビューデータを1件のみ取得します

  • 発注点は機能を有効にしている場合のみ表示されます

注意事項

  • 在庫グループビューデータが無い場合は404を返します

Example URI

GET https://web.zaico.co.jp/api/v1/inventory_group_items/1
URI Parameters
HideShow
id
number (required) Example: 1

在庫グループビューデータのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "order_point_quantity": 10,
  "order_point_warning": false,
  "group_value": "グループタグ",
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "タイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数"
    },
    "order_point_quantity": {
      "type": "number",
      "description": "発注点(発注点機能がONの場合のみ)"
    },
    "order_point_warning": {
      "type": "boolean",
      "description": "発注点の警告ON/OFF(発注点機能がONの場合のみ)"
    },
    "group_value": {
      "type": "string",
      "description": "グループタグ"
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "InventoryGroupItem not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

発注点の設定

PUT/api/v1/inventory_group_items/{id}/order_points

処理概要

  • 在庫グループビューデータに対して発注点を設定します

  • 発注点機能を有効にしている場合のみ利用可能です

注意事項

  • 在庫グループビューデータが無い場合は404を返します

Example URI

PUT https://web.zaico.co.jp/api/v1/inventory_group_items/1/order_points
URI Parameters
HideShow
id
number (required) Example: 1

在庫グループビューデータのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Body
{
  "order_point_quantity": "10"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "order_point_quantity": {
      "type": "string",
      "description": "発注点"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "order_point_quantity": 10,
  "order_point_warning": false,
  "group_value": "グループタグ",
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "タイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数"
    },
    "order_point_quantity": {
      "type": "number",
      "description": "発注点(発注点機能がONの場合のみ)"
    },
    "order_point_warning": {
      "type": "boolean",
      "description": "発注点の警告ON/OFF(発注点機能がONの場合のみ)"
    },
    "group_value": {
      "type": "string",
      "description": "グループタグ"
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "InventoryGroupItem not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

発注点の警告ON

POST/api/v1/inventory_group_items/{id}/order_points/warning_on

処理概要

  • 在庫グループビューデータの数量が発注点以下の場合の警告表示状態をONにします。

  • 発注点機能を有効にしている場合のみ利用可能です

注意事項

  • 在庫グループビューデータが無い場合は404を返します

Example URI

POST https://web.zaico.co.jp/api/v1/inventory_group_items/1/order_points/warning_on
URI Parameters
HideShow
id
number (required) Example: 1

在庫グループビューデータのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "order_point_quantity": 10,
  "order_point_warning": false,
  "group_value": "グループタグ",
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "タイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数"
    },
    "order_point_quantity": {
      "type": "number",
      "description": "発注点(発注点機能がONの場合のみ)"
    },
    "order_point_warning": {
      "type": "boolean",
      "description": "発注点の警告ON/OFF(発注点機能がONの場合のみ)"
    },
    "group_value": {
      "type": "string",
      "description": "グループタグ"
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "InventoryGroupItem not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

発注点の警告OFF

POST/api/v1/inventory_group_items/{id}/order_points/warning_off

処理概要

  • 在庫グループビューデータの数量が発注点以下の場合の警告表示状態をOFFにします。

  • 発注点機能を有効にしている場合のみ利用可能です

注意事項

  • 在庫グループビューデータが無い場合は404を返します

Example URI

POST https://web.zaico.co.jp/api/v1/inventory_group_items/1/order_points/warning_off
URI Parameters
HideShow
id
number (required) Example: 1

在庫グループビューデータのID

Request
HideShow
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "在庫データ",
  "quantity": 10,
  "logical_quantity": 10,
  "order_point_quantity": 10,
  "order_point_warning": false,
  "group_value": "グループタグ",
  "created_at": "2018-03-27T09:38:19+09:00",
  "updated_at `2018-03-27T09:38:19+09:00`": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "ID"
    },
    "title": {
      "type": "string",
      "description": "タイトル"
    },
    "quantity": {
      "type": "number",
      "description": "数量"
    },
    "logical_quantity": {
      "type": "number",
      "description": "予定フリー在庫数"
    },
    "order_point_quantity": {
      "type": "number",
      "description": "発注点(発注点機能がONの場合のみ)"
    },
    "order_point_warning": {
      "type": "boolean",
      "description": "発注点の警告ON/OFF(発注点機能がONの場合のみ)"
    },
    "group_value": {
      "type": "string",
      "description": "グループタグ"
    },
    "created_at": {
      "type": "string",
      "description": "作成日"
    },
    "updated_at `2018-03-27T09:38:19+09:00`": {
      "type": "string",
      "description": "更新日"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "code": 404,
  "status": "error",
  "message": "InventoryGroupItem not found"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "ステータスコード"
    },
    "status": {
      "type": "string",
      "description": "ステータス"
    },
    "message": {
      "type": "string",
      "description": "エラー内容"
    }
  }
}

Generated by aglio on 26 Mar 2024