ロジクラ API (1.0)

Download OpenAPI specification:

ロジクラで管理しているデータを外部から利用するためのAPIです。

概要

認証

ロジクラ API は OAuth 2.0 の認可コードフローを使用します。

アプリケーションの登録

API を利用するには、https://logikura.com/oauth/applications にアクセスしてアプリケーションを登録し、クライアント ID とクライアントシークレットを取得してください。

登録時に、アプリケーションが必要とするスコープを選択してください。

スコープ 説明
read データの読み取り
write データの作成・更新

認可コードフロー

1. 認可コードの取得

以下の URL にリダイレクトすると、ロジクラのアクセス許可画面が表示されます。ユーザーが承認すると、認可コードが発行されます。

https://logikura.com/oauth/authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}
パラメーター 説明
response_type code を指定
client_id アプリケーション登録時に取得したクライアント ID
redirect_uri アプリケーション登録時に設定したリダイレクト URI
scope アプリケーション登録時に指定したスコープを + 区切りで指定(例: read+write

ユーザーが承認すると、指定したリダイレクト URI に認可コードが付与されてリダイレクトされます。認可コードの有効期限は 10 分 です。

{REDIRECT_URI}?code={AUTHORIZATION_CODE}

2. アクセストークンの取得

取得した認可コードを使ってアクセストークンとリフレッシュトークンを発行します。

curl --request POST 'https://logikura.com/oauth/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'grant_type=authorization_code&code={AUTHORIZATION_CODE}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}&redirect_uri={REDIRECT_URI}'

レスポンス例:

{
  "access_token": "...",
  "token_type": "Bearer",
  "expires_in": 86400,
  "refresh_token": "...",
  "scope": "read write",
  "created_at": 1234567890
}

3. API リクエスト

取得したアクセストークンを Authorization ヘッダーに指定してリクエストを送信します。

Authorization: Bearer {ACCESS_TOKEN}

例:

curl --request GET 'https://api.logikura.com/api/v1/warehouses' \
  --header 'Authorization: Bearer {ACCESS_TOKEN}'

トークンの更新

アクセストークンの有効期限が切れた場合、リフレッシュトークンを使って新しいアクセストークンを取得できます。

curl --request POST 'https://logikura.com/oauth/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'grant_type=refresh_token&refresh_token={REFRESH_TOKEN}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}'

リフレッシュトークンには 90 日間の有効期限 があります。有効期限が切れた場合は、1. 認可コードの取得 から再度実行してアクセストークンを再発行してください。

リクエスト制限

ロジクラAPIでは1分あたり100回のリクエスト制限を設けています。 リクエスト制限に関する情報はヘッダに含まれています。

ヘッダ名 説明
X-RateLimit-Limit 1分あたりのリクエスト数
X-RateLimit-Remaining リクエスト可能数
X-Rate-Limit-Reset リクエスト数がリセットされるまでの秒数

エラーレスポンス

HTTPステータスコード 種類 原因
401 Unauthorized アクセストークンが不正
404 Not Found リソースが存在しません
422 Unprocessable Entity 不正なパラメーター
499 Too Many Requests リクエスト制限の上限を超えました

ページネーション

リストを返すAPIに関しては応答にLinkヘッダーを追加します。

<https://api.logikura.com/api/v1/path/to?page=1>; rel="prev",
<https://api.logikura.com/api/v1/path/to?page=3>; rel="next"

拠点

拠点一覧

拠点一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "warehouses": [
    ]
}

商品マスター

商品マスター一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "products": [
    ]
}

商品マスター作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (商品)

Responses

Request samples

Content type
application/json
{
  • "product": {
    }
}

Response samples

Content type
application/json
{
  • "product": {
    }
}

商品マスター詳細

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

商品マスターID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Tシャツ",
  • "master_code": "LOGIKURA",
  • "description": "青色",
  • "tax_type_id": 1,
  • "countryCode": "JP",
  • "suppliers": [
    ],
  • "variants": [
    ]
}

商品マスター更新

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

商品マスターID

Request Body schema: application/json
required
required
object (商品)

Responses

Request samples

Content type
application/json
{
  • "product": {
    }
}

Response samples

Content type
application/json
{
  • "product": {
    }
}

種類

種類一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "product_variants": [
    ]
}

種類作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (種類)

Responses

Request samples

Content type
application/json
{
  • "product_variant": {
    }
}

Response samples

Content type
application/json
{
  • "product_varian": {
    }
}

種類詳細

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

種類ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "product_id": 1,
  • "name": "Tシャツ",
  • "product_code": "LOGIKURA-123",
  • "barcode": 2200020050008,
  • "sales_price": 200,
  • "purchase_price": 100,
  • "weight": 100,
  • "weight_unit": "g",
  • "option1": "赤",
  • "option2": "Sサイズ",
  • "option3": "綿",
  • "order_point": 100,
  • "sales_start_date": "2019-01-01"
}

種類更新

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (種類)

Responses

Request samples

Content type
application/json
{
  • "product_variant": {
    }
}

Response samples

Content type
application/json
{
  • "product_variant": {
    }
}

入荷

入荷予定一覧

入荷予定一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "receiving_schedules": [
    ]
}

入荷予定作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object

Responses

Request samples

Content type
application/json
{
  • "receiving_schedule": {
    }
}

Response samples

Content type
application/json
{
  • "receiving_schedule": {
    }
}

入荷予定詳細

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

入荷予定ID

Responses

Response samples

Content type
application/json
{
  • "receiving_schedule": {
    }
}

入荷予定更新

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

入荷予定ID

Request Body schema: application/json
required
required
object

Responses

Request samples

Content type
application/json
{
  • "receiving_schedule": {
    }
}

Response samples

Content type
application/json
{
  • "receiving_schedule": {
    }
}

入荷予定削除

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

入荷予定ID

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

入荷確定

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

入荷予定ID

Responses

Response samples

Content type
application/json
{
  • "receiving_schedule": {
    }
}

入荷履歴詳細

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

入荷履歴ID

Responses

Response samples

Content type
application/json
{
  • "receiving_history": {
    }
}

入荷履歴削除

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

入荷履歴ID

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

入荷履歴一覧

入荷履歴一覧

Authorizations:
OAuth2
query Parameters
received_date_from
string <date>
Example: received_date_from=2020-01-01

指定した入荷日以降の履歴が返されます

received_date_to
string <date>
Example: received_date_to=2020-01-31

指定した入荷日以前の履歴が返されます

Responses

Response samples

Content type
application/json
{
  • "receiving_histories": [
    ]
}

入荷履歴作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object

Responses

Request samples

Content type
application/json
{
  • "receiving_history": {
    }
}

Response samples

Content type
application/json
{
  • "receiving_history": {
    }
}

出荷

出荷予定一覧

出荷予定一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "shipping_schedules": [
    ]
}

出荷予定作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object or null (受注)
required
object (出荷予定)

Responses

Request samples

Content type
application/json
{
  • "sales_order": {
    },
  • "shipping_schedule": {
    }
}

Response samples

Content type
application/json
{
  • "shipping_schedule": {
    }
}

出荷作業開始

Authorizations:
OAuth2
Request Body schema: application/json
required
warehouse_id
required
integer >= 1

拠点ID

Responses

Request samples

Content type
application/json
{
  • "warehouse_id": 1
}

Response samples

Content type
application/json
{
  • "shipping_schedule": {
    }
}

出荷確定

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

出荷予定ID

Responses

Response samples

Content type
application/json
{
  • "shipping_schedule": {
    }
}

出荷予定詳細

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

出荷予定ID

Responses

Response samples

Content type
application/json
{
  • "shipping_schedule": {
    }
}

出荷予定更新

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

出荷予定ID

Request Body schema: application/json
required
required
object or null (受注)
required
object (出荷予定)

Responses

Request samples

Content type
application/json
{
  • "sales_order": {
    },
  • "shipping_schedule": {
    }
}

Response samples

Content type
application/json
{
  • "shipping_schedule": {
    }
}

出荷予定削除

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

出荷予定ID

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

出荷履歴詳細

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

出荷履歴ID

Responses

Response samples

Content type
application/json
{
  • "shipping_history": {
    }
}

出荷履歴一覧

出荷履歴一覧

Authorizations:
OAuth2
query Parameters
shipped_date_from
string <date>
Example: shipped_date_from=2020-01-01

指定した出荷実績日以降の履歴が返されます

shipped_date_to
string <date>
Example: shipped_date_to=2020-01-31

指定した出荷実績以前の履歴が返されます

Responses

Response samples

Content type
application/json
{
  • "shipping_histories": [
    ]
}

出荷履歴作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object or null (受注)
required
object (出荷履歴)

Responses

Request samples

Content type
application/json
{
  • "sales_order": {
    },
  • "shipping_history": {
    }
}

Response samples

Content type
application/json
{
  • "shipping_history": {
    }
}

在庫

在庫詳細取得

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

在庫ID

Responses

Response samples

Content type
application/json
{
  • "stock": {
    }
}

在庫一覧

在庫一覧

Authorizations:
OAuth2
query Parameters
warehouse_id
integer
Example: warehouse_id=1

指定した倉庫の在庫のみが返されます

Responses

Response samples

Content type
application/json
{
  • "inventories": [
    ]
}

在庫作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (在庫)

Responses

Request samples

Content type
application/json
{
  • "inventory": {
    }
}

Response samples

Content type
application/json
{
  • "inventory": {
    }
}

出荷先

出荷先一覧

出荷先一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "consignees": [
    ]
}

出荷先作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (出荷先)

Responses

Request samples

Content type
application/json
{
  • "consignee": {
    }
}

Response samples

Content type
application/json
{
  • "consignee": {
    }
}

出荷先更新

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

出荷先ID

Request Body schema: application/json
required
required
object (出荷先)

Responses

Request samples

Content type
application/json
{
  • "consignee": {
    }
}

Response samples

Content type
application/json
{
  • "consignee": {
    }
}

仕入先

仕入先一覧

仕入先一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "suppliers": [
    ]
}

仕入先作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (出荷先)

Responses

Request samples

Content type
application/json
{
  • "supplier": {
    }
}

Response samples

Content type
application/json
{
  • "consignee": {
    }
}

仕入先更新

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

仕入先ID

Request Body schema: application/json
required
required
object (仕入先)

Responses

Request samples

Content type
application/json
{
  • "supplier": {
    }
}

Response samples

Content type
application/json
{
  • "consignee": {
    }
}

ショップ

ショップ一覧

入荷履歴一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "shops": [
    ]
}

ショップ作成

Authorizations:
OAuth2
Request Body schema: application/json
required
required
object (ショップ)

Responses

Request samples

Content type
application/json
{
  • "shop": {
    }
}

Response samples

Content type
application/json
{
  • "shop": {
    }
}

外部連携

外部連携アカウント一覧

外部連携アカウント一覧

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "external_service_accounts": [
    ]
}

商品の外部サービス連携紐付け作成

Authorizations:
OAuth2
Request Body schema: application/json
required
external_service_account_id
required
integer <integer> >= 1

外部連携アカウントID

product_variant_id
required
integer <integer> >= 1

種類ID

external_service_product_code
required
string

連携先コード

Responses

Request samples

Content type
application/json
{
  • "external_service_account_id": 1,
  • "product_variant_id": 1,
  • "external_service_product_code": "SHOPIFY-PRODUCT-CODE"
}

Response samples

Content type
application/json
{
  • "external_service_product_variant": {
    }
}

商品の外部サービス連携紐付け更新

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

外部連携紐付けID

Request Body schema: application/json
required
external_service_product_code
required
string

連携先コード

Responses

Request samples

Content type
application/json
{
  • "external_service_product_code": "SHOPIFY-PRODUCT-CODE"
}

Response samples

Content type
application/json
{
  • "external_service_product_variant": {
    }
}

商品の外部サービス連携紐付け削除

Authorizations:
OAuth2
path Parameters
id
required
integer <integer> (Id) >= 1
Example: 1

外部連携紐付けID

Responses

Response samples

Content type
application/json
{
  • "external_service_product_variant": {
    }
}