NAV
HTTP JavaScript PHP

Elcart API v1.4.2021009

はじめに

このドキュメントではカートシステムのフロントエンド側APIについて説明します。

ベースURL

ベースURL

https://{カートシステムの設置URL}/cart/api/v1

ベースURL 例:

https://example.com/cart/api/v1

ベースURL設定例

<?php
elcart_set_config([
    'api_base' => 'https://example.com/cart/api/v1',
]);
ElasticCart.load('https://example.com/cart/api/v1').then(function () {
    // ... 処理コード
});

APIは次のURLがベースURLとなります。

通信データ保護のため、全てのAPI通信は必ずHTTPSで行うようにしてください。

レスポンス形式

APIからのレスポンスデータはJSON形式で返されます。

リクエスト形式

POST、PUT等のリクエストでデータを送信する場合は、application/x-www-form-urlencoded にて送信してください。

APIセッション

本APIの注文関連API、顧客関連APIは一部を除いてステートレスではありません。 API利用の際には、Cookieの維持を行う必要があります。 XMLHttpRequestを使用しているのであれば withCredentials オプションを有効にしてください。

フロントエンドライブラリ

APIの利用をより簡易にするため、JavaScript版ライブラリとPHP版ライブラリを用意しています。

PHPライブラリの利用を開始する

{ドキュメントルート}/index.php から呼び出す場合

<?php
require __DIR__  . '/elcart-lib/elcart.php';
elcart_set_config([
    'api_base' => '{APIのベースURL}',
]);

店舗コードを指定する場合

<?php
require __DIR__  . '/elcart-lib/elcart.php';
elcart_set_config([
    'api_base' => '{APIのベースURL}',
    'store_code' => '{店舗コード}',
]);

PHPライブラリのソースコード設置場所を {ドキュメントルート}/elcart-lib/ ディレクトリとします。

カートシステム上に複数の店舗を作成している場合は、 elcart_set_config で店舗コードを指定してください。 指定しない場合は、標準の店舗コード default が設定された状態となります。

elcart_set_config(array $config)

オプション

パラメーター名 型 必須 説明
config array true
> api_base string false カートAPIのベースURL
> store_code string false 店舗コード default: 'default'

JavaScriptライブラリの利用を開始する

<script src="https://{APIホスト名}/js/elcart-vendor.min.js"></script>
<script src="https://{APIホスト名}/framework/elcart.min.js"></script>
<script>
    ElasticCart.load('{APIのベースURL}').then(function () {
        // JavaScriptの処理コードを記述する
    });
</script>

店舗コードを指定する場合

<script src="https://{APIホスト名}/js/elcart-vendor.min.js"></script>
<script src="https://{APIホスト名}/framework/elcart.min.js"></script>
<script>
    ElasticCart.load({
        API_BASE: '{APIのベースURL}',
        STORE_CODE: '{店舗コード}',
     }).then(function () {
        // JavaScriptの処理コードを記述する
    });
</script>

JavaScriptライブラリはAPIサーバーの /js/framework/elcart.min.js として提供されています。 また、実行には /js/elcart-vendor.min.js も必要ですので合わせてロードします。

JavaScriptライブラリは、ElasticCart.loadの呼び出し後にしか使用できません。コード中の、JavaScriptの処理コードを記述する 部分に本ライブラリを利用するコードを記述してください。

カートシステム上に複数の店舗を作成している場合は、ElasticCart.loadで店舗コードを指定してください。 指定しない場合は、標準の店舗コード default が設定された状態となります。

ElasticCart.load(config)

オプション

パラメーター名 型 必須 説明
config string or object false カートAPIのベースURL または 接続設定
> API_BASE string false カートAPIのベースURL
> STORE_CODE string false 店舗コード default: 'default'

商品関連API (Product)

商品の検索

商品の一覧を取得したい場合に使用します。 商品カテゴリ、送料区分、在庫有無による絞り込みが可能です。

GET /products/search.json HTTP/1.1
<?php
$products = elcart_get_products($query = []);
var products = new ElasticCart.Products();
products.search(query, successCallback, errorCallback);

商品コードが food で始まる商品を12件取得する

GET /products/search.json?code=food&limit=12 HTTP/1.1
<?php
$products = elcart_get_products(['code' => 'food', 'limit' => 12]);
var products = new ElasticCart.Products();
products.search({code: 'food', limit: 12}, function (results) {
    // results が該当商品リスト
    // または
    results = products.getData();
});

カテゴリコード gift の商品を15件取得する

GET /products/search.json?category_code=gift&limit=15 HTTP/1.1
<?php
$products = elcart_get_products(['category_code' => 'gift', 'limit' => 15]);
// または
$products = elcart_get_products_by_category('gift', ['limit' => 15]);
var products = new ElasticCart.Products();
products.search({category_code: 'gitf', limit: 15}, function (results) {
    // results が該当商品リスト
    // または
    results = products.getData();
});

送料区分が 冷凍 の商品を20件取得する

GET /products/search.json?shipping_category=冷凍&limit=20 HTTP/1.1
<?php
$products = elcart_get_products(['shipping_category' => '冷凍', 'limit' => 20]);
var products = new ElasticCart.Products();
products.search({shipping_category: '冷凍', limit: 20}, function (results) {
    // results が該当商品リスト
    // または
    results = products.getData();
});

ページング

<?php
$products = elcart_get_products(['code' => 'food', 'limit' => 12]);
// 総該当件数の取得
$products->getMeta()->total;
// 総ページ数の取得
$products->getTotalPages();
// 現在のページの取得
$products->getCurrentPage();
// 次のページが存在するか
$products->hasNext();
// 次のページの商品データを取得
$nextProducts = $products->fetchNext();
// 前のページが存在するか
$products->hasPrev();
// 前のページの商品データを取得
$prevProducts = $products->fetchPrev();
var products = new ElasticCart.Products();
products.search({code: 'food', limit: 12}, function (results) {
    // 総該当件数の取得
    products.getMeta().total;
    // 総ページ数の取得
    products.getMeta().total_pages;
    // 現在のページの取得
    products.getMeta().page;
    // 次のページが存在するか
    products.hasNext();
    // 次のページの商品データを取得
    products.fetchNext(function (nextResults) {
        // nextResults が次の該当商品リスト
    });
    // 前のページが存在するか
    products.hasPrev();
    // 前のページの商品データを取得
    products.fetchPrev(function (prevResults) {
        // prevResults が前の該当商品リスト
    });
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
query query string false 商品コード、商品名、一覧用説明文から検索
code query string false 商品コード
category_code query string false 商品カテゴリコード
in_stock_only query boolean false 在庫有りのみ
shipping_category query string false 送料区分名
limit query integer(int32) false 表示件数
page query integer(int32) false 表示ページ
sort query string false ソート対象
direction query string false ソート方向

オプション値

sort
パラメーター名 値 説明
sort code 商品コード
sort created_at 商品登録日時
sort unit_price_with_tax 商品単価(税込)
sort unit_price_without_tax 商品単価(税抜)
sort shipping_category_id 送料区分ID
direction
パラメーター名 値 説明
direction asc 昇順
direction desc 降順

レスポンス

200 レスポンス

{
  "data": {
    "products": [
      {
        "id": 1,
        "code": "item-001",
        "name": "サンプル商品",
        "unit_price": 1650,
        "unit_price_without_tax": 1500,
        "unit_price_with_tax": 1650,
        "tax_type": 1,
        "description": "説明文説明文説明文説明文",
        "content": "<p>説明文説明文説明文説明文</p>",
        "volume": "123g",
        "subscription_rules_item_discount": null,
        "subscription_rules_first_time_discount": {
          "id": 1,
          "product_id": 1,
          "type": "firstTimeDiscount",
          "discount_with_tax": 1200,
          "discount_without_tax": 0,
          "params": {
              "activate_on_each_subscribe": "1"
          },
          "is_active": true,
          "discount": 1200,
          "tax_type": 1
        },
        "subscription_rules_free_cod": null,
        "subscription_rules_free_shipping": null,
        "stock_remained": 1,
        "enable_shipping_category": {
          "id": 1,
          "name": "常温",
          "default_fee": 1500,
          "enable_shipping_with_other": true,
          "css_class": "-shipping-normal"
        },
        "main_image_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "sub_image1_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "sub_image2_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "sub_image3_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "product_categories": [
          {
            "id": 1,
            "code": "gift",
            "name": "ギフト",
            "product_count": 12,
            "url": "https://example.com/cart/api/v1/products/search?category_code=gift"
          }
        ]
      }
    ]
  },
  "meta": {
    "success": true,
    "has_prev": true,
    "has_next": true,
    "total": 99,
    "total_pages": 12,
    "per_page": 20,
    "page": 2,
    "current": 20,
    "next": "https://example.com/cart/api/v1/products/search?page=3",
    "prev": "https://example.com/cart/api/v1/products/search?page=1"
  }
}
ステータスコード 意味 説明
200 OK 商品情報のリスト

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> products array<Product> 商品情報
>> id integer(int64) ID
>> code string 商品コード
>> name string 商品名
>> unit_price integer 表示単価
>> unit_price_without_tax integer 税抜き単価
>> unit_price_with_tax integer 税込み単価
>> tax_type integer 表示単価の税区分
>> description string 一覧用商品説明文(タグ不可)
>> content string 商品説明文(タグ許可)
>> volume string 内容量
>>subscription_rules_item_discount SubscriptionDiscountRule 定期購入時 割引
>>subscription_rules_first_time_discount SubscriptionDiscountRule 定期購入時 初回割引
>>subscription_rules_free_cod SubscriptionDiscountRule 定期購入時 代引き手数料無料
>>subscription_rules_free_shipping SubscriptionDiscountRule 定期購入時 送料無料
>> stock_remained integer 在庫有無フラグ
>> enable_shipping_category ShippingCategory 送料区分
>>> id integer(int64) ID
>>> name string 送料区分名
>>> default_fee integer 標準送料
>>> enable_shipping_with_other boolean 他区分と同梱可
>>> css_class string 温度区分CSSクラス
>> main_image_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> sub_image1_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> sub_image2_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> sub_image3_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> product_categories ProductCategory 商品カテゴリ
>>> id integer(int64) ID
>>> code string 商品カテゴリコード
>>> name string 商品カテゴリ名
>>> product_count integer(int64) 登録商品点数
>>> url string(url) カテゴリ内商品一覧のURL
プロパティ名 型 説明
meta object
> success boolean レスポンス成功
meta MetaApiPaging メタ情報 ページング
> has_prev boolean 前のページが存在するか
> has_next boolean 次のページが存在するか
> total integer 全件数
> total_pages integer 全ページ数
> per_page integer ページあたり表示件数
> page integer 現在のページ
> current integer 表示件数
> next string(url) 次のページのURL
> prev string(url) 前のページのURL

商品情報の取得

商品コードを指定して商品情報を取得します。

GET /products/{code}.json HTTP/1.1
<?php
$product = elcart_get_product($code);
var products = new ElasticCart.Products();
products.get(code, successCallback, errorCallback);

商品コード item-001 の商品情報を取得

GET /products/item-001.json HTTP/1.1
<?php
$product = elcart_get_product('item-001');
var products = new ElasticCart.Products();
products.get('item-001', function (result) {
    // result が該当商品情報
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
code path string true 商品コード

レスポンス

200 レスポンス

{
  "data": {
    "product": {
      "id": 1,
      "code": "item-001",
      "name": "サンプル商品",
      "unit_price": 1650,
      "unit_price_without_tax": 1500,
      "unit_price_with_tax": 1650,
      "tax_type": 1,
      "description": "説明文説明文説明文説明文",
      "content": "<p>説明文説明文説明文説明文</p>",
      "volume": "123g",
      "subscription_rules_item_discount": null,
      "subscription_rules_first_time_discount": {
        "id": 1,
        "product_id": 1,
        "type": "firstTimeDiscount",
        "discount_with_tax": 1200,
        "discount_without_tax": 0,
        "params": {
            "activate_on_each_subscribe": "1"
        },
        "is_active": true,
        "discount": 1200,
        "tax_type": 1
      },
      "subscription_rules_free_cod": null,
      "subscription_rules_free_shipping": null,
      "stock_remained": 1,
      "enable_shipping_category": {
        "id": 1,
        "name": "常温",
        "default_fee": 1500,
        "enable_shipping_with_other": true,
        "css_class": "-shipping-normal"
      },
      "main_image_url": {
        "original": "https://example.com/cart/api/v1/products/image/1.jpg",
        "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
        "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
        "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
      },
      "sub_image1_url": {
        "original": "https://example.com/cart/api/v1/products/image/1.jpg",
        "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
        "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
        "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
      },
      "sub_image2_url": {
        "original": "https://example.com/cart/api/v1/products/image/1.jpg",
        "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
        "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
        "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
      },
      "sub_image3_url": {
        "original": "https://example.com/cart/api/v1/products/image/1.jpg",
        "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
        "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
        "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
      },
      "product_categories": [
        {
          "id": 1,
          "code": "gift",
          "name": "ギフト",
          "product_count": 12,
          "url": "https://example.com/cart/api/v1/products/search?category_code=gift"
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK 商品情報
404 Not Found 該当商品なし(非公開含む)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> product Product 商品
>> id integer(int64) ID
>> code string 商品コード
>> name string 商品名
>> unit_price integer 表示単価
>> unit_price_without_tax integer 税抜き単価
>> unit_price_with_tax integer 税込み単価
>> tax_type integer 表示単価の税区分
>> description string 一覧用商品説明文(タグ不可)
>> content string 商品説明文(タグ許可)
>> volume string 内容量
>>subscription_rules_item_discount SubscriptionDiscountRule 定期購入時 割引
>>subscription_rules_first_time_discount SubscriptionDiscountRule 定期購入時 初回割引
>>subscription_rules_free_cod SubscriptionDiscountRule 定期購入時 代引き手数料無料
>>subscription_rules_free_shipping SubscriptionDiscountRule 定期購入時 送料無料
>> stock_remained integer 在庫有無フラグ
>> enable_shipping_category ShippingCategory 送料区分
>>> id integer(int64) ID
>>> name string 送料区分名
>>> default_fee integer 標準送料
>>> enable_shipping_with_other boolean 他区分と同梱可
>>> css_class string 温度区分CSSクラス
>> main_image_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> sub_image1_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> sub_image2_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> sub_image3_url ProductImage 商品画像
>>> original string(url) 元サイズ画像URL
>>> thumbnail string(url) サムネイル画像URL
>>> small string(url) 画像(小)URL
>>> large string(url) 画像(大)URL
>> product_categories ProductCategory 商品カテゴリ
>>> id integer(int64) ID
>>> code string 商品カテゴリコード
>>> name string 商品カテゴリ名
>>> product_count integer(int64) 登録商品点数
>>> url string(url) カテゴリ内商品一覧のURL

商品カテゴリの取得

GET /product_categories.json HTTP/1.1
<?php
$productCategories = elcart_get_product_categories();
var products = ElasticCart.Products();
products.categories.fetch(function(results) {
  // results が商品カテゴリリスト
});

レスポンス

200 レスポンス

{
  "data": {
    "productCategories": [
      {
        "id": 1,
        "code": "gift",
        "name": "ギフト",
        "product_count": 12,
        "url": "https://example.com/cart/api/v1/products/search?category_code=gift"
      }
    ]
  }
}
ステータスコード 意味 説明
200 OK 商品カテゴリのリスト

ステータスコード 200

レスポンススキーマ

プロパティ名 型 説明
data object
> productCategories array<ProductCategory> 商品カテゴリリスト
>> id integer(int64) ID
>> code string 商品カテゴリコード
>> name string 商品カテゴリ名
>> product_count integer(int64) 登録商品点数
>> url string(url) カテゴリ内商品一覧のURL

注文関連API (Order)

カートの作成

現在のセッションに対してカートを作成し、商品の追加を可能にします。

既にカートが存在する場合に、この操作を行うと現在のカートは破棄され、新しいカートに置き換わります。

POST /cart/create HTTP/1.1
// カートの作成
var cart = new ElasticCart.Cart();

// カートのリセット
cart.reset();

// 初期化成功時のコールバック指定
var cart = new ElasticCart.Cart({
    onInit: function (response) {
        // 初期化成功時の処理
    },
    onInitFailure: function(requests) {
        // 初期化失敗時の処理
    }
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード

レスポンス

200 レスポンス

{
  "data": {
    "cart": {
      "store_code": "default",
      "key": "12345678abcd5e75ef1f9f5f50c4308ee8bdeacf669f6c372e72a5c9f42edbfc",
      "expires": "2018-12-23T11:22:33+09:00",
      "cart_products": []
    }
  }
}
ステータスコード 意味 説明
200 OK カート情報

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> cart Cart カート
>> store_code string 店舗コード
>> key string KEY
>> expires string(date-time) カートの有効期間
>> cart_products array<CartProduct> カート内商品

カート情報の取得

現在のカート情報を取得します。

GET /cart HTTP/1.1
var cart = new ElasticCart.Cart();
// カート情報の取得
var cartData = cart.getData();
// カート内の総商品数の取得
var count = cart.getItemCount();
// カート内の合計金額の取得
var total = cart.getTotal();
// カート内の指定商品コードの商品情報取得
var cartProduct = cart.getItemByCodeWithParams(code,params = {});

レスポンス

200 レスポンス

{
  "data": {
    "cart": {
      "store_code": "default",
      "key": "12345678abcd5e75ef1f9f5f50c4308ee8bdeacf669f6c372e72a5c9f42edbfc",
      "expires": "2018-12-23T11:22:33+09:00",
      "cart_products": [
        {
          "id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "product": {
            "id": 1,
            "code": "item-001",
            "name": "サンプル商品",
            "unit_price": 1650,
            "unit_price_without_tax": 1500,
            "unit_price_with_tax": 1650,
            "tax_type": 1,
            "description": "説明文説明文説明文説明文",
            "content": "<p>説明文説明文説明文説明文</p>",
            "volume": "123g",
            "stock_remained": 1,
            "enable_shipping_category": {
              "id": 1,
              "name": "常温",
              "default_fee": 1500,
              "enable_shipping_with_other": true,
              "css_class": "-shipping-normal"
            },
            "main_image_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image1_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image2_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image3_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            }
          },
          "discounts": [
            {
              "id": 1,
              "cart_product_id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ],
          "enable_shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          }
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK カート情報
404 Not Found カート未作成

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> cart Cart カート
>> store_code string 店舗コード
>> key string KEY
>> expires string(date-time) カートの有効期間
>> cart_products array<CartProduct> カート内商品
>>> id string(uuid) ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> product Product 商品
>>>> id integer(int64) ID
>>>> code string 商品コード
>>>> name string 商品名
>>>> unit_price integer 表示単価
>>>> unit_price_without_tax integer 税抜き単価
>>>> unit_price_with_tax integer 税込み単価
>>>> tax_type integer 表示単価の税区分 0:外税 1:内税
>>>> description string 一覧用商品説明文(タグ不可)
>>>> content string 商品説明文(タグ許可)
>>>> volume string 内容量
>>>> stock_remained integer 在庫有無フラグ
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス
>>>> main_image_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image1_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image2_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image3_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> discounts Discounts カート内商品値引きリスト
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス

カートへの商品追加

指定商品コードの商品をカートに追加します。

既に同じ商品コードの商品が追加されている場合は、カート内の商品数量を増やします。

POST /cart/{product_code} HTTP/1.1
var cart = new ElasticCart.Cart();
// カートへの商品追加
cart.addItem(productCode);
// 個数を指定して商品を追加
cart.addItemWithAmount(productCode, amount);

// カートへ商品コード`item-001`を追加
cart.addItem('item-001');

リクエストパラメーター

パラメーター名 In 型 必須 説明
product_code path string true 追加対象の商品コード
amount body integer false 商品数量
wrapping_type body string false 熨斗 表書き
wrapping_text body string false 熨斗 名入れ

レスポンス

200 レスポンス

{
  "data": {
    "cart": {
      "store_code": "default",
      "key": "12345678abcd5e75ef1f9f5f50c4308ee8bdeacf669f6c372e72a5c9f42edbfc",
      "expires": "2018-12-23T11:22:33+09:00",
      "cart_products": [
        {
          "id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "product": {
            "id": 1,
            "code": "item-001",
            "name": "サンプル商品",
            "unit_price": 1650,
            "unit_price_without_tax": 1500,
            "unit_price_with_tax": 1650,
            "tax_type": 1,
            "description": "説明文説明文説明文説明文",
            "content": "<p>説明文説明文説明文説明文</p>",
            "volume": "123g",
            "stock_remained": 1,
            "enable_shipping_category": {
              "id": 1,
              "name": "常温",
              "default_fee": 1500,
              "enable_shipping_with_other": true,
              "css_class": "-shipping-normal"
            },
            "main_image_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image1_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image2_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image3_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            }
          },
          "discounts": [
            {
              "id": 1,
              "cart_product_id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ],
          "enable_shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          }
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK カート情報

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> cart Cart カート
>> store_code string 店舗コード
>> key string KEY
>> expires string(date-time) カートの有効期間
>> cart_products array<CartProduct> カート内商品
>>> id string(uuid) ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> product Product 商品
>>>> id integer(int64) ID
>>>> code string 商品コード
>>>> name string 商品名
>>>> unit_price integer 表示単価
>>>> unit_price_without_tax integer 税抜き単価
>>>> unit_price_with_tax integer 税込み単価
>>>> tax_type integer 表示単価の税区分 0:外税 1:内税
>>>> description string 一覧用商品説明文(タグ不可)
>>>> content string 商品説明文(タグ許可)
>>>> volume string 内容量
>>>> stock_remained integer 在庫有無フラグ
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス
>>>> main_image_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image1_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image2_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image3_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> discounts Discounts カート内商品値引きリスト
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス

カート内商品の変更

PUT /cart/{id} HTTP/1.1
var cart = new ElasticCart.Cart();
// カート内商品の変更
cart.editItemById(id, params);

// 例
var cartProduct;
var cart = new ElasticCart.Cart({
  onInit(res) {
    // 商品コード`item-001`で定期購入商品の数量`4`に変更
    cartProduct = res.getItemByCodeWithParams('item-001', {
      subscription: {
        subscription_plan_id: 1 // 定期配送プランID
      }
    });
    cart.editItemById(cartProduct.id, { amount: 4 });

    // 商品コード`item-001`で定期購入ではない商品に熨斗データを追加
    cartProduct = res.getItemByCodeWithParams('item-001');
    cart.editItemById(cartProduct.id, { wrapping_type: '内祝い', wrapping_text: '山田'});
  }
});

カート内商品の数量等を変更します。

リクエストパラメーター

パラメーター名 In 型 必須 説明
id path string true 変更対象のカート内商品ID
amount body integer false 商品数量
wrapping_type body string false 熨斗 表書き
wrapping_text body string false 熨斗 名入れ

レスポンス

200 レスポンス

{
  "data": {
    "cart": {
      "store_code": "default",
      "key": "12345678abcd5e75ef1f9f5f50c4308ee8bdeacf669f6c372e72a5c9f42edbfc",
      "expires": "2018-12-23T11:22:33+09:00",
      "cart_products": [
        {
          "id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "product": {
            "id": 1,
            "code": "item-001",
            "name": "サンプル商品",
            "unit_price": 1650,
            "unit_price_without_tax": 1500,
            "unit_price_with_tax": 1650,
            "tax_type": 1,
            "description": "説明文説明文説明文説明文",
            "content": "<p>説明文説明文説明文説明文</p>",
            "volume": "123g",
            "stock_remained": 1,
            "enable_shipping_category": {
              "id": 1,
              "name": "常温",
              "default_fee": 1500,
              "enable_shipping_with_other": true,
              "css_class": "-shipping-normal"
            },
            "main_image_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image1_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image2_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image3_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            }
          },
          "discounts": [
            {
              "id": 1,
              "cart_product_id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ],
          "enable_shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          }
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK カート情報

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> cart Cart カート
>> store_code string 店舗コード
>> key string KEY
>> expires string(date-time) カートの有効期間
>> cart_products array<CartProduct> カート内商品
>>> id string(uuid) ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> product Product 商品
>>>> id integer(int64) ID
>>>> code string 商品コード
>>>> name string 商品名
>>>> unit_price integer 表示単価
>>>> unit_price_without_tax integer 税抜き単価
>>>> unit_price_with_tax integer 税込み単価
>>>> tax_type integer 表示単価の税区分 0:外税 1:内税
>>>> description string 一覧用商品説明文(タグ不可)
>>>> content string 商品説明文(タグ許可)
>>>> volume string 内容量
>>>> stock_remained integer 在庫有無フラグ
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス
>>>> main_image_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image1_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image2_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image3_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> discounts Discounts カート内商品値引きリスト
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス

カート内商品の削除

DELETE /cart/{id} HTTP/1.1
var cart = new ElasticCart.Cart();
// カート内商品の削除
cart.removeItemById(id);

// 商品コード`item-001`の定期商品を削除
var cartProduct;
var cart = new ElasticCart.Cart({
  onInit(res) {
    cartProduct = res.getItemByCodeWithParams('item-001', {
      subscription: {
        subscription_plan_id: 1 // 定期配送プランID
      }
    });
    cart.removeItemById(cartProduct.id);
  }
});

カートから指定商品を削除します。

リクエストパラメーター

パラメーター名 In 型 必須 説明
id path string true 削除対象のカート内商品ID

レスポンス

200 レスポンス

{
  "data": {
    "cart": {
      "store_code": "default",
      "key": "12345678abcd5e75ef1f9f5f50c4308ee8bdeacf669f6c372e72a5c9f42edbfc",
      "expires": "2018-12-23T11:22:33+09:00",
      "cart_products": [
        {
          "id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "product": {
            "id": 1,
            "code": "item-001",
            "name": "サンプル商品",
            "unit_price": 1650,
            "unit_price_without_tax": 1500,
            "unit_price_with_tax": 1650,
            "tax_type": 1,
            "description": "説明文説明文説明文説明文",
            "content": "<p>説明文説明文説明文説明文</p>",
            "volume": "123g",
            "stock_remained": 1,
            "enable_shipping_category": {
              "id": 1,
              "name": "常温",
              "default_fee": 1500,
              "enable_shipping_with_other": true,
              "css_class": "-shipping-normal"
            },
            "main_image_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image1_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image2_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            },
            "sub_image3_url": {
              "original": "https://example.com/cart/api/v1/products/image/1.jpg",
              "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
              "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
              "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
            }
          },
          "discounts": [
            {
              "id": 1,
              "cart_product_id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ],
          "enable_shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          }
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK カート情報

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> cart Cart カート
>> store_code string 店舗コード
>> key string KEY
>> expires string(date-time) カートの有効期間
>> cart_products array<CartProduct> カート内商品
>>> id string(uuid) ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> product Product 商品
>>>> id integer(int64) ID
>>>> code string 商品コード
>>>> name string 商品名
>>>> unit_price integer 表示単価
>>>> unit_price_without_tax integer 税抜き単価
>>>> unit_price_with_tax integer 税込み単価
>>>> tax_type integer 表示単価の税区分 0:外税 1:内税
>>>> description string 一覧用商品説明文(タグ不可)
>>>> content string 商品説明文(タグ許可)
>>>> volume string 内容量
>>>> stock_remained integer 在庫有無フラグ
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス
>>>> main_image_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image1_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image2_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image3_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> discounts Discounts カート内商品値引きリスト
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス

注文の作成

POST /order/create HTTP/1.1
// 注文の作成
ElasticCart.Order.create(params, successCallback, errorCallback);

// 例
var params = {
    customer_lastname: '山田',
    customer_firstname: '太郎',
    customer_phone: '09011110000',
    customer_postcode: '8100001',
    customer_pref: '福岡県',
    customer_address_city: '福岡市中央区',
    customer_address_street: '天神1-1',
    customer_address_building: 'サンプルビル 305号',
    billing_same_to_customer: true,
    shipping_same_to_billing: true,
    payment_type: 'bank',
};
ElasticCart.Order.create(params, function (order) {
    // 注文作成 成功時の処理
    alert('注文を作成しました。');
}, function (response) {
    // 注文作成 失敗時の処理
    alert('注文の作成に失敗しました。');
});

カート情報から注文を作成します。この時点では注文データの作成のみで、注文は完了していません。

リクエストパラメーター

パラメーター名 In 型 必須 説明
memo body string false 備考
customer_id body integer(int64) false 顧客ID
customer_lastname body string true 注文者 姓
customer_firstname body string false 注文者 名
customer_lastname_kana body string false 注文者 姓カナ
customer_firstname_kana body string false 注文者 名カナ
customer_phone body string true 注文者 電話番号 09000000000
customer_company_name body string false 注文者 会社名・組織名
customer_branch_name body string false 注文者 支店名・部署名
customer_email body string(email) true 注文者 メールアドレス
customer_password body string(password) false 新規顧客パスワード
customer_agree_terms body boolean false 利用規約に同意する
customer_force_register body boolean false 顧客強制登録フラグ
customer_gender body string false 注文者 性別コード
customer_birthday body string(date) false 注文者 生年月日 1990-11-22
customer_accept_send_promotion_email body boolean false プロモーションメール送信許可フラグ
customer_country_code body string false 注文者住所 国コード
customer_postcode body string true 注文者住所 郵便番号 8100001
customer_pref body string true 注文者住所 都道府県
customer_address_city body string true 注文者住所 市区町村
customer_address_street body string true 注文者住所 市区町村以降
customer_address_building body string false 注文者住所 建物名・部屋番号
billing_same_to_customer body boolean true 請求先情報が注文者情報と同一
billing_lastname body string false 請求先 姓
billing_firstname body string false 請求先 名
billing_lastname_kana body string false 請求先 姓カナ
billing_firstname_kana body string false 請求先 名カナ
billing_phone body string false 請求先 電話番号 09000000000
billing_company_name body string false 請求先 会社名・組織名
billing_branch_name body string false 請求先 支店名・部署名
billing_country_code body string false 請求先住所 国コード
billing_postcode body string false 請求先住所 郵便番号 8100001
billing_pref body string false 請求先住所 都道府県
billing_address_city body string false 請求先住所 市区町村
billing_address_street body string false 請求先住所 市区町村以降
billing_address_building body string false 請求先住所 建物名・部屋番号
shipping_same_to_billing body boolean true 配送先情報が注文者情報と同一
shipping_lastname body string false 配送先 姓
shipping_firstname body string false 配送先 名
shipping_lastname_kana body string false 配送先 姓カナ
shipping_firstname_kana body string false 配送先 名カナ
shipping_phone body string false 配送先 電話番号 09000000000
shipping_company_name body string false 配送先 会社名・組織名
shipping_branch_name body string false 配送先 支店名・部署名
shipping_country_code body string false 請求先住所 国コード
shipping_postcode body string false 配送先住所 郵便番号 8100001
shipping_pref body string false 配送先住所 都道府県
shipping_address_city body string false 配送先住所 市区町村
shipping_address_street body string false 配送先住所 市区町村以降
shipping_address_building body string false 配送先住所 建物名・部屋番号
payment_type body string true 支払い方法
card body string false カードトークン(PAY.jp/Stripe)
amazon[access_token] body string false AmazonPay アクセストークン
amazon[order_reference_id] body string false AmazonPay OrderReferenceID
delivery_date body string(date) false 配送希望日 2018-12-23
delivery_time body string false 配送指定時間帯

レスポンス

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_accept_send_promotion_email": true,
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_company_name": "サンプル株式会社",
      "billing_branch_name": "総務部",
      "billing_affiliation": "サンプル株式会社 総務部",
      "billing_postcode": "8100001",
      "billing_country_code": "JP",
      "billing_country": "日本",
      "billing_country_name": "Japan",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_company_name": "サンプル株式会社",
      "shipping_branch_name": "総務部",
      "shipping_affiliation": "サンプル株式会社 総務部",
      "shipping_postcode": "8100001",
      "shipping_country_code": "JP",
      "shipping_country": "日本",
      "shipping_country_name": "Japan",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "adjustment": 0,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "is_customer_cancelable": true,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}

500 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK 注文情報
422 Unprocessable Entity 注文作成失敗(入力エラー)
500 Internal Server Error 注文作成失敗(決済失敗)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> order Order 注文情報
>> id integer(int64) ID
>> store_code string 店舗コード
>> status string 注文状態
>> ordered_at string(date-time) 注文日時
>> shipping_at string(date-time) 出荷日時
>> canceled_at string(date-time) キャンセル日時
>> memo string 備考
>> customer_id integer(int64) 顧客ID
>> customer_lastname string 注文者 姓
>> customer_firstname string 注文者 名
>> customer_lastname_kana string 注文者 姓カナ
>> customer_firstname_kana string 注文者 名カナ
>> customer_phone string 注文者 電話番号
>> customer_company_name string 注文者 会社名・組織名
>> customer_branch_name string 注文者 支店名・部署名
>> customer_affiliation string 注文者 所属
>> customer_email string(email) 注文者 メールアドレス
>> customer_agree_terms boolean 利用規約に同意する
>> customer_force_register boolean 顧客強制登録フラグ
>> customer_accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_postcode string 注文者住所 郵便番号
>> customer_country_code string 注文者住所 国コード
>> customer_country string 注文者住所 国名
>> customer_country_name string 注文者住所 国名(英語名)
>> customer_pref string 注文者住所 都道府県
>> customer_address_city string 注文者住所 市区町村
>> customer_address_street string 注文者住所 市区町村以降
>> customer_address_building string 注文者住所 建物名・部屋番号
>> customer_gender string 注文者 性別コード
>> customer_gender_name string 注文者 性別
>> customer_birthday string(date) 注文者 生年月日
>> customer_fullname string 注文者 氏名
>> customer_fullname_kana string 注文者 氏名カナ
>> billing_same_to_customer boolean 請求先情報が注文者情報と同一
>> billing_lastname string 請求先 姓
>> billing_firstname string 請求先 名
>> billing_lastname_kana string 請求先 姓カナ
>> billing_firstname_kana string 請求先 名カナ
>> billing_phone string 請求先 電話番号
>> billing_company_name string 請求先 会社名・組織名
>> billing_branch_name string 請求先 支店名・部署名
>> billing_affiliation string 請求先 所属
>> billing_postcode string 請求先住所 郵便番号
>> billing_country_code string 請求先住所 国コード
>> billing_country string 請求先住所 国名
>> billing_country_name string 請求先住所 国名(英語名)
>> billing_pref string 請求先住所 都道府県
>> billing_address_city string 請求先住所 市区町村
>> billing_address_street string 請求先住所 市区町村以降
>> billing_address_building string 請求先住所 建物名・部屋番号
>> billing_fullname string 請求先 氏名
>> billing_fullname_kana string 請求先 氏名カナ
>> shipping_same_to_billing boolean 配送先情報が注文者情報と同一
>> shipping_lastname string 配送先 姓
>> shipping_firstname string 配送先 名
>> shipping_lastname_kana string 配送先 姓カナ
>> shipping_firstname_kana string 配送先 名カナ
>> shipping_phone string 配送先 電話番号
>> shipping_company_name string 配送先 会社名・組織名
>> shipping_branch_name string 配送先 支店名・部署名
>> shipping_affiliation string 配送先 所属
>> shipping_postcode string 配送先住所 郵便番号
>> shipping_country_code string 配送先住所 国コード
>> shipping_country string 配送先住所 国名
>> shipping_country_name string 配送先住所 国名(英語名)
>> shipping_pref string 配送先住所 都道府県
>> shipping_address_city string 配送先住所 市区町村
>> shipping_address_street string 配送先住所 市区町村以降
>> shipping_address_building string 配送先住所 建物名・部屋番号
>> shipping_fullname string 配送先 氏名
>> shipping_fullname_kana string 配送先 氏名カナ
>> payment_type string 支払い方法
>> payment_status integer 支払いステータス
>> total integer お支払い金額
>> subtotal integer 商品合計
>> subtotal_discount integer 商品合計値引き
>> subtotal_discounted boolean 商品合計値引き処理済フラグ
>> shipping_cost integer 送料
>> shipping_discount integer 送料値引き
>> shipping_discounted boolean 送料値引き処理済フラグ
>> other_cost integer その他手数料
>> other_cost_discounted boolean その他手数料値引き処理済フラグ
>> adjustment integer 調整金
>> payment_cost integer 支払い手数料
>> payment_cost_discounted boolean 支払い手数料値引き処理済フラグ
>> tax integer 税額
>> tax_type integer 消費税区分
>> tax_calculate_type integer 税額の計算方法
>> tax_rounding_method integer 税額 端数処理方法
>> is_customer_cancelable boolean 顧客側からの注文キャンセル可能フラグ
>> delivery_time string 配送指定時間帯
>> details array<OrderDetail> 注文明細リスト
>>> id integer(int64) ID
>>> order_id integer(int64) 注文ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> tax_rate float 税率(%)
>>> tax_type integer 消費税区分
>>> tax_mark string 税定義表示マーク
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> shipping_category_id integer(int64) 送料区分ID
>>> shipping_category ShippingCategory 送料区分
>>>> id integer(int64) ID
>>>> name string 送料区分名
>>>> default_fee integer 標準送料
>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>> css_class string 温度区分CSSクラス
>>> discounts array<Discounts> 商品値引きリスト
>> taxes array<OrderTax> 税リスト
>>> id integer(int64) ID
>>> tax integer 税額
>>> subtotal integer 対象金額計
>>> discount integer 値引き割当額
>>> tax_rate float 税率
>>> tax_type integer 消費税区分
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> mark integer 税定義表示マーク
>>> description integer 備考文
>> payment_request PaymentRequest 支払いリクエスト
>> subtotal_discounts array<SubtotalDiscounts> 購入金額値引きリスト
>> shipping_discounts array<ShippingDiscount> 送料値引きリスト
>> payment_cost_discounts array<PaymentCostDiscounts> 支払い手数料値引きリスト
>> other_cost_discounts array<OtherCostDiscounts> その他手数料値引きリスト

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

ステータスコード 500

プロパティ名 型 説明
meta FailedPaymentRequestResponse エラーレスポンス(決済失敗)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

注文情報の取得

GET /order HTTP/1.1
ElasticCart.Order.get(function (order) {
    // 注文情報 `order`を使った処理
});

作成された注文情報を取得します。

レスポンス

ステータスコード 意味 説明
200 OK 注文情報
404 Not Found 注文なし

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_accept_send_promotion_email": true,
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_company_name": "サンプル株式会社",
      "billing_branch_name": "総務部",
      "billing_affiliation": "サンプル株式会社 総務部",
      "billing_postcode": "8100001",
      "billing_country_code": "JP",
      "billing_country": "日本",
      "billing_country_name": "Japan",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_company_name": "サンプル株式会社",
      "shipping_branch_name": "総務部",
      "shipping_affiliation": "サンプル株式会社 総務部",
      "shipping_postcode": "8100001",
      "shipping_country_code": "JP",
      "shipping_country": "日本",
      "shipping_country_name": "Japan",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "adjustment": 0,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "is_customer_cancelable": true,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

404 レスポンス

{
    "data": {
        "order": "object",
        "meta": {
            "success": "boolean",
            "message": "string"
        }
    }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> order Order 注文情報
>> id integer(int64) ID
>> store_code string 店舗コード
>> status string 注文状態
>> ordered_at string(date-time) 注文日時
>> shipping_at string(date-time) 出荷日時
>> canceled_at string(date-time) キャンセル日時
>> memo string 備考
>> customer_id integer(int64) 顧客ID
>> customer_lastname string 注文者 姓
>> customer_firstname string 注文者 名
>> customer_lastname_kana string 注文者 姓カナ
>> customer_firstname_kana string 注文者 名カナ
>> customer_phone string 注文者 電話番号
>> customer_company_name string 注文者 会社名・組織名
>> customer_branch_name string 注文者 支店名・部署名
>> customer_affiliation string 注文者 所属
>> customer_email string(email) 注文者 メールアドレス
>> customer_agree_terms boolean 利用規約に同意する
>> customer_force_register boolean 顧客強制登録フラグ
>> customer_accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_postcode string 注文者住所 郵便番号
>> customer_country_code string 注文者住所 国コード
>> customer_country string 注文者住所 国名
>> customer_country_name string 注文者住所 国名(英語名)
>> customer_pref string 注文者住所 都道府県
>> customer_address_city string 注文者住所 市区町村
>> customer_address_street string 注文者住所 市区町村以降
>> customer_address_building string 注文者住所 建物名・部屋番号
>> customer_gender string 注文者 性別コード
>> customer_gender_name string 注文者 性別
>> customer_birthday string(date) 注文者 生年月日
>> customer_fullname string 注文者 氏名
>> customer_fullname_kana string 注文者 氏名カナ
>> billing_same_to_customer boolean 請求先情報が注文者情報と同一
>> billing_lastname string 請求先 姓
>> billing_firstname string 請求先 名
>> billing_lastname_kana string 請求先 姓カナ
>> billing_firstname_kana string 請求先 名カナ
>> billing_phone string 請求先 電話番号
>> billing_company_name string 請求先 会社名・組織名
>> billing_branch_name string 請求先 支店名・部署名
>> billing_affiliation string 請求先 所属
>> billing_postcode string 請求先住所 郵便番号
>> billing_country_code string 請求先住所 国コード
>> billing_country string 請求先住所 国名
>> billing_country_name string 請求先住所 国名(英語名)
>> billing_pref string 請求先住所 都道府県
>> billing_address_city string 請求先住所 市区町村
>> billing_address_street string 請求先住所 市区町村以降
>> billing_address_building string 請求先住所 建物名・部屋番号
>> billing_fullname string 請求先 氏名
>> billing_fullname_kana string 請求先 氏名カナ
>> shipping_same_to_billing boolean 配送先情報が注文者情報と同一
>> shipping_lastname string 配送先 姓
>> shipping_firstname string 配送先 名
>> shipping_lastname_kana string 配送先 姓カナ
>> shipping_firstname_kana string 配送先 名カナ
>> shipping_phone string 配送先 電話番号
>> shipping_company_name string 配送先 会社名・組織名
>> shipping_branch_name string 配送先 支店名・部署名
>> shipping_affiliation string 配送先 所属
>> shipping_postcode string 配送先住所 郵便番号
>> shipping_country_code string 配送先住所 国コード
>> shipping_country string 配送先住所 国名
>> shipping_country_name string 配送先住所 国名(英語名)
>> shipping_pref string 配送先住所 都道府県
>> shipping_address_city string 配送先住所 市区町村
>> shipping_address_street string 配送先住所 市区町村以降
>> shipping_address_building string 配送先住所 建物名・部屋番号
>> shipping_fullname string 配送先 氏名
>> shipping_fullname_kana string 配送先 氏名カナ
>> payment_type string 支払い方法
>> payment_status integer 支払いステータス
>> total integer お支払い金額
>> subtotal integer 商品合計
>> subtotal_discount integer 商品合計値引き
>> subtotal_discounted boolean 商品合計値引き処理済フラグ
>> shipping_cost integer 送料
>> shipping_discount integer 送料値引き
>> shipping_discounted boolean 送料値引き処理済フラグ
>> other_cost integer その他手数料
>> other_cost_discounted boolean その他手数料値引き処理済フラグ
>> adjustment integer 調整金
>> payment_cost integer 支払い手数料
>> payment_cost_discounted boolean 支払い手数料値引き処理済フラグ
>> tax integer 税額
>> tax_type integer 消費税区分
>> tax_calculate_type integer 税額の計算方法
>> tax_rounding_method integer 税額 端数処理方法
>> is_customer_cancelable boolean 顧客側からの注文キャンセル可能フラグ
>> delivery_time string 配送指定時間帯
>> details array<OrderDetail> 注文明細リスト
>>> id integer(int64) ID
>>> order_id integer(int64) 注文ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> tax_rate float 税率(%)
>>> tax_type integer 消費税区分
>>> tax_mark string 税定義表示マーク
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> shipping_category_id integer(int64) 送料区分ID
>>> shipping_category ShippingCategory 送料区分
>>>> id integer(int64) ID
>>>> name string 送料区分名
>>>> default_fee integer 標準送料
>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>> css_class string 温度区分CSSクラス
>>> discounts array<Discounts> 商品値引きリスト
>> taxes array<OrderTax> 税リスト
>>> id integer(int64) ID
>>> tax integer 税額
>>> subtotal integer 対象金額計
>>> discount integer 値引き割当額
>>> tax_rate float 税率
>>> tax_type integer 消費税区分
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> mark integer 税定義表示マーク
>>> description integer 備考文
>> payment_request PaymentRequest 支払いリクエスト
>> subtotal_discounts array<SubtotalDiscounts> 購入金額値引きリスト
>> shipping_discounts array<ShippingDiscount> 送料値引きリスト
>> payment_cost_discounts array<PaymentCostDiscounts> 支払い手数料値引きリスト
>> other_cost_discounts array<OtherCostDiscounts> その他手数料値引きリスト

ステータスコード 404

プロパティ名 型 説明
data object
> order object []
meta MetaNotFoundResponse メタ情報 エラー(データなし)
> success boolean レスポンス成功
> message string エラーメッセージ

注文の確定

POST /order/place_order HTTP/1.1
var order;
// 注文の確定にはあらかじめ、`Order.get` または、 `Order.create` により、注文オブジェクトを取得しておく必要があります。
ElasticCart.Order.get(function (result) {
    order = result;
});
// 注文の確定
order.placeOrder(successCallback, errorCallback);

// 例
order.placeOrder(function (order) {
    // 注文の確定 成功時の処理
    alert('ご注文ありがとうございます。');
}, function (response) {
    // 注文の確定 失敗時の処理
    alert('注文の確定に失敗しました。');
});

作成された注文を確定し、注文を完了します。

注文確定時に、セッションからカート情報、注文情報が削除されます。

レスポンス

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_accept_send_promotion_email": true,
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_company_name": "サンプル株式会社",
      "billing_branch_name": "総務部",
      "billing_affiliation": "サンプル株式会社 総務部",
      "billing_postcode": "8100001",
      "billing_country_code": "JP",
      "billing_country": "日本",
      "billing_country_name": "Japan",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_company_name": "サンプル株式会社",
      "shipping_branch_name": "総務部",
      "shipping_affiliation": "サンプル株式会社 総務部",
      "shipping_postcode": "8100001",
      "shipping_country_code": "JP",
      "shipping_country": "日本",
      "shipping_country_name": "Japan",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "adjustment": 0,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "is_customer_cancelable": true,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}

500 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK 注文情報
422 Unprocessable Entity 注文確定失敗(入力エラー)
500 Internal Server Error 注文確定失敗(決済失敗)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> order Order 注文情報
>> id integer(int64) ID
>> store_code string 店舗コード
>> status string 注文状態
>> ordered_at string(date-time) 注文日時
>> shipping_at string(date-time) 出荷日時
>> canceled_at string(date-time) キャンセル日時
>> memo string 備考
>> customer_id integer(int64) 顧客ID
>> customer_lastname string 注文者 姓
>> customer_firstname string 注文者 名
>> customer_lastname_kana string 注文者 姓カナ
>> customer_firstname_kana string 注文者 名カナ
>> customer_phone string 注文者 電話番号
>> customer_company_name string 注文者 会社名・組織名
>> customer_branch_name string 注文者 支店名・部署名
>> customer_affiliation string 注文者 所属
>> customer_email string(email) 注文者 メールアドレス
>> customer_agree_terms boolean 利用規約に同意する
>> customer_force_register boolean 顧客強制登録フラグ
>> customer_accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_postcode string 注文者住所 郵便番号
>> customer_country_code string 注文者住所 国コード
>> customer_country string 注文者住所 国名
>> customer_country_name string 注文者住所 国名(英語名)
>> customer_pref string 注文者住所 都道府県
>> customer_address_city string 注文者住所 市区町村
>> customer_address_street string 注文者住所 市区町村以降
>> customer_address_building string 注文者住所 建物名・部屋番号
>> customer_gender string 注文者 性別コード
>> customer_gender_name string 注文者 性別
>> customer_birthday string(date) 注文者 生年月日
>> customer_fullname string 注文者 氏名
>> customer_fullname_kana string 注文者 氏名カナ
>> billing_same_to_customer boolean 請求先情報が注文者情報と同一
>> billing_lastname string 請求先 姓
>> billing_firstname string 請求先 名
>> billing_lastname_kana string 請求先 姓カナ
>> billing_firstname_kana string 請求先 名カナ
>> billing_phone string 請求先 電話番号
>> billing_company_name string 請求先 会社名・組織名
>> billing_branch_name string 請求先 支店名・部署名
>> billing_affiliation string 請求先 所属
>> billing_postcode string 請求先住所 郵便番号
>> billing_country_code string 請求先住所 国コード
>> billing_country string 請求先住所 国名
>> billing_country_name string 請求先住所 国名(英語名)
>> billing_pref string 請求先住所 都道府県
>> billing_address_city string 請求先住所 市区町村
>> billing_address_street string 請求先住所 市区町村以降
>> billing_address_building string 請求先住所 建物名・部屋番号
>> billing_fullname string 請求先 氏名
>> billing_fullname_kana string 請求先 氏名カナ
>> shipping_same_to_billing boolean 配送先情報が注文者情報と同一
>> shipping_lastname string 配送先 姓
>> shipping_firstname string 配送先 名
>> shipping_lastname_kana string 配送先 姓カナ
>> shipping_firstname_kana string 配送先 名カナ
>> shipping_phone string 配送先 電話番号
>> shipping_company_name string 配送先 会社名・組織名
>> shipping_branch_name string 配送先 支店名・部署名
>> shipping_affiliation string 配送先 所属
>> shipping_postcode string 配送先住所 郵便番号
>> shipping_country_code string 配送先住所 国コード
>> shipping_country string 配送先住所 国名
>> shipping_country_name string 配送先住所 国名(英語名)
>> shipping_pref string 配送先住所 都道府県
>> shipping_address_city string 配送先住所 市区町村
>> shipping_address_street string 配送先住所 市区町村以降
>> shipping_address_building string 配送先住所 建物名・部屋番号
>> shipping_fullname string 配送先 氏名
>> shipping_fullname_kana string 配送先 氏名カナ
>> payment_type string 支払い方法
>> payment_status integer 支払いステータス
>> total integer お支払い金額
>> subtotal integer 商品合計
>> subtotal_discount integer 商品合計値引き
>> subtotal_discounted boolean 商品合計値引き処理済フラグ
>> shipping_cost integer 送料
>> shipping_discount integer 送料値引き
>> shipping_discounted boolean 送料値引き処理済フラグ
>> other_cost integer その他手数料
>> other_cost_discounted boolean その他手数料値引き処理済フラグ
>> adjustment integer 調整金
>> payment_cost integer 支払い手数料
>> payment_cost_discounted boolean 支払い手数料値引き処理済フラグ
>> tax integer 税額
>> tax_type integer 消費税区分
>> tax_calculate_type integer 税額の計算方法
>> tax_rounding_method integer 税額 端数処理方法
>> is_customer_cancelable boolean 顧客側からの注文キャンセル可能フラグ
>> delivery_time string 配送指定時間帯
>> details array<OrderDetail> 注文明細リスト
>>> id integer(int64) ID
>>> order_id integer(int64) 注文ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> tax_rate float 税率(%)
>>> tax_type integer 消費税区分
>>> tax_mark string 税定義表示マーク
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> shipping_category_id integer(int64) 送料区分ID
>>> shipping_category ShippingCategory 送料区分
>>>> id integer(int64) ID
>>>> name string 送料区分名
>>>> default_fee integer 標準送料
>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>> css_class string 温度区分CSSクラス
>>> discounts array<Discounts> 商品値引きリスト
>> taxes array<OrderTax> 税リスト
>>> id integer(int64) ID
>>> tax integer 税額
>>> subtotal integer 対象金額計
>>> discount integer 値引き割当額
>>> tax_rate float 税率
>>> tax_type integer 消費税区分
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> mark integer 税定義表示マーク
>>> description integer 備考文
>> payment_request PaymentRequest 支払いリクエスト
>> subtotal_discounts array<SubtotalDiscounts> 購入金額値引きリスト
>> shipping_discounts array<ShippingDiscount> 送料値引きリスト
>> payment_cost_discounts array<PaymentCostDiscounts> 支払い手数料値引きリスト
>> other_cost_discounts array<OtherCostDiscounts> その他手数料値引きリスト

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

ステータスコード 500

プロパティ名 型 説明
meta FailedPaymentRequestResponse エラーレスポンス(決済失敗)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

決済待ち注文の取得

見積り後支払いの注文フローにおいて、トークンから決済待ちの注文を取得します。

GET /payment_awaiting_order/exists HTTP/1.1
// 決済待ち注文の有効なトークン
var token = '{有効なトークン}';
ElasticCart.PaymentAwaitingOrder.exists(token, function (order) {
     // 注文情報 `order`を使った処理
}, errorCallback);

リクエストパラメーター

パラメーター名 In 型 必須 説明
token query string true 照会トークン

レスポンス

ステータスコード 意味 説明
200 OK 注文情報

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_accept_send_promotion_email": true,
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_company_name": "サンプル株式会社",
      "billing_branch_name": "総務部",
      "billing_affiliation": "サンプル株式会社 総務部",
      "billing_postcode": "8100001",
      "billing_country_code": "JP",
      "billing_country": "日本",
      "billing_country_name": "Japan",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_company_name": "サンプル株式会社",
      "shipping_branch_name": "総務部",
      "shipping_affiliation": "サンプル株式会社 総務部",
      "shipping_postcode": "8100001",
      "shipping_country_code": "JP",
      "shipping_country": "日本",
      "shipping_country_name": "Japan",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "adjustment": 0,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "is_customer_cancelable": true,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object  
> order Order 注文情報

決済待ち注文の確定

見積り後支払いの注文フローにおいて、決済待ちの注文を確定し、注文を完了します。

POST /payment_awaiting_order/place_order HTTP/1.1
new ElasticCart.PaymentAwaitingOrder.placeOrder({
    token: '{有効な決済待ち注文のトークン}',
    card: '{有効なカードトークン}'
}, function(order) {
    // 注文の確定 成功時の処理
    alert('ご注文ありがとうございます。');
}, function(response) {
    // 注文の確定 失敗時の処理
    alert('注文の確定に失敗しました。');
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
token body string true 照会トークン
card body string false カードトークン(PAY.jp/Stripe)

レスポンス

ステータスコード 意味 説明
200 OK 注文情報
404 Not Found トークン無効
422 Unprocessable Entity 注文確定失敗(入力エラー)

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_accept_send_promotion_email": true,
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_company_name": "サンプル株式会社",
      "billing_branch_name": "総務部",
      "billing_affiliation": "サンプル株式会社 総務部",
      "billing_postcode": "8100001",
      "billing_country_code": "JP",
      "billing_country": "日本",
      "billing_country_name": "Japan",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_company_name": "サンプル株式会社",
      "shipping_branch_name": "総務部",
      "shipping_affiliation": "サンプル株式会社 総務部",
      "shipping_postcode": "8100001",
      "shipping_country_code": "JP",
      "shipping_country": "日本",
      "shipping_country_name": "Japan",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "adjustment": 0,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "is_customer_cancelable": true,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

404 422レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object  
> order Order 注文情報

ステータスコード 404

プロパティ名 型 説明
data object
> disable_dates array [ ]
meta object
> success boolean レスポンス成功
> message string エラーメッセージ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

支払い方法関連API (Payment)

有効な支払い方法リストの取得

GET /settings/enabled_payments HTTP/1.1

リクエストパラメーター

パラメーター名 In 型 必須 説明
payable_background query boolean false 登録済顧客に対してバックグラウンドで決済可能な支払い方法のみを取得(定期購入時等の用途)

レスポンス

200 レスポンス

{
  "data": {
    "bank": "銀行振込",
    "cod": "代金引換",
    "payjp": "カード決済(Payjp)",
    "stripe": "カード決済(Stripe)",
    "np_connect_pro": "NP後払い",
    "amazonpay_cv2": "AmazonPay CV2",
    "amazonpay": "AmazonPay(古いバージョン)"
  }
}
ステータスコード 意味 説明
200 OK 有効な支払い方法リスト

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data EnabledPayments 有効な支払い方法リスト
> bank string 銀行振込
> cod string 代金引換
> payjp string PAY.JP
> stripe string Stripe
> np_connect_pro string NP後払い
> amazonpay_cv2 string AmazonPay CV2
> amazonpay string AmazonPay

PAY.JP設定の取得

GET /payjp/config HTTP/1.1

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード

レスポンス

200 レスポンス

{
  "data": {
    "public": "pk_test_1234567890abcdef12345678"
  }
}
ステータスコード 意味 説明
200 OK PAY.JP設定

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data PayjpConfig PAY.JP設定
> public string 公開APIキー

Stripe設定の取得

GET /stripe/config HTTP/1.1

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード

レスポンス

200 レスポンス

{
  "data": {
    "public": "pk_test_1234567890abcdef12345678"
  }
}
ステータスコード 意味 説明
200 OK Stripe設定

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data StripeConfig Stripe設定
> public string 公開APIキー

AmazonPay CV2設定の取得

GET /amazonpay_cv2/config HTTP/1.1

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード

レスポンス

200 レスポンス

{
  "data": {
    "store_id": "amzn1.application-oa2-client.1234567890abcdef1234567890abcdef",
    "merchant_id": "A2ABCDEFG12345",
    "region": "JP",
    "sandbox": "1"
  }
}
ステータスコード 意味 説明
200 OK AmazonPay設定

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data AmazonpayCv2Config AmazonPay CV2設定
> store_id string Store ID
> merchant_id string 出品者ID
> region string 地域コード
> sandbox string Sandboxフラグ

AmazonPay CV2 ボタン描画用 createCheckoutSessionConfig パラメーター取得

GET /amazonpay_cv2/config/createCheckoutSessionConfig HTTP/1.1

リクエストパラメーター

パラメーター名 In 型 必須 説明
checkoutResultReturnUrl query string true Amazon側での支払い完了後の戻りURL(注文確定待機ページのURL)

レスポンス

200 レスポンス

{
  "data": {
    "merchantId": "string",
    "ledgerCurrency": "JPY",
    "sandbox": true,
    "createCheckoutSessionConfig": {
      "payloadJSON": "string",
      "signature": "string",
      "publicKeyId": "string"
    }
  }
}
ステータスコード 意味 説明
200 OK AmazonPay createCheckoutSessionConfig

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data AmazonpayCv2CreateCheckoutSessionConfigResponse AmazonPay CV2 createCheckoutSessionConfig response
> merchantId string 出品者ID
> ledgerCurrency string 通貨
> sandbox boolean Sandboxフラグ
> createCheckoutSessionConfig AmazonpayCv2ButtonConfig AmazonPay CV2 buttonConfig
>> payloadJSON string payload JSON string
>> signature string 署名
>> publicKeyId string Public Key ID

AmazonPay CV1(古いバージョン)設定の取得

GET /amazon_pay/config HTTP/1.1

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード

レスポンス

200 レスポンス

{
  "data": {
    "client_id": "amzn1.application-oa2-client.1234567890abcdef1234567890abcdef",
    "currency_code": "jpy",
    "merchant_id": "A2ABCDEFG12345",
    "region": "jp",
    "sandbox": "1"
  }
}
ステータスコード 意味 説明
200 OK AmazonPay設定

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data AmazonPayConfig AmazonPay設定
> client_id string クライアントID
> currency_code string 通貨コード
> merchant_id string マーチャントID
> region string 地域コード
> sandbox string Sandboxフラグ

顧客関連API (Customer)

会員登録メールの送信

POST /customer/send_register_mail HTTP/1.1
ElasticCart.Customer.sendRegisterMail(params);

// 例
ElasticCart.Customer.sendRegisterMail({
    customer_email: 'customer@example.com'
}, function () {
    alert('customer@example.com 宛に会員登録のご案内メールを送信しました。');
});

会員登録のためにメールを送信してメールアドレスの認証を行います。

注文確定後に使用できます。

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード
customer_email body string(email) true メールアドレス

レスポンス

200 レスポンス

{
  "success": true
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK メール送信成功
422 Unprocessable Entity メール送信失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
success boolean レスポンス成功

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

トークンを検証する

POST /customer/verify HTTP/1.1
ElasticCart.Customer.verify(params, successCallback, errorCallback);

// クエリストリングからトークンの取得
var queryToken = window.location.search.substring(1).match(/(?:^|&)token=(.+?)(?:&|$)/)[1];
// 会員登録メールのトークンを検証する
ElasticCart.Customer.verify({
    type: 'register_verification',
    token: queryToken
}, function (result) {
    // 認証時の処理
}, function () {
    // 認証失敗時の処理
    alert('不正なトークンです。');
});
// 顧客パスワードの再設定メールのトークンを検証する
ElasticCart.Customer.verify({
    type: 'reset_password',
    token: queryToken
}, function (result) {
    // 認証時の処理
}, function () {
    // 認証失敗時の処理
    alert('不正なトークンです。');
});
// 顧客メールアドレス変更確認メールのトークンを検証する
ElasticCart.Customer.verify({
    type: 'email_verification',
    token: queryToken
}, function (result) {
    // 認証時の処理
    alert('メールアドレスを変更しました。');
}, function () {
    // 認証失敗時の処理
    alert('不正なトークンです。');
});

会員登録時、メールアドレス変更時、パスワード再発行時のトークンパラメーターを検証し、認証トークンを発行します。

会員登録メールアドレス変更時は、このリクエストを行うことでメールアドレスが変更されます。

パラメーター名 In 型 必須 説明
type body string true 認証区分 register_verification, reset_password, email_verification
token body string true リクエストトークン

レスポンス

200 レスポンス

{
  "success": true,
  "token": "string"
}

401 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK トークン検証成功
401 Unauthorized トークン検証失敗

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
success boolean レスポンス成功
token string 認証トークン(4時間有効、会員登録時に使用)

ステータスコード 401

プロパティ名 型 説明
meta UnauthorizedResponse エラーレスポンス(認証失敗)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

顧客ログイン

POST /customer/login HTTP/1.1
ElasticCart.Customer.login(params, successCallback, errorCallback);

// 例
ElasticCart.Customer.login({
    customer_email: 'customer@example.com',
    password: 'pas$w0rd',
    remember_me: false,
}, function (result) {
    alert('ログインしました');
}, function (error) {
    alert('ログインに失敗しました');
});

顧客ログインを行い、顧客情報取得等のAPIを利用可能にします。

リクエストパラメーター

パラメーター名 In 型 必須 説明
customer_email body string(email) true 顧客メールアドレス
password body string(password) true 顧客パスワード
remember_me body boolean false ログインセッションを30日間維持するCookieの発行

レスポンス

200 レスポンス

{
  "success": true,
  "remember_me": "string"
}

401 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK ログイン成功
401 Unauthorized ログイン失敗

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
success boolean レスポンス成功
remember_me string ログインセッションを30日間維持するCookieトークン(リクエスト時にremember_meを指定した場合のみ)

ステータスコード 401

プロパティ名 型 説明
meta UnauthorizedResponse エラーレスポンス(認証失敗)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

顧客ログアウト

POST /customer/logout HTTP/1.1
ElasticCart.Customer.logout(errorCallback);

// 例
ElasticCart.Customer.logout(function () {
    alert('ログアウトに失敗しました。');
});

ログアウトを行い、顧客ログイン状態を解除します。

レスポンス

200 レスポンス

{
  "success": true
}
ステータスコード 意味 説明
200 OK ログアウト成功

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
success boolean レスポンス成功

パスワード再設定メールの送信

POST /customer/send_lostpassword HTTP/1.1
ElasticCart.Customer.sendLostpassword(params, successCallback, errorCallback);

// 例
ElasticCart.Customer.sendLostpassword({
    customer_email: 'customer@example.com'
}, function () {
    alert('パスワードの再設定メールを送信しました。');
});

パスワード再設定のためメールを送信してメールアドレスの認証を行います。

顧客がパスワードを忘れてログインできない場合に使用します。

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード
customer_email body string(email) true メールアドレス

レスポンス

200 レスポンス

{
  "success": true
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK メール送信成功
422 Unprocessable Entity メール送信失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
success boolean レスポンス成功

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

顧客パスワードの再設定

POST /customer/reset_password HTTP/1.1
ElasticCart.Customer.resetPassword(params, successCallback, errorCallback);

// 例
// クエリストリングからトークンの取得(`POST /customer/send_lostpassword` によりメールへ発行されるトークン)
var queryToken = window.location.search.substring(1).match(/(?:^|&)token=(.+?)(?:&|$)/)[1];

ElasticCart.Customer.resetPassword({
    new_password: 'pas$w0rd',
    confirm_password: 'pas$w0rd',
    token: queryToken
}, function () {
    alert('パスワードを再設定しました。');
}, function () {
    alert('パスワードの再設定に失敗しました。');
});

POST /customer/send_lostpassword によりメールへ発行されるトークンが必要です。

リクエストパラメーター

パラメーター名 In 型 必須 説明
new_password body string(password) true 新しい顧客パスワード
confirm_password body string(password) true パスワードの確認入力
token body string true 認証トークン

レスポンス

200 レスポンス

{
  "success": true
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK パスワード再設定成功
422 Unprocessable Entity パスワード再設定失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
success boolean レスポンス成功

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

仮登録状態の顧客情報取得

GET /draft_profile HTTP/1.1
var draftProfile = new ElasticCart.DraftProfile(token);
draftProfile.get(successCallback, errorCallback);

// 例
// クエリストリングからトークンの取得
var queryToken = window.location.search.substring(1).match(/(?:^|&)token=(.+?)(?:&|$)/)[1];
// 会員登録メールのトークンを検証する
ElasticCart.Customer.verify({type: 'register_verification', token: queryToken}, function (result) {
    var draftProfile = new ElasticCart.DraftProfile(result.token);
    draftProfile.get(function (profile) {
        // 取得成功時の処理
    }, function () {
        // 取得失敗時の処理
        alert('取得に失敗しました。');
    });
}, function () {
    // 認証失敗時の処理
    alert('不正なトークンです。');
});

利用には /customer/verify で得られる認証トークンを Authorizationヘッダーまたはtokenクエリストリングにセットする必要があります。

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "1",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK 顧客情報

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer DraftCustomer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

会員情報の仮登録

POST /draft_profile HTTP/1.1
var draftProfile = new ElasticCart.DraftProfile('');
draftProfile.create(params, successCallback, errorCallback);

// 例
// 会員情報の仮登録
draftProfile.create({
    customer_email: 'newuser@example.com',
    customer_lastname: '田中',
    customer_firstname: '花子',
    customer_lastname_kana: 'タナカ',
    customer_firstname_kana: 'ハナコ',
    customer_phone: '07011110000',
    customer_gender: '2',
    customer_birthday: '1990-11-22',
    customer_postcode: '8200003',
    customer_pref: '福岡県',
    customer_address_city: '飯塚市',
    customer_address_street: '立岩3333',
    customer_address_building: 'コーポイイヅカC303',
}, function (profile) {
    // 登録成功時の処理
}, function (results) {
    // 登録失敗時の処理
    alert('会員仮登録に失敗しました。');
});

会員情報を仮登録後、メールを送信してメールアドレスの認証を行います。

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード
customer_lastname body string true 顧客 姓
customer_firstname body string false 顧客 名
customer_lastname_kana body string false 顧客 姓カナ
customer_firstname_kana body string false 顧客 名カナ
customer_email body string true 顧客メールアドレス
customer_phone body string true 顧客 電話番号
customer_company_name body string false 顧客 会社名・組織名
customer_branch_name body string false 顧客 支店名・部署名
customer_postcode body string true 顧客住所 郵便番号
customer_country_code body string false 顧客住所 国コード
customer_pref body string true 顧客住所 都道府県
customer_address_city body string true 顧客住所 市区町村
customer_address_street body string true 顧客住所 市区町村以降
customer_address_building body string false 顧客住所 建物名・部屋番号
customer_gender body string false 顧客 性別コード
customer_birthday body string(date) false 顧客 生年月日 1990-11-22
accept_send_promotion_email body boolean false プロモーションメール送信許可フラグ

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "1",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK 会員仮登録成功
422 Unprocessable Entity 会員仮登録失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

会員情報の本登録

POST /draft_profile/submit HTTP/1.1
var draftProfile = new ElasticCart.DraftProfile(token);
draftProfile.submit(params, successCallback, errorCallback);

// 例
// クエリストリングからトークンの取得
var queryToken = window.location.search.substring(1).match(/(?:^|&)token=(.+?)(?:&|$)/)[1];
var draftProfile;
// 会員登録メールのトークンを検証する
ElasticCart.Customer.verify({type: 'register_verification', token: queryToken}, function (result) {
    draftProfile = new ElasticCart.DraftProfile(result.token);
}, function () {
    // 認証失敗時の処理
    alert('不正なトークンです。');
});
// 会員情報の本登録
draftProfile.submit({
    new_password: 'pas$w0rd',
    confirm_password: 'pas$w0rd',
}, function (profile) {
    // 登録成功時の処理
}, function (results) {
    // 登録失敗時の処理
    alert('会員登録に失敗しました。');
});

仮登録状態の顧客情報に対して、パスワードを設定して本登録状態に変更します。

利用には /customer/verify で得られる認証トークンを Authorizationヘッダーまたはtokenクエリストリングにセットする必要があります。

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード
new_password body string(password) true 新しい顧客パスワード
confirm_password body string(password) true パスワードの確認入力

レスポンス

200 レスポンス

{
  "success": true,
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK 会員登録成功
422 Unprocessable Entity 会員登録失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

顧客情報取得

GET /profile HTTP/1.1
var profile = new ElasticCart.Profile();
profile.get(successCallback, errorCallback);

// 例
profile.get(function (data) {
    // 顧客情報取得成功時の処理
}, function (error) {
    alert('お客様情報の取得に失敗しました。');
});

現在のセッションでログイン中の顧客情報を取得します。

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}
ステータスコード 意味 説明
200 OK 顧客情報

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

顧客情報の更新

PUT /profile HTTP/1.1
var profile = new ElasticCart.Profile();
profile.edit(params, successCallback, errorCallback);

// 例
var params = {
    customer_phone: '08022220000',
};
profile.edit(params, function (data) {
    // 顧客情報 更新成功時の処理
    alert('お客様情報を更新しました。');
}, function (error) {
    alert('お客様情報の更新に失敗しました。');
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
customer_lastname body string false 顧客 姓
customer_firstname body string false 顧客 名
customer_lastname_kana body string false 顧客 姓カナ
customer_firstname_kana body string false 顧客 名カナ
customer_phone body string false 顧客 電話番号
customer_company_name body string false 顧客 会社名・組織名
customer_branch_name body string false 顧客 支店名・部署名
customer_gender body string false 顧客 性別コード
customer_birthday body string(date) false 顧客 生年月日 1990-11-22
customer_postcode body string false 顧客住所 郵便番号
customer_country_code body string false 顧客住所 国コード
customer_pref body string false 顧客住所 都道府県
customer_address_city body string false 顧客住所 市区町村
customer_address_street body string false 顧客住所 市区町村以降
customer_address_building body string false 顧客住所 建物名・部屋番号

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}

422 レスポンス

{
    "message": "string",
    "inputs": "object",
    "errors": "object"
}
ステータスコード 意味 説明
200 OK 顧客情報更新成功
422 Unprocessable Entity 顧客情報更新失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

購入履歴の取得

GET /profile/orders HTTP/1.1
var profile = new ElasticCart.Profile();
profile.orders.get(successCallback, errorCallback);

// 例
profile.orders.get(function (results) {
    // 購入履歴の取得成功時の処理
}, function (error) {
    alert('購入履歴の取得に失敗しました。');
});

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    },
    "orders": [
      {
        "id": 1,
        "store_code": "default",
        "status": "draft",
        "ordered_at": "2018-12-23T11:22:33+09:00",
        "shipping_at": "2018-12-23T11:22:33+09:00",
        "canceled_at": "2018-12-23T11:22:33+09:00",
        "memo": "",
        "customer_id": 1,
        "customer_lastname": "山田",
        "customer_firstname": "太郎",
        "customer_lastname_kana": "ヤマダ",
        "customer_firstname_kana": "タロウ",
        "customer_phone": "09011110000",
        "customer_company_name": "サンプル株式会社",
        "customer_branch_name": "総務部",
        "customer_affiliation": "サンプル株式会社 総務部",
        "customer_email": "customer@example.com",
        "customer_agree_terms": true,
        "customer_force_register": true,
        "customer_accept_send_promotion_email": true,
        "customer_postcode": "8100001",
        "customer_country_code": "JP",
        "customer_country": "日本",
        "customer_country_name": "Japan",
        "customer_pref": "福岡県",
        "customer_address_city": "福岡市中央区",
        "customer_address_street": "天神1-2",
        "customer_address_building": "サンプルビル305",
        "customer_gender": "2",
        "customer_gender_name": "女性",
        "customer_birthday": "1980-08-09",
        "customer_fullname": "山田 太郎",
        "customer_fullname_kana": "ヤマダ タロウ",
        "billing_same_to_customer": true,
        "billing_lastname": "山田",
        "billing_firstname": "太郎",
        "billing_lastname_kana": "ヤマダ",
        "billing_firstname_kana": "タロウ",
        "billing_phone": "09011110000",
        "billing_company_name": "サンプル株式会社",
        "billing_branch_name": "総務部",
        "billing_affiliation": "サンプル株式会社 総務部",
        "billing_postcode": "8100001",
        "billing_country_code": "JP",
        "billing_country": "日本",
        "billing_country_name": "Japan",
        "billing_pref": "福岡県",
        "billing_address_city": "福岡市中央区",
        "billing_address_street": "天神1-2",
        "billing_address_building": "サンプルビル305",
        "billing_fullname": "山田 太郎",
        "billing_fullname_kana": "ヤマダ タロウ",
        "shipping_same_to_billing": true,
        "shipping_lastname": "山田",
        "shipping_firstname": "太郎",
        "shipping_lastname_kana": "ヤマダ",
        "shipping_firstname_kana": "タロウ",
        "shipping_phone": "09011110000",
        "shipping_company_name": "サンプル株式会社",
        "shipping_branch_name": "総務部",
        "shipping_affiliation": "サンプル株式会社 総務部",
        "shipping_postcode": "8100001",
        "shipping_country_code": "JP",
        "shipping_country": "日本",
        "shipping_country_name": "Japan",
        "shipping_pref": "福岡県",
        "shipping_address_city": "福岡市中央区",
        "shipping_address_street": "天神1-2",
        "shipping_address_building": "サンプルビル305",
        "shipping_fullname": "山田 太郎",
        "shipping_fullname_kana": "ヤマダ タロウ",
        "payment_type": "bank",
        "payment_status": 0,
        "total": 11660,
        "subtotal": 10000,
        "subtotal_discount": 0,
        "subtotal_discounted": true,
        "shipping_cost": 560,
        "shipping_discount": 0,
        "shipping_discounted": true,
        "other_cost": 0,
        "other_cost_discounted": true,
        "adjustment": 0,
        "payment_cost": 300,
        "payment_cost_discounted": true,
        "tax": 800,
        "tax_type": 2,
        "tax_calculate_type": 2,
        "tax_rounding_method": 1,
        "is_customer_cancelable": true,
        "delivery_time": "00",
        "details": [
          {
            "id": 1,
            "order_id": 1,
            "product_id": 1,
            "code": "item-001",
            "name": "サンプル商品",
            "unit_price": 1500,
            "amount": 2,
            "price": 3000,
            "discount": 200,
            "discounted": true,
            "actual_price": 2800,
            "tax_rate": 10,
            "tax_type": 1,
            "tax_mark": "*",
            "tax_calculate_type": 2,
            "tax_rounding_method": 1,
            "wrapping_type": "内祝い",
            "wrapping_text": "山田 太郎",
            "shipping_category_id": 1,
            "shipping_category": {
              "id": 1,
              "name": "常温",
              "default_fee": 1500,
              "enable_shipping_with_other": true,
              "css_class": "-shipping-normal"
            },
            "discounts": [
              {
                "id": 1,
                "order_id": 1,
                "order_detail_id": 1,
                "target": "item",
                "target_name": "商品値引き",
                "priority": 10,
                "name": "初回購入割引",
                "discount": 300
              }
            ],
            "product": {
              "id": 1,
              "code": "item-001",
              "name": "サンプル商品",
              "unit_price": 1650,
              "unit_price_without_tax": 1500,
              "unit_price_with_tax": 1650,
              "tax_type": 1,
              "description": "説明文説明文説明文説明文",
              "content": "<p>説明文説明文説明文説明文</p>",
              "volume": "123g",
              "stock_remained": 1,
              "enable_shipping_category": {
                "id": 1,
                "name": "常温",
                "default_fee": 1500,
                "enable_shipping_with_other": true,
                "css_class": "-shipping-normal"
              },
              "main_image_url": {
                "original": "https://example.com/cart/api/v1/products/image/1.jpg",
                "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
                "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
                "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
              },
              "sub_image1_url": {
                "original": "https://example.com/cart/api/v1/products/image/1.jpg",
                "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
                "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
                "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
              },
              "sub_image2_url": {
                "original": "https://example.com/cart/api/v1/products/image/1.jpg",
                "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
                "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
                "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
              },
              "sub_image3_url": {
                "original": "https://example.com/cart/api/v1/products/image/1.jpg",
                "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
                "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
                "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
              }
            }
          }
        ],
        "taxes": [
          {
            "id": 1,
            "tax": 1000,
            "subtotal": 10000,
            "discount": 0,
            "tax_rate": 10,
            "tax_type": 0,
            "tax_calculate_type": 2,
            "tax_rounding_method": 1,
            "mark": "※",
            "description": "※印は軽減税率対象商品"
          }
        ],
        "subtotal_discounts": [
          {
            "id": 1,
            "order_id": 1,
            "order_detail_id": 1,
            "target": "item",
            "target_name": "商品値引き",
            "priority": 10,
            "name": "初回購入割引",
            "discount": 300
          }
        ],
        "shipping_discounts": [
          {
            "id": 1,
            "order_id": 1,
            "order_detail_id": 1,
            "target": "item",
            "target_name": "商品値引き",
            "priority": 10,
            "name": "初回購入割引",
            "discount": 300
          }
        ],
        "payment_cost_discounts": [
          {
            "id": 1,
            "order_id": 1,
            "order_detail_id": 1,
            "target": "item",
            "target_name": "商品値引き",
            "priority": 10,
            "name": "初回購入割引",
            "discount": 300
          }
        ],
        "other_cost_discounts": [
          {
            "id": 1,
            "order_id": 1,
            "order_detail_id": 1,
            "target": "item",
            "target_name": "商品値引き",
            "priority": 10,
            "name": "初回購入割引",
            "discount": 300
          }
        ]
      }
    ]
  }
}
ステータスコード 意味 説明
200 OK 顧客購入履歴

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ
> orders array<Order> 購入履歴
>> id integer(int64) ID
>> store_code string 店舗コード
>> status string 注文状態
>> ordered_at string(date-time) 注文日時
>> shipping_at string(date-time) 出荷日時
>> canceled_at string(date-time) キャンセル日時
>> memo string 備考
>> customer_id integer(int64) 顧客ID
>> customer_lastname string 注文者 姓
>> customer_firstname string 注文者 名
>> customer_lastname_kana string 注文者 姓カナ
>> customer_firstname_kana string 注文者 名カナ
>> customer_phone string 注文者 電話番号
>> customer_company_name string 注文者 会社名・組織名
>> customer_branch_name string 注文者 支店名・部署名
>> customer_affiliation string 注文者 所属
>> customer_email string(email) 注文者 メールアドレス
>> customer_agree_terms boolean 利用規約に同意する
>> customer_force_register boolean 顧客強制登録フラグ
>> customer_accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_postcode string 注文者住所 郵便番号
>> customer_country_code string 注文者住所 国コード
>> customer_country string 注文者住所 国名
>> customer_country_name string 注文者住所 国名(英語名)
>> customer_pref string 注文者住所 都道府県
>> customer_address_city string 注文者住所 市区町村
>> customer_address_street string 注文者住所 市区町村以降
>> customer_address_building string 注文者住所 建物名・部屋番号
>> customer_gender string 注文者 性別コード
>> customer_gender_name string 注文者 性別
>> customer_birthday string(date) 注文者 生年月日
>> customer_fullname string 注文者 氏名
>> customer_fullname_kana string 注文者 氏名カナ
>> billing_same_to_customer boolean 請求先情報が注文者情報と同一
>> billing_lastname string 請求先 姓
>> billing_firstname string 請求先 名
>> billing_lastname_kana string 請求先 姓カナ
>> billing_firstname_kana string 請求先 名カナ
>> billing_phone string 請求先 電話番号
>> billing_company_name string 請求先 会社名・組織名
>> billing_branch_name string 請求先 支店名・部署名
>> billing_affiliation string 請求先 所属
>> billing_postcode string 請求先住所 郵便番号
>> billing_country_code string 請求先住所 国コード
>> billing_country string 請求先住所 国名
>> billing_country_name string 請求先住所 国名(英語名)
>> billing_pref string 請求先住所 都道府県
>> billing_address_city string 請求先住所 市区町村
>> billing_address_street string 請求先住所 市区町村以降
>> billing_address_building string 請求先住所 建物名・部屋番号
>> billing_fullname string 請求先 氏名
>> billing_fullname_kana string 請求先 氏名カナ
>> shipping_same_to_billing boolean 配送先情報が注文者情報と同一
>> shipping_lastname string 配送先 姓
>> shipping_firstname string 配送先 名
>> shipping_lastname_kana string 配送先 姓カナ
>> shipping_firstname_kana string 配送先 名カナ
>> shipping_phone string 配送先 電話番号
>> shipping_company_name string 配送先 会社名・組織名
>> shipping_branch_name string 配送先 支店名・部署名
>> shipping_affiliation string 配送先 所属
>> shipping_postcode string 配送先住所 郵便番号
>> shipping_country_code string 配送先住所 国コード
>> shipping_country string 配送先住所 国名
>> shipping_country_name string 配送先住所 国名(英語名)
>> shipping_pref string 配送先住所 都道府県
>> shipping_address_city string 配送先住所 市区町村
>> shipping_address_street string 配送先住所 市区町村以降
>> shipping_address_building string 配送先住所 建物名・部屋番号
>> shipping_fullname string 配送先 氏名
>> shipping_fullname_kana string 配送先 氏名カナ
>> payment_type string 支払い方法
>> payment_status integer 支払いステータス
>> total integer お支払い金額
>> subtotal integer 商品合計
>> subtotal_discount integer 商品合計値引き
>> subtotal_discounted boolean 商品合計値引き処理済フラグ
>> shipping_cost integer 送料
>> shipping_discount integer 送料値引き
>> shipping_discounted boolean 送料値引き処理済フラグ
>> other_cost integer その他手数料
>> other_cost_discounted boolean その他手数料値引き処理済フラグ
>> adjustment integer 調整金
>> payment_cost integer 支払い手数料
>> payment_cost_discounted boolean 支払い手数料値引き処理済フラグ
>> tax integer 税額
>> tax_type integer 消費税区分
>> tax_calculate_type integer 税額の計算方法
>> tax_rounding_method integer 税額 端数処理方法
>> delivery_time string 配送指定時間帯
>> details array<OrderDetail> 注文明細リスト
>>> id integer(int64) ID
>>> order_id integer(int64) 注文ID
>>> product_id integer(int64) 商品ID
>>> code string 商品コード
>>> name string 商品名
>>> unit_price integer 単価
>>> amount integer 商品数量
>>> price integer 小計
>>> discount integer 値引き
>>> discounted boolean 値引き処理済フラグ
>>> actual_price integer 値引き後小計
>>> tax_rate float 税率(%)
>>> tax_type integer 消費税区分
>>> tax_mark string 税定義表示マーク
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> wrapping_type string 熨斗 表書き
>>> wrapping_text string 熨斗 名入れ
>>> shipping_category_id integer(int64) 送料区分ID
>>> shipping_category ShippingCategory 送料区分
>>>> id integer(int64) ID
>>>> name string 送料区分名
>>>> default_fee integer 標準送料
>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>> css_class string 温度区分CSSクラス
>>> discounts array<Discounts> 商品値引きリスト
>>> product Product 商品
>>>> id integer(int64) ID
>>>> code string 商品コード
>>>> name string 商品名
>>>> unit_price integer 表示単価
>>>> unit_price_without_tax integer 税抜き単価
>>>> unit_price_with_tax integer 税込み単価
>>>> tax_type integer 表示単価の税区分
>>>> description string 一覧用商品説明文(タグ不可)
>>>> content string 商品説明文(タグ許可)
>>>> volume string 内容量
>>>> stock_remained integer 在庫有無フラグ
>>>> enable_shipping_category ShippingCategory 送料区分
>>>>> id integer(int64) ID
>>>>> name string 送料区分名
>>>>> default_fee integer 標準送料
>>>>> enable_shipping_with_other boolean 他区分と同梱可
>>>>> css_class string 温度区分CSSクラス
>>>> main_image_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image1_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image2_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>>>> sub_image3_url ProductImage 商品画像
>>>>> original string(url) 元サイズ画像URL
>>>>> thumbnail string(url) サムネイル画像URL
>>>>> small string(url) 画像(小)URL
>>>>> large string(url) 画像(大)URL
>> taxes array<OrderTax> 税リスト
>>> id integer(int64) ID
>>> tax integer 税額
>>> subtotal integer 対象金額計
>>> discount integer 値引き割当額
>>> tax_rate float 税率
>>> tax_type integer 消費税区分
>>> tax_calculate_type integer 税額の計算方法
>>> tax_rounding_method integer 税額 端数処理方法
>>> mark integer 税定義表示マーク
>>> description integer 備考文
>> subtotal_discounts array<SubtotalDiscounts> 購入金額値引きリスト
>> shipping_discounts array<ShippingDiscount> 送料値引きリスト
>> payment_cost_discounts array<PaymentCostDiscounts> 支払い手数料値引きリスト
>> other_cost_discounts array<OtherCostDiscounts> その他手数料値引きリスト

顧客パスワードの変更

PUT /profile/change_password HTTP/1.1
var profile = new ElasticCart.Profile();
profile.changePassword(params, successCallback, errorCallback);

// 例
var params = {
    password: 'pas$w0rd',
    new_password: 'NewP@s$word',
    confirm_password: 'NewP@s$word'
};
profile.changePassword(params, function (result) {
    // 顧客パスワードの変更成功時の処理
}, function (error) {
    alert('パスワードの変更に失敗しました。');
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
password body string(password) true 現在の顧客パスワード
new_password body string(password) true 新しい顧客パスワード
confirm_password body string(password) true パスワードの確認入力

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK パスワード変更成功
422 Unprocessable Entity パスワード変更失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

顧客カード情報の変更

PUT /profile/card HTTP/1.1
var profile = new ElasticCart.Profile();
profile.editCard(params, successCallback, errorCallback);

// 例
var params = {
    password: 'pas$w0rd',
    payment_type: 'payjp',
    card: 'tok_1234567890abcdef',
};
profile.editCard(params, function (result) {
    // 顧客カード情報の変更成功時の処理
}, function (error) {
    alert('カード情報の変更に失敗しました。');
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード
password body string(password) true 現在の顧客パスワード
payment_type body string true 支払い方法
card body string false カードトークン(PAY.jp/Stripe)

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
       "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK カード情報変更成功
422 Unprocessable Entity カード情報変更失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

顧客メールアドレス変更確認メールの送信

PUT /profile/send_verify_email HTTP/1.1
var profile = ElasticCart.Profile();
profile.sendVerifyEmail(params, successCallback, errorCallback);

// 例
profile.sendVerifyEmail({customer_email: 'customer@example.com'}, function () {
    alert('メールアドレスの変更確認メールを送信しました。');
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code body string false 店舗コード
password body string(password) true 現在の顧客パスワード
email body string true 新しいメールアドレス

レスポンス

200 レスポンス

{
  "data": {
    "customer": {
      "id": 1,
      "status": "2",
      "registered_at": "2018-12-23T11:22:33+09:00",
      "customer_email": "customer@example.com",
      "accept_send_promotion_email": true,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_company_name": "サンプル株式会社",
      "customer_branch_name": "総務部",
      "customer_affiliation": "サンプル株式会社 総務部",
      "customer_postcode": "8100001",
      "customer_country_code": "JP",
      "customer_country": "日本",
      "customer_country_name": "Japan",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1990-11-22T00:00:00+00:00",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
      "payments": [
        {
          "id": 1,
          "customer_id": 1,
          "store_code": "default",
          "status": "1",
          "payment_type": "payjp",
          "registered_identifier": "string",
          "extra": {}
        }
      ]
    }
  }
}

422 レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}
ステータスコード 意味 説明
200 OK メールアドレス変更確認メールの送信成功
422 Unprocessable Entity メールアドレス変更確認メールの送信失敗(入力エラー)

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> customer Customer 顧客情報
>> id integer(int64) ID
>> status string 顧客状態
>> registered_at string(date-time) 登録日時
>> customer_email string(email) 顧客メールアドレス
>> accept_send_promotion_email boolean プロモーションメール送信許可フラグ
>> customer_lastname string 顧客 姓
>> customer_firstname string 顧客 名
>> customer_lastname_kana string 顧客 姓カナ
>> customer_firstname_kana string 顧客 名カナ
>> customer_phone string 顧客 電話番号
>> customer_company_name string 顧客 会社名・組織名
>> customer_branch_name string 顧客 支店名・部署名
>> customer_affiliation string 顧客 所属
>> customer_postcode string 顧客住所 郵便番号
>> customer_country_code string 顧客住所 国コード
>> customer_country string 顧客住所 国名
>> customer_country_name string 顧客住所 国名(英語名)
>> customer_pref string 顧客住所 都道府県
>> customer_address_city string 顧客住所 市区町村
>> customer_address_street string 顧客住所 市区町村以降
>> customer_address_building string 顧客住所 建物名・部屋番号
>> customer_gender string 顧客 性別コード
>> customer_gender_name string 顧客 性別
>> customer_birthday string(date) 顧客 生年月日
>> customer_fullname string 顧客 氏名
>> customer_fullname_kana string 顧客 氏名カナ
>> customer_fulladdress string 顧客住所
>> payments array<CustomerPayment> 支払い方法リスト
>>> id integer(int64) ID
>>> customer_id integer(int64) 顧客ID
>>> store_code string 店舗コード
>>> status string 登録状態
>>> payment_type string 支払い方法
>>> registered_identifier string 決済プロバイダ側の顧客識別子
>>> extra object 拡張データ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

モデルスキーマ

Product (商品情報)

{
  "id": 1,
  "code": "item-001",
  "name": "サンプル商品",
  "unit_price": 1650,
  "unit_price_without_tax": 1500,
  "unit_price_with_tax": 1650,
  "tax_type": 1,
  "description": "説明文説明文説明文説明文",
  "content": "<p>説明文説明文説明文説明文</p>",
  "volume": "123g",
  "subscription_rules_item_discount": null,
  "subscription_rules_first_time_discount": {
      "id": 1,
      "product_id": 1,
      "type": "firstTimeDiscount",
      "discount_with_tax": 1200,
      "discount_without_tax": 0,
      "params": {
          "activate_on_each_subscribe": "1"
      },
      "is_active": true,
      "discount": 1200,
      "tax_type": 1
  },
  "subscription_rules_free_cod": null,
  "subscription_rules_free_shipping": null,
  "stock_remained": 1,
  "enable_shipping_category": {
    "id": 1,
    "name": "常温",
    "default_fee": 1500,
    "enable_shipping_with_other": true,
    "css_class": "-shipping-normal"
  },
  "main_image_url": {
    "original": "https://example.com/cart/api/v1/products/image/1.jpg",
    "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
    "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
    "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
  },
  "sub_image1_url": {
    "original": "https://example.com/cart/api/v1/products/image/1.jpg",
    "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
    "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
    "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
  },
  "sub_image2_url": {
    "original": "https://example.com/cart/api/v1/products/image/1.jpg",
    "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
    "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
    "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
  },
  "sub_image3_url": {
    "original": "https://example.com/cart/api/v1/products/image/1.jpg",
    "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
    "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
    "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
  }
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
code string false none 商品コード
name string false none 商品名
unit_price integer false none 表示単価
unit_price_without_tax integer false none 税抜き単価
unit_price_with_tax integer false none 税込み単価
tax_type integer false none 表示単価の税区分
description string false none 一覧用商品説明文(タグ不可)
content string false none 商品説明文(タグ許可)
volume string false none 内容量
subscription_rules_item_discount SubscriptionDiscountRule false none 定期購入時 割引
subscription_rules_first_time_discount SubscriptionDiscountRule false none 定期購入時 初回割引
subscription_rules_free_cod SubscriptionDiscountRule false none 定期購入時 代引き手数料無料
subscription_rules_free_shipping SubscriptionDiscountRule false none 定期購入時 送料無料
stock_remained integer false none 在庫有無フラグ
enable_shipping_category ShippingCategory false none 有効な送料区分
main_image_url ProductImage false none メイン商品画像
sub_image1_url ProductImage false none 商品画像1
sub_image2_url ProductImage false none 商品画像2
sub_image3_url ProductImage false none 商品画像3

オプション値

在庫有無フラグ
プロパティ名 値 説明
stock_remained 1 在庫有り
stock_remained 0 在庫わずか
stock_remained -1 在庫なし

ProductImage (商品画像)

{
  "original": "https://example.com/cart/api/v1/products/image/1.jpg",
  "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
  "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
  "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
}

プロパティ

プロパティ名 型 必須 制限 説明
original string(url) false none 元サイズ画像URL
thumbnail string(url) false none サムネイル画像URL
small string(url) false none 画像(小)URL
large string(url) false none 画像(大)URL

ProductCategory (商品カテゴリ)

{
  "id": 1,
  "code": "gift",
  "name": "ギフト",
  "product_count": 12,
  "url": "https://example.com/cart/api/v1/products/search?category_code=gift"
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
code string false none 商品カテゴリコード
name string false none 商品カテゴリ名
product_count integer(int64) false none 登録商品点数
url string(url) false none カテゴリ内商品一覧のURL

ShippingCategory (送料区分)

{
  "id": 1,
  "name": "常温",
  "default_fee": 1500,
  "enable_shipping_with_other": true,
  "css_class": "-shipping-normal"
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
name string false none 送料区分名
default_fee integer false none 標準送料
enable_shipping_with_other boolean false none 他区分と同梱可
css_class string false none 温度区分CSSクラス

Cart (カート)

{
  "store_code": "default",
  "key": "12345678abcd5e75ef1f9f5f50c4308ee8bdeacf669f6c372e72a5c9f42edbfc",
  "expires": "2018-12-23T11:22:33+09:00",
  "cart_products": [
    {
      "id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
      "product_id": 1,
      "code": "item-001",
      "name": "サンプル商品",
      "unit_price": 1500,
      "amount": 2,
      "price": 3000,
      "discount": 200,
      "discounted": true,
      "actual_price": 2800,
      "wrapping_type": "内祝い",
      "wrapping_text": "山田 太郎",
      "product": {
        "id": 1,
        "code": "item-001",
        "name": "サンプル商品",
        "unit_price": 1650,
        "unit_price_without_tax": 1500,
        "unit_price_with_tax": 1650,
        "tax_type": 1,
        "description": "説明文説明文説明文説明文",
        "content": "<p>説明文説明文説明文説明文</p>",
        "volume": "123g",
        "stock_remained": 1,
        "enable_shipping_category": {
          "id": 1,
          "name": "常温",
          "default_fee": 1500,
          "enable_shipping_with_other": true,
          "css_class": "-shipping-normal"
        },
        "main_image_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "sub_image1_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "sub_image2_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        },
        "sub_image3_url": {
          "original": "https://example.com/cart/api/v1/products/image/1.jpg",
          "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
          "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
          "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
        }
      },
      "discounts": [
        {
          "id": 1,
          "cart_product_id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "enable_shipping_category": {
        "id": 1,
        "name": "常温",
        "default_fee": 1500,
        "enable_shipping_with_other": true,
        "css_class": "-shipping-normal"
      }
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
store_code string false none 店舗コード
key string false none KEY
expires string(date-time) false none カートの有効期間
cart_products array<CartProduct> false none カート内商品

CartProduct (カート内商品)

{
  "id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
  "product_id": 1,
  "code": "item-001",
  "name": "サンプル商品",
  "unit_price": 1650,
  "unit_price_without_tax": 1500,
  "unit_price_with_tax": 1650,
  "tax_type": 1,
  "amount": 2,
  "price": 3000,
  "discount": 200,
  "discounted": true,
  "actual_price": 2800,
  "wrapping_type": "内祝い",
  "wrapping_text": "山田 太郎",
  "product": {
    "id": 1,
    "code": "item-001",
    "name": "サンプル商品",
    "unit_price": 1650,
    "unit_price_without_tax": 1500,
    "unit_price_with_tax": 1650,
    "tax_type": 1,
    "description": "説明文説明文説明文説明文",
    "content": "<p>説明文説明文説明文説明文</p>",
    "volume": "123g",
    "stock_remained": 1,
    "enable_shipping_category": {
      "id": 1,
      "name": "常温",
      "default_fee": 1500,
      "enable_shipping_with_other": true,
      "css_class": "-shipping-normal"
    },
    "main_image_url": {
      "original": "https://example.com/cart/api/v1/products/image/1.jpg",
      "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
      "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
      "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
    },
    "sub_image1_url": {
      "original": "https://example.com/cart/api/v1/products/image/1.jpg",
      "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
      "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
      "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
    },
    "sub_image2_url": {
      "original": "https://example.com/cart/api/v1/products/image/1.jpg",
      "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
      "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
      "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
    },
    "sub_image3_url": {
      "original": "https://example.com/cart/api/v1/products/image/1.jpg",
      "thumbnail": "https://example.com/cart/api/v1/products/image/1-thumbnail.jpg",
      "small": "https://example.com/cart/api/v1/products/image/1-small.jpg",
      "large": "https://example.com/cart/api/v1/products/image/1-large.jpg"
    }
  },
  "discounts": [
    {
      "id": 1,
      "cart_product_id": "00000000-0c13-47b5-b0a1-966a80d58fe1",
      "target": "item",
      "target_name": "商品値引き",
      "priority": 10,
      "name": "初回購入割引",
      "discount": 300
    }
  ],
  "enable_shipping_category": {
    "id": 1,
    "name": "常温",
    "default_fee": 1500,
    "enable_shipping_with_other": true,
    "css_class": "-shipping-normal"
  }
}

プロパティ

プロパティ名 型 必須 制限 説明
id string(uuid) false none ID
product_id integer(int64) false none 商品ID
code string false none 商品コード
name string false none 商品名
unit_price integer false none 単価
amount integer false none 商品数量
price integer false none 小計
discount integer false none 値引き
discounted boolean false none 値引き処理済フラグ
actual_price integer false none 値引き後小計
wrapping_type string false none 熨斗 表書き
wrapping_text string false none 熨斗 名入れ
product Product false none 商品情報
discounts array<CartItemDiscounts]> false none カート内商品値引きリスト
enable_shipping_category ShippingCategory false none 有効な送料区分

Order (注文情報)

{
  "id": 1,
  "store_code": "default",
  "status": "draft",
  "ordered_at": "2018-12-23T11:22:33+09:00",
  "shipping_at": "2018-12-23T11:22:33+09:00",
  "canceled_at": "2018-12-23T11:22:33+09:00",
  "memo": "",
  "customer_id": 1,
  "customer_lastname": "山田",
  "customer_firstname": "太郎",
  "customer_lastname_kana": "ヤマダ",
  "customer_firstname_kana": "タロウ",
  "customer_phone": "09011110000",
  "customer_company_name": "サンプル株式会社",
  "customer_branch_name": "総務部",
  "customer_affiliation": "サンプル株式会社 総務部",
  "customer_email": "customer@example.com",
  "customer_agree_terms": true,
  "customer_force_register": true,
  "customer_accept_send_promotion_email": true,
  "customer_postcode": "8100001",
  "customer_country_code": "JP",
  "customer_country": "日本",
  "customer_country_name": "Japan",
  "customer_pref": "福岡県",
  "customer_address_city": "福岡市中央区",
  "customer_address_street": "天神1-2",
  "customer_address_building": "サンプルビル305",
  "customer_gender": "2",
  "customer_gender_name": "女性",
  "customer_birthday": "1990-11-22T00:00:00+00:00",
  "customer_fullname": "山田 太郎",
  "customer_fullname_kana": "ヤマダ タロウ",
  "billing_same_to_customer": true,
  "billing_lastname": "山田",
  "billing_firstname": "太郎",
  "billing_lastname_kana": "ヤマダ",
  "billing_firstname_kana": "タロウ",
  "billing_phone": "09011110000",
  "billing_company_name": "サンプル株式会社",
  "billing_branch_name": "総務部",
  "billing_affiliation": "サンプル株式会社 総務部",
  "billing_postcode": "8100001",
  "billing_country_code": "JP",
  "billing_country": "日本",
  "billing_country_name": "Japan",
  "billing_pref": "福岡県",
  "billing_address_city": "福岡市中央区",
  "billing_address_street": "天神1-2",
  "billing_address_building": "サンプルビル305",
  "billing_fullname": "山田 太郎",
  "billing_fullname_kana": "ヤマダ タロウ",
  "shipping_same_to_billing": true,
  "shipping_lastname": "山田",
  "shipping_firstname": "太郎",
  "shipping_lastname_kana": "ヤマダ",
  "shipping_firstname_kana": "タロウ",
  "shipping_phone": "09011110000",
  "shipping_company_name": "サンプル株式会社",
  "shipping_branch_name": "総務部",
  "shipping_affiliation": "サンプル株式会社 総務部",
  "shipping_postcode": "8100001",
  "shipping_country_code": "JP",
  "shipping_country": "日本",
  "shipping_country_name": "Japan",
  "shipping_pref": "福岡県",
  "shipping_address_city": "福岡市中央区",
  "shipping_address_street": "天神1-2",
  "shipping_address_building": "サンプルビル305",
  "shipping_fullname": "山田 太郎",
  "shipping_fullname_kana": "ヤマダ タロウ",
  "payment_type": "bank",
  "payment_status": 0,
  "total": 11660,
  "subtotal": 10000,
  "subtotal_discount": 0,
  "subtotal_discounted": true,
  "shipping_cost": 560,
  "shipping_discount": 0,
  "shipping_discounted": true,
  "other_cost": 0,
  "other_cost_discounted": true,
  "adjustment": 0,
  "payment_cost": 300,
  "payment_cost_discounted": true,
  "tax": 800,
  "tax_type": 2,
  "tax_calculate_type": 2,
  "tax_rounding_method": 1,
  "is_customer_cancelable": true,
  "delivery_date": "2018-12-23T00:00:00+09:00",
  "delivery_time": "00",
  "details": [
    {
      "id": 1,
      "order_id": 1,
      "product_id": 1,
      "code": "item-001",
      "name": "サンプル商品",
      "unit_price": 1500,
      "amount": 2,
      "price": 3000,
      "discount": 200,
      "discounted": true,
      "actual_price": 2800,
      "tax_rate": 10,
      "tax_type": 1,
      "tax_mark": "*",
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "wrapping_type": "内祝い",
      "wrapping_text": "山田 太郎",
      "shipping_category_id": 1,
      "shipping_category": {
        "id": 1,
        "name": "常温",
        "default_fee": 1500,
        "enable_shipping_with_other": true,
        "css_class": "-shipping-normal"
      },
      "discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  ],
  "taxes": [
    {
      "id": 1,
      "tax": 1000,
      "subtotal": 10000,
      "discount": 0,
      "tax_rate": 10,
      "tax_type": 0,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "mark": "※",
      "description": "※印は軽減税率対象商品"
    }
  ],
  "payment_request": {},
  "subtotal_discounts": [
    {
      "id": 1,
      "order_id": 1,
      "order_detail_id": 1,
      "target": "item",
      "target_name": "商品値引き",
      "priority": 10,
      "name": "初回購入割引",
      "discount": 300
    }
  ],
  "shipping_discounts": [
    {
      "id": 1,
      "order_id": 1,
      "order_detail_id": 1,
      "target": "item",
      "target_name": "商品値引き",
      "priority": 10,
      "name": "初回購入割引",
      "discount": 300
    }
  ],
  "payment_cost_discounts": [
    {
      "id": 1,
      "order_id": 1,
      "order_detail_id": 1,
      "target": "item",
      "target_name": "商品値引き",
      "priority": 10,
      "name": "初回購入割引",
      "discount": 300
    }
  ],
  "other_cost_discounts": [
    {
      "id": 1,
      "order_id": 1,
      "order_detail_id": 1,
      "target": "item",
      "target_name": "商品値引き",
      "priority": 10,
      "name": "初回購入割引",
      "discount": 300
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
store_code string false none 店舗コード
status string false none 注文状態
ordered_at string(date-time) false none 注文日時
shipping_at string(date-time) false none 出荷日時
canceled_at string(date-time) false none キャンセル日時
memo string false none 備考
customer_id integer(int64) false none 顧客ID
customer_lastname string false none 注文者 姓
customer_firstname string false none 注文者 名
customer_lastname_kana string false none 注文者 姓カナ
customer_firstname_kana string false none 注文者 名カナ
customer_phone string false none 注文者 電話番号
customer_company_name string false none 注文者 会社名・組織名
customer_branch_name string false none 注文者 支店名・部署名
customer_affiliation string false none 注文者 所属
customer_email string(email) false none 注文者 メールアドレス
customer_agree_terms boolean false none 利用規約に同意する
customer_force_register boolean false none 顧客強制登録フラグ
customer_accept_send_promotion_email boolean false none プロモーションメール送信許可フラグ
customer_postcode string false none 注文者住所 郵便番号
customer_country_code string false none 注文者住所 国コード
customer_country string false none 注文者住所 国名
customer_country_name string false none 注文者住所 国名(英語名)
customer_pref string false none 注文者住所 都道府県
customer_address_city string false none 注文者住所 市区町村
customer_address_street string false none 注文者住所 市区町村以降
customer_address_building string false none 注文者住所 建物名・部屋番号
customer_gender string false none 注文者 性別コード
customer_gender_name string false none 注文者 性別
customer_birthday string(date) false none 注文者 生年月日
customer_fullname string false none 注文者 氏名
customer_fullname_kana string false none 注文者 氏名カナ
billing_same_to_customer boolean false none 請求先情報が注文者情報と同一
billing_lastname string false none 請求先 姓
billing_firstname string false none 請求先 名
billing_lastname_kana string false none 請求先 姓カナ
billing_firstname_kana string false none 請求先 名カナ
billing_phone string false none 請求先 電話番号
billing_company_name string false none 請求先 会社名・組織名
billing_branch_name string false none 請求先 支店名・部署名
billing_affiliation string false none 請求先 所属
billing_postcode string false none 請求先住所 郵便番号
billing_country_code string false none 請求先住所 国コード
billing_country string false none 請求先住所 国名
billing_country_name string false none 請求先住所 国名(英語名)
billing_pref string false none 請求先住所 都道府県
billing_address_city string false none 請求先住所 市区町村
billing_address_street string false none 請求先住所 市区町村以降
billing_address_building string false none 請求先住所 建物名・部屋番号
billing_fullname string false none 請求先 氏名
billing_fullname_kana string false none 請求先 氏名カナ
shipping_same_to_billing boolean false none 配送先情報が注文者情報と同一
shipping_lastname string false none 配送先 姓
shipping_firstname string false none 配送先 名
shipping_lastname_kana string false none 配送先 姓カナ
shipping_firstname_kana string false none 配送先 名カナ
shipping_phone string false none 配送先 電話番号
shipping_company_name string false none 配送先 会社名・組織名
shipping_branch_name string false none 配送先 支店名・部署名
shipping_affiliation string false none 配送先 所属
shipping_postcode string false none 配送先住所 郵便番号
shipping_country_code string false none 配送先住所 国コード
shipping_country string false none 配送先住所 国名
shipping_country_name string false none 配送先住所 国名(英語名)
shipping_pref string false none 配送先住所 都道府県
shipping_address_city string false none 配送先住所 市区町村
shipping_address_street string false none 配送先住所 市区町村以降
shipping_address_building string false none 配送先住所 建物名・部屋番号
shipping_fullname string false none 配送先 氏名
shipping_fullname_kana string false none 配送先 氏名カナ
payment_type string false none 支払い方法
payment_status integer false none 支払いステータス
total integer false none お支払い金額
subtotal integer false none 商品合計
subtotal_discount integer false none 商品合計値引き
subtotal_discounted boolean false none 商品合計値引き処理済フラグ
shipping_cost integer false none 送料
shipping_discount integer false none 送料値引き
shipping_discounted boolean false none 送料値引き処理済フラグ
other_cost integer false none その他手数料
other_cost_discounted boolean false none その他手数料値引き処理済フラグ
adjustment integer false none 調整金
payment_cost integer false none 支払い手数料
payment_cost_discounted boolean false none 支払い手数料値引き処理済フラグ
tax integer false none 税額
tax_type integer false none 消費税区分
tax_calculate_type integer false none 税額の計算方法
tax_rounding_method integer false none 税額 端数処理方法
is_customer_cancelable boolean false none 顧客側からの注文キャンセル可能フラグ
delivery_date string(date) false none 配送希望日
delivery_time string false none 配送指定時間帯
details array<OrderDetail> false none 注文明細リスト
taxes array<OrderTax> false none 税リスト
payment_request PaymentRequest false none 支払いリクエスト
subtotal_discounts array<SubtotalDiscounts> false none 購入金額値引きリスト
shipping_discounts array<ShippingDiscounts> false none 送料値引きリスト
payment_cost_discounts array<PaymentCostDiscounts> false none 支払い手数料値引きリスト
other_cost_discounts array<OtherCostDiscounts> false none その他手数料値引きリスト

オプション値

注文状態
プロパティ名 値 説明
status draft 受注未了
status awaiting 入金待ち
status processing 出荷待ち
status shipped 発送準備完了
status canceled キャンセル
支払い方法
プロパティ名 値 説明
payment_type bank 銀行振込
payment_type cod 代金引換
payment_type payjp カード決済(Payjp)
payment_type stripe カード決済(Stripe)
payment_type amazonpay AmazonPay
支払いステータス
プロパティ名 値 説明
payment_status 0 未処理
payment_status 1 処理中
payment_status 2 支払済
payment_status 3 承認済
payment_status 4 後払い
payment_status 9 キャンセル
配送指定時間帯
プロパティ名 値 説明
delivery_time 00 指定なし
delivery_time 01 午前中
delivery_time 02 12 - 14時
delivery_time 03 14 - 16時
delivery_time 04 16 - 18時
delivery_time 05 18 - 20時
delivery_time 07 19 - 21時

OrderTax (税額)

{
  "id": 1,
  "tax": 1000,
  "subtotal": 10000,
  "discount": 0,
  "tax_rate": 10,
  "tax_type": 0,
  "tax_calculate_type": 2,
  "tax_rounding_method": 1,
  "mark": "※",
  "description": "※印は軽減税率対象商品"
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
tax integer false none 税額
subtotal integer false none 対象金額計
discount integer false none 値引き割当額
tax_rate float false none 税率
tax_type integer false none 消費税区分
tax_calculate_type integer false none 税額の計算方法
tax_rounding_method integer false none 税額 端数処理方法
mark integer false none 税定義表示マーク
description integer false none 備考文

オプション値

消費税区分
プロパティ名 値 説明
tax_type 0 外税
tax_type 1 内税
tax_type 2 非課税
税額の計算方法
プロパティ名 値 説明
tax_calculate_type 1 明細単位
tax_calculate_type 2 注文単位
税額 端数処理方法
プロパティ名 値 説明
tax_rounding_method 1 四捨五入
tax_rounding_method 2 切り上げ
tax_rounding_method 3 切り捨て

OrderDetail (注文明細)

{
  "id": 1,
  "order_id": 1,
  "product_id": 1,
  "code": "item-001",
  "name": "サンプル商品",
  "unit_price": 1500,
  "amount": 2,
  "price": 3000,
  "discount": 200,
  "discounted": true,
  "actual_price": 2800,
  "tax_rate": 10,
  "tax_type": 1,
  "tax_mark": "*",
  "tax_calculate_type": 2,
  "tax_rounding_method": 1,
  "wrapping_type": "内祝い",
  "wrapping_text": "山田 太郎",
  "shipping_category_id": 1,
  "shipping_category": {
    "id": 1,
    "name": "常温",
    "default_fee": 1500,
    "enable_shipping_with_other": true,
    "css_class": "-shipping-normal"
  },
  "discounts": [
    {
      "id": 1,
      "order_id": 1,
      "order_detail_id": 1,
      "target": "item",
      "target_name": "商品値引き",
      "priority": 10,
      "name": "初回購入割引",
      "discount": 300
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
order_id integer(int64) false none 注文ID
product_id integer(int64) false none 商品ID
code string false none 商品コード
name string false none 商品名
unit_price integer false none 単価
amount integer false none 商品数量
price integer false none 小計
discount integer false none 値引き
discounted boolean false none 値引き処理済フラグ
actual_price integer false none 値引き後小計
tax_rate float false none 税率(%)
tax_type integer false none 消費税区分
tax_mark string false none 税定義表示マーク
tax_calculate_type integer false none 税額の計算方法
tax_rounding_method integer false none 税額 端数処理方法
wrapping_type string false none 熨斗 表書き
wrapping_text string false none 熨斗 名入れ
shipping_category_id integer(int64) false none 送料区分ID
shipping_category ShippingCategory false none 送料区分
discounts array<ItemDiscounts> false none 商品値引きリスト

Discounts (値引き)

{
  "id": 1,
  "order_id": 1,
  "order_detail_id": 1,
  "target": "item",
  "target_name": "商品値引き",
  "priority": 10,
  "name": "初回購入割引",
  "discount": 300
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
order_id integer(int64) false none 注文ID
order_detail_id integer(int64) false none 注文明細ID
target string false none 値引き対象
target_name string false none 値引き対象名
priority integer false none 値引き優先度
name string false none 値引き名称
discount integer false none 値引き額

PaymentRequest (支払いリクエスト)

{
  "id": 1,
  "order_id": 1,
  "status": "1",
  "payment_type": "bank",
  "extra": {}
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
order_id integer(int64) false none 注文ID
status string false none 支払い状態
payment_type string false none 支払い方法
extra object false none 拡張データ

オプション値

支払いリクエスト 支払い状態
プロパティ名 値 説明
status 1 未処理
status 2 送信済
status 3 承認済
status 4 売上済
status 7 拒否
status 8 保留
status 9 キャンセル

EnabledPayments (有効な支払い方法リスト)

{
  "bank": "銀行振込",
  "cod": "代金引換",
  "payjp": "カード決済(Payjp)",
  "stripe": "カード決済(Stripe)",
  "np_connect_pro": "NP後払い",
  "amazonpay_cv2": "AmazonPay CV2",
  "amazonpay": "AmazonPay(古いバージョン)"
}

プロパティ

プロパティ名 型 必須 制限 説明
bank string false none 銀行振込
cod string false none 代金引換
payjp string false none PAY.JP
stripe string false none Stripe
np_connect_pro string false none NP後払い
amazonpay_cv2 string false none AmazonPay CV2
amazonpay string false none AmazonPay

AmazonPayConfig (AmazonPay設定)

{
  "client_id": "amzn1.application-oa2-client.1234567890abcdef1234567890abcdef",
  "currency_code": "jpy",
  "merchant_id": "A2ABCDEFG12345",
  "region": "jp",
  "sandbox": "1"
}

プロパティ

プロパティ名 型 必須 制限 説明
client_id string false none クライアントID
currency_code string false none 通貨コード
merchant_id string false none マーチャントID
region string false none 地域コード
sandbox string false none Sandboxフラグ

AmazonpayCv2Config (AmazonPay CV2設定)

{
  "store_id": "amzn1.application-oa2-client.1234567890abcdef1234567890abcdef",
  "merchant_id": "A2ABCDEFG12345",
  "region": "JP",
  "sandbox": "1"
}

プロパティ

プロパティ名 型 必須 制限 説明
store_id string false none Store ID
merchant_id string false none 出品者ID
region string false none 地域コード
sandbox string false none Sandboxフラグ

AmazonpayCv2CreateCheckoutSessionConfigResponse (AmazonPay CV2 createCheckoutSessionConfig response)

{
  "merchantId": "string",
  "ledgerCurrency": "JPY",
  "sandbox": true,
  "createCheckoutSessionConfig": {
    "payloadJSON": "string",
    "signature": "string",
    "publicKeyId": "string"
  }
}

プロパティ

プロパティ名 型 必須 制限 説明
merchantId string false none 出品者ID
ledgerCurrency string false none 通貨
sandbox boolean false none Sandboxフラグ
createCheckoutSessionConfig AmazonpayCv2ButtonConfig false none GET /api/v1/amazon_pay/config/createCheckoutSessionConfig

AmazonpayCv2ButtonConfig (AmazonPay CV2 buttonConfig)

{
  "payloadJSON": "string",
  "signature": "string",
  "publicKeyId": "string"
}

プロパティ

プロパティ名 型 必須 制限 説明
payloadJSON string false none payload JSON string
signature string false none 署名
publicKeyId string false none Public Key ID

PayjpConfig (PAY.JP設定)

{
  "public": "pk_test_1234567890abcdef12345678"
}

プロパティ

プロパティ名 型 必須 制限 説明
public string false none 公開APIキー

StripeConfig (Stripe設定)

{
  "public": "pk_test_1234567890abcdef12345678"
}

プロパティ

プロパティ名 型 必須 制限 説明
public string false none 公開APIキー

Customer (顧客情報)

{
  "id": 1,
  "status": "2",
  "registered_at": "2018-12-23T11:22:33+09:00",
  "customer_email": "customer@example.com",
  "password": "pa$$word",
  "accept_send_promotion_email": true,
  "customer_lastname": "山田",
  "customer_firstname": "太郎",
  "customer_lastname_kana": "ヤマダ",
  "customer_firstname_kana": "タロウ",
  "customer_phone": "09011110000",
  "customer_company_name": "サンプル株式会社",
  "customer_branch_name": "総務部",
  "customer_affiliation": "サンプル株式会社 総務部",
  "customer_postcode": "8100001",
  "customer_country_code": "JP",
  "customer_country": "日本",
  "customer_country_name": "Japan",
  "customer_pref": "福岡県",
  "customer_address_city": "福岡市中央区",
  "customer_address_street": "天神1-2",
  "customer_address_building": "サンプルビル305",
  "customer_gender": "2",
  "customer_gender_name": "女性",
  "customer_birthday": "1990-11-22T00:00:00+00:00",
  "customer_fullname": "山田 太郎",
  "customer_fullname_kana": "ヤマダ タロウ",
  "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
  "payments": [
    {
      "id": 1,
      "customer_id": 1,
      "store_code": "default",
      "status": "1",
      "payment_type": "payjp",
      "registered_identifier": "string",
      "extra": {}
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
status string false none 顧客状態
registered_at string(date-time) false none 登録日時
customer_email string(email) false none 顧客メールアドレス
password string(password) false none 顧客パスワード
accept_send_promotion_email boolean false none プロモーションメール送信許可フラグ
customer_lastname string false none 顧客 姓
customer_firstname string false none 顧客 名
customer_lastname_kana string false none 顧客 姓カナ
customer_firstname_kana string false none 顧客 名カナ
customer_phone string false none 顧客 電話番号
customer_company_name string false none 顧客 会社名・組織名
customer_branch_name string false none 顧客 支店名・部署名
customer_affiliation string false none 顧客 所属
customer_postcode string false none 顧客住所 郵便番号
customer_country_code string false none 顧客住所 国コード
customer_country string false none 顧客住所 国名
customer_country_name string false none 顧客住所 国名(英語名)
customer_pref string false none 顧客住所 都道府県
customer_address_city string false none 顧客住所 市区町村
customer_address_street string false none 顧客住所 市区町村以降
customer_address_building string false none 顧客住所 建物名・部屋番号
customer_gender string false none 顧客 性別コード
customer_gender_name string false none 顧客 性別
customer_birthday string(date) false none 顧客 生年月日
customer_fullname string false none 顧客 氏名
customer_fullname_kana string false none 顧客 氏名カナ
customer_fulladdress string false none 顧客住所
payments array<CustomerPayment> false none 支払い方法リスト

オプション値

顧客状態
プロパティ名 値 説明
status 0 仮登録
status 1 登録待ち(登録確認メール送信済)
status 2 登録済
status 9 利用不可
性別コード
プロパティ名 値 説明
customer_gender 0 未回答
customer_gender 1 男性
customer_gender 2 女性

DraftCustomer (仮登録状態の顧客情報)

{
  "id": 1,
  "status": "1",
  "registered_at": "2018-12-23T11:22:33+09:00",
  "customer_email": "customer@example.com",
  "password": "pa$$word",
  "accept_send_promotion_email": true,
  "customer_lastname": "山田",
  "customer_firstname": "太郎",
  "customer_lastname_kana": "ヤマダ",
  "customer_firstname_kana": "タロウ",
  "customer_phone": "09011110000",
  "customer_company_name": "サンプル株式会社",
  "customer_branch_name": "総務部",
  "customer_affiliation": "サンプル株式会社 総務部",
  "customer_postcode": "8100001",
  "customer_country_code": "JP",
  "customer_country": "日本",
  "customer_country_name": "Japan",
  "customer_pref": "福岡県",
  "customer_address_city": "福岡市中央区",
  "customer_address_street": "天神1-2",
  "customer_address_building": "サンプルビル305",
  "customer_gender": "2",
  "customer_gender_name": "女性",
  "customer_birthday": "1990-11-22T00:00:00+00:00",
  "customer_fullname": "山田 太郎",
  "customer_fullname_kana": "ヤマダ タロウ",
  "customer_fulladdress": "福岡県福岡市中央区天神1-2 サンプルビル305",
  "payments": [
    {
      "id": 1,
      "customer_id": 1,
      "store_code": "default",
      "status": "1",
      "payment_type": "payjp",
      "registered_identifier": "string",
      "extra": {}
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
Customer false none 顧客情報

CustomerPayment (顧客支払い方法)

{
  "id": 1,
  "customer_id": 1,
  "store_code": "default",
  "status": "1",
  "payment_type": "payjp",
  "registered_identifier": "string",
  "extra": {}
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
customer_id integer(int64) false none 顧客ID
store_code string false none 店舗コード
status string false none 登録状態
payment_type string false none 支払い方法
registered_identifier string false none 決済プロバイダ側の顧客識別子
extra object false none 拡張データ

オプション値

顧客支払い方法 登録状態
プロパティ名 値 説明
status 0 仮登録
status 1 利用可
status 9 無効

MetaApiPaging (メタ情報 ページング)

{
  "has_prev": true,
  "has_next": true,
  "total": 99,
  "total_pages": 12,
  "per_page": 20,
  "page": 2,
  "current": 20,
  "next": "https://example.com/cart/api/v1/products/search?page=3",
  "prev": "https://example.com/cart/api/v1/products/search?page=1"
}

プロパティ

プロパティ名 型 必須 制限 説明
has_prev boolean false none 前のページが存在するか
has_next boolean false none 次のページが存在するか
total integer false none 全件数
total_pages integer false none 全ページ数
per_page integer false none ページあたり表示件数
page integer false none 現在のページ
current integer false none 表示件数
next string(url) false none 次のページのURL
prev string(url) false none 前のページのURL

MetaNotFoundResponse (メタ情報 エラー(データなし))

{
  "success": false,
  "message": "見つかりません。"
}

プロパティ

プロパティ名 型 必須 制限 説明
success boolean false none レスポンス成功
message string false none エラーメッセージ

InvalidInputResponse (エラーレスポンス(入力エラー))

{
  "message": "入力エラーが発生しました。",
  "inputs": {},
  "errors": {}
}

プロパティ

プロパティ名 型 必須 制限 説明
message string false none エラーメッセージ
inputs object false none 入力内容
errors object false none エラー内容

FailedPaymentRequestResponse (エラーレスポンス(決済失敗))

{
  "message": "決済リクエストに失敗しました。",
  "inputs": {},
  "errors": {}
}

プロパティ

プロパティ名 型 必須 制限 説明
message string false none エラーメッセージ
inputs object false none 入力内容
errors object false none エラー内容

UnauthorizedResponse (エラーレスポンス(認証失敗))

{
  "message": "認証に失敗しました。",
  "inputs": {},
  "errors": {}
}

プロパティ

プロパティ名 型 必須 制限 説明
message string false none エラーメッセージ
inputs object false none 入力内容
errors object false none エラー内容

支払い方法別スクリプト

注文フォームでのPAY.JP, Stripe, AmazonPayの埋め込みをサポートするJavaScriptライブラリがあります。

PAY.JP Script

PAY.JPのカード情報トークン化スクリプト読み込みおよび、注文フォームとの連携を行うスクリプトです。

https://{APIホスト名}/js/framework/payment/payjp.min.js にホスティングされています。

フォーム部分のHTMLコード例

<form id="order-form">
    <!-- (省略) -->
    <fieldset>
        <legend>支払い方法</legend>
        <div>
            <div>
                <label><input type="radio" name="payment_type" value="bank" id="pay-radioBank"> 銀行振込</label>
            </div>
            <div>
                <label><input type="radio" name="payment_type" value="cod" id="pay-radioCod"> 代金引換</label>
            </div>
            <div>
                <label><input type="radio" name="payment_type" value="payjp" id="pay-radioPayjp"> カード払い</label>
                <div id="payjp-checkout"></div>
            </div>
        </div>
    </fieldset>
    <!-- (省略) -->
</form>

スクリプト部分の例

<script src="https://{APIホスト名}/js/framework/payment/payjp.min.js"></script>
<script>
ElasticCart.load().then(function () {
    // Vueを利用していない場合
    ElasticCart.Payment.Payjp.loadCheckout('{APIのベースURL}');
    // Vueを利用していない場合(店舗コードの指定あり)
    ElasticCart.Payment.Payjp.loadCheckout({API_BASE: '{APIのベースURL}', STORE_CODE: '{店舗コード}'});

    // Vueを利用している場合
    var app = ElasticCart.vue.mount('#main', {
        onReady: function () {
            // 店舗コードの指定なし
            ElasticCart.Payment.Payjp.loadCheckout('{APIのベースURL}');
            // 店舗コードの指定あり
            ElasticCart.Payment.Payjp.loadCheckout({API_BASE: '{APIのベースURL}', STORE_CODE: '{店舗コード}'});
        },
    });
});
</script>

ElasticCart.Payment.Payjp.loadCheckout(config, options)

オプション

パラメーター名 型 必須 説明
config string or object false カートAPIのベースURL または 接続設定
> API_BASE string false カートAPIのベースURL
> STORE_CODE string false 店舗コード default: 'default'
options object false
> targetId string false カード情報入力ボタンを表示する要素のID。 default: 'payjp-checkout'
> formSelector string false 注文フォームのセレクタ。 default: '#order-form'
> key string false PAY.JPの公開鍵。 default: ``
> lang string false PAY.JPの表示言語。 default: 'ja'
> text string false カード情報入力ボタンのテキスト。 default: 'カード情報を入力する'
> submitText string false カード情報送信ボタンのテキスト。 default: 'カード情報を送信する'
> namePlaceholder string false カード情報入力 名義のプレースホルダーテキスト。 default: 'TARO YAMADA'
> partial boolean false trueとセットすると、カード情報フォーム入力後に自動的に送信(自動的なトークン作成)しない。 default: true
> previousToken boolean false エラーにより画面に戻ってきた場合などに、再入力をさせないために作成済みのトークンを入れるパラメーター( partial が true の場合のみ機能する )。 default: false
> tokenName string false 生成されたカードトークンを格納するinput要素のname属性。 default: 'card'
> scriptClass string false PAY.JP チェックアウトスクリプトのタグに付与されるclass属性。 default: 'payjp-button'

Stripe Script

Stripeのカード情報トークン化スクリプト読み込みおよび、注文フォームとの連携を行うスクリプトです。

https://{APIホスト名}/js/framework/payment/stripe.min.js にホスティングされています。

フォーム部分のHTMLコード例

<form id="order-form">
    <!-- (省略) -->
    <fieldset>
        <legend>支払い方法</legend>
        <div>
            <div>
                <label><input type="radio" name="payment_type" value="bank" id="pay-radioBank"> 銀行振込</label>
            </div>
            <div>
                <label><input type="radio" name="payment_type" value="cod" id="pay-radioCod"> 代金引換</label>
            </div>
            <div>
                <label><input type="radio" name="payment_type" value="stripe" id="pay-radioStripe"> カード払い</label>
                <button type="button" id="stripe-checkout">カード情報を入力</button>
            </div>
        </div>
    </fieldset>
    <!-- (省略) -->
</form>

スクリプト部分の例

<script src="https://{APIホスト名}/js/framework/payment/stripe.min.js"></script>
<script>
ElasticCart.load().then(function () {
    // Vueを利用していない場合
    ElasticCart.Payment.Stripe.loadCheckout('{APIのベースURL}');
    // Vueを利用していない場合(店舗コードの指定あり)
    ElasticCart.Payment.Stripe.loadCheckout({API_BASE: '{APIのベースURL}', STORE_CODE: '{店舗コード}'});

    // Vueを利用している場合
    var app = ElasticCart.vue.mount('#main', {
        onReady: function () {
            // 店舗コードの指定なし
            ElasticCart.Payment.Stripe.loadCheckout('{APIのベースURL}');
            // 店舗コードの指定あり
            ElasticCart.Payment.Stripe.loadCheckout({API_BASE: '{APIのベースURL}', STORE_CODE: '{店舗コード}'});

        },
    });
});
</script>

ElasticCart.Payment.Stripe.loadCheckout(config, options)

オプション

パラメーター名 型 必須 説明
config string or object false カートAPIのベースURL または 接続設定
> API_BASE string false カートAPIのベースURL
> STORE_CODE string false 店舗コード default: 'default'
options object false
> key string false Stripeの公開鍵。 default: ``
> locale string false 表示言語設定。 default: 'auto'
> currency string false 使用通貨単位。 default: 'jpy'
> image string false カード情報入力画面に表示するロゴ画像。 default: null
> name string false カード情報入力画面に表示する会社名またはサービス名。 default: null
> description string false カード情報入力画面に表示する説明文。 default: null
> panelLabel string false カード情報送信ボタンのテキスト。 default: 'カード情報を送信する'
> allowRememberMe boolean false 支払いを記憶するオプション。 default: false
> formSelector string false 注文フォームのセレクタ。 default: '#order-form'
> buttonId string false カード情報入力ボタンのID。 default: 'stripe-checkout'

AmazonPay Script

※ Amazon Pay CV1を利用する場合のみ呼び出してください。Amazon Pay CV2の利用時は下記スクリプトの呼び出しは不要です。

Amazon Payのスクリプト読み込みおよび、注文フォームとの連携を行うスクリプトです。

https://{APIホスト名}/js/framework/payment/amazonpay.min.js にホスティングされています。

フォーム部分のHTMLコード例

<fieldset>
    <legend>Amazonアカウントでお支払い</legend>
    <div id="AmazonPayButton" data-select-payment-type="#pay-radioAmazon"><span class="-loading">...準備しています...</span></div>
    <div id="AmazonPayLogout" style="display: none;"><a href="#">(Amazonアカウントからログアウト)</a></div>
    <div class="row">
        <div class="col-12 col-md-6">
            <div id="AmazonAddressBook" style="display: none; height: 250px;"></div>
        </div>
        <div class="col-12 col-md-6">
            <div id="AmazonWallet" style="display: none; height: 250px;"></div>
        </div>
    </div>
</fieldset>
<fieldset>
    <legend>支払い方法</legend>
    <div>
        <div>
            <label><input type="radio" name="payment_type" value="bank" id="pay-radioBank"> 銀行振込</label>
        </div>
        <div>
            <label><input type="radio" name="payment_type" value="cod" id="pay-radioCod"> 代金引換</label>
        </div>
        <div>
            <label><input type="radio" name="payment_type" value="amazonpay" id="pay-radioAmazon"> Amazon Pay</label>
            <input type="hidden" name="amazon[access_token]" id="input-amazonAccessToken">
            <input type="hidden" name="amazon[order_reference_id]" id="input-amazonOrderReferenceId">
        </div>
    </div>
</fieldset>

スクリプト部分の例 ※jQueryが読み込まれていることを想定しています。

<script src="https://{APIホスト名}/js/framework/payment/amazonpay.min.js"></script>
<script>
(function () {
    $(function () {
        // amazon pay
        ElasticCart.Payment.AmazonPay.load('{APIのベースURL}');
        // イベントフック例
        $('#AmazonPayButton').on('authorized.amazonpay', function (event, response) {
            console.log('jQuery: authorized.amazonpay', arguments);
        });
        document.getElementById('AmazonPayButton').addEventListener('authorized.amazonpay', function (event) {
            console.log('Native: authorized.amazonpay', arguments);
        });
        document.getElementById('AmazonPayButton').addEventListener('change.destination.amazonpay', function (event) {
            console.log('Native: change.destination.amazonpay', arguments);
            document.getElementById('customer_lastname').focus();
        });
        $('#AmazonPayButton').on('change.destination.amazonpay', function (event, destination) {
            console.log('jQuery: change.destination.amazonpay', arguments);
        });
    });
})();
</script>

<!-- 店舗コードを指定する場合はload部分を変更 -->
<script>
(function () {
    $(function () {
        // amazon pay
        ElasticCart.Payment.AmazonPay.load({API_BASE: '{APIのベースURL}', STORE_CODE: '{店舗コード}'});
        // 省略
    })
});
</script>

ElasticCart.Payment.AmazonPay.load(config, options)

オプション

パラメーター名 型 必須 説明
config string or object false カートAPIのベースURL または 接続設定
> API_BASE string false カートAPIのベースURL
> STORE_CODE string false 店舗コード default: 'default'
options object false
> targetId string false AmazonアカウントのログインボタンのID。 default: 'AmazonPayButton'
> targetAddressBookId string false ログイン後、住所リストが表示される要素のID。 default: 'AmazonAddressBook'
> targetWalletId string false ログイン後、支払い方法リストが表示される要素のID。 default: 'AmazonWallet'
> targetLogoutButtonId string false AmazonアカウントからのログアウトボタンのID。 default: 'AmazonPayLogout'
> targetInputAccessToken string false アクセストークンが格納されるInput要素のID。 default: 'input-amazonAccessToken'
> targetInputOrderReferenceId string false OrderReferenceIdが格納されるInput要素のID。 default: 'input-amazonOrderReferenceId'
> type string false ログインボタンの種類。 see: Amazon Pay ボタンウィジェット default: 'PwA'
> color string false ログインボタンの色。 see: Amazon Pay ボタンウィジェット default: 'Gold'
> size string false ログインボタンの大きさ。 see: Amazon Pay ボタンウィジェット default: 'medium'
> scope string false ログイン時に要求する権限。 see: Amazon Pay ボタンウィジェット default: 'profile payments:widget payments:shipping_address'
> popup boolean false ポップアップでログインフォームを表示するか。 default: true
> redirectUrl string false Amazonログイン後のリダイレクト先。 default: window.location.href (現在のページ)

Elcart Vue コンポーネント

はじめに

このドキュメントではカートシステムのフロントエンドで使用できるVueコンポーネントについて説明します。

Vue.js についての基本的な説明は以下のサイトを参照してください。

カートシステムのVueコンポーネントを利用する

本カートシステムの提供するJavaScriptライブラリは、Vue.jsおよびVueコンポーネントを内包しています。

提供するコンポーネントは次のドキュメントを参照してください。

次のようにすることで、Vueコンポーネントを利用することができます。

HTML部分

<!-- 省略 -->
<body>
    <div id="main">
        <!-- 省略 -->
    </div>
</body>

スクリプト部分

<script src="https://{APIホスト名}/js/elcart-vendor.min.js"></script>
<script src="https://{APIホスト名}/framework/elcart.min.js"></script>
<script>
    ElasticCart.load('{APIのベースURL}').then(function () {
        var methods = {};
        var app = ElasticCart.vue.mount('#main', methods);
    });
</script>

<!-- 店舗コードを指定する場合はload部分を変更 -->
<script>
    ElasticCart.load({API_BASE: '{APIのベースURL}', STORE_CODE: '{店舗コード}'}).then(function () {
       // 省略
    });
</script>

ElasticCart.vue.mount(selector, methods)

パラメーター名 型 必須 説明
selector string true Vueを有効化するエレメントのセレクタ default: '#main'
methods object false Vueで利用するメソッドのリスト

導入例

カートボタンを設置する

<!-- 省略 -->
<body>
    <div id="main">
        <!-- 省略 -->
        <cart-button product-code="item-001" @basket-in="basketIn">
            カートに入れる
        </cart-button>
        <!-- 省略 -->
    </div>
</body>
<!-- 省略 -->
<script src="https://example.com/js/elcart-vendor.min.js"></script>
<script src="https://example.com/framework/elcart.min.js"></script>
<script>
    ElasticCart.load('example.com').then(function () {
        var app = ElasticCart.vue.mount('#main', {
            /**
             * カートへの商品追加完了時の処理
             *
             * @param {String} productCode
             * @param {Object} cartProduct
             */
            basketIn: function (productCode, cartProduct) {
                console.log('add item in cart', productCode, cartProduct);
            },
        });
    });
</script>

定期購入プラグイン (Subscription)

商品別定期プランの取得

GET /products/{code}/subscription_plans.json HTTP/1.1
var ProductSubscriptionPlans = new ElasticCart.ProductSubscriptionPlans();
ProductSubscriptionPlans.fetch(code, query, callback, errorCallback);

// 例:商品コードが`item-001`の定期プランを取得
var ProductSubscriptionPlans = new ElasticCart.ProductSubscriptionPlans();
ProductSubscriptionPlans.fetch('item-001', {
    // 配送指定日に基づいた次回配送予定日を取得
    delivery_date: '2019-10-18'
}, function (result) {
    // results が該当商品の定期プラン
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
code path string true 商品コード
delivery_date query string(date) false 配送日

レスポンス

200 レスポンス

{
  "data": {
    "subscription_plans": [
      {
        "id": 1,
        "name": "毎月1日配送",
        "next_delivery_date": "2019-11-01T00:00:00+09:00",
        "first_delivery_date": "2019-10-01T00:00:00+09:00",
        "second_delivery_date": "2019-11-01T00:00:00+09:00"
      }
    ]
  },
  "meta": {
    "success": true
  }
}
ステータスコード 意味 説明
200 OK 定期プランのリスト

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> subscription_plans array<Subscription> 商品別定期プランの一覧
>> id integer(int64) ID
>> name string プラン名
>> next_delivery_date string(date-time) 次回お届け予定日(初回配送をスキップしない場合)
>> first_delivery_date string(date-time) 初回お届け予定日(初回配送をスキップした場合)
>> second_delivery_date string(date-time) 次回お届け予定日(初回配送をスキップした場合)

モデルスキーマ

SubscriptionPlan(定期配送プラン)

{
  "id": 1,
  "name": "毎月1日配送",
  "next_delivery_date": "2019-07-01T00:00:00+09:00",
  "first_delivery_date": "2019-06-01T00:00:00+09:00",
  "second_delivery_date": "2019-07-01T00:00:00+09:00"
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
name string false none プラン名
next_delivery_date string(date-time) false none 次回お届け予定日(初回配送をスキップしない場合)
first_delivery_date string(date-time) false none 初回お届け予定日(初回配送をスキップした場合)
second_delivery_date string(date-time) false none 次回お届け予定日(初回配送をスキップした場合)

SubscriptionDiscountRule(定期注文値引きルール)

{
  "id": 1,
  "product_id": 1,
  "type": "firstTimeDiscount",
  "discount_with_tax": 800,
  "discount_without_tax": 0,
  "params": {
      "activate_on_each_subscribe": "0"
  },
  "is_active": true,
  "discount": 800,
  "tax_type": 1
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
product_id integer(int64) false none 商品ID
type string false none 定期時の割引種別
discount_with_tax float false none 税込み値引き額
discount_without_tax float false none 税抜き値引き額
params array false none オプションパラメーター
is_active boolean false none 割引の有効、無効
discount integer false none 値引き額
tax_type integer false none 表示単価の税区分

オプション値

定期時の割引種別
プロパティ名 値 説明
type freeShipping 送料無料
type freeCod 代引き手数料無料
type firstTimeDiscount 初回割引
type itemDiscount 定期購入割引

ポイントプラグイン (Points)

顧客所持ポイントの概要

ログイン中の顧客の所持ポイント数、期限切れ間近のポイント数と有効期限を取得します。

POST /profile/points/summary HTTP/1.1
  new ElasticCart.CustomerPointSummary().fetch(function (pointSummary) {
      // 所持ポイントの概要`pointSummary`を使った処理
  }, errorCallback);

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード

レスポンス

ステータスコード 意味 説明
200 OK 所持ポイント概要

200 レスポンス

{
  "meta": {
    "success": true,
    "status": 200
  },
  "data": {
    "pointSummary": {
      "customer_id": 1,
      "remaining_points": 200,
      "will_soon_expire_points": [
        {
          "customer_id": 1,
          "expired_at": "2021-03-31T23:59:59+09:00",
          "sum_of_points": 200
        }
      ]
    }
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> pointSummary PointSummary 所持ポイント概要
>> customer_id integer(int64) 顧客ID
>> remaining_points integer 所持ポイント数
>> will_soon_expire_points array<WillSoonExpirePoints> まもなく期限切れとなるポイント数
>>> customer_id integer(int64) 顧客ID
>>> expired_at string(date-time) 期限日時
>>> sum_of_points integer 期限切れとなる合計ポイント数

顧客所持ポイントの一覧

ログイン中の顧客の所持ポイントのリストを取得します。

POST /profile/points HTTP/1.1
// リクエストパラメータ
var param = {};

new ElasticCart.CustomerPoint().fetch(param, function (points) {
      // 所持ポイントのリスト`points`を使った処理
  }, errorCallback);

ページング

var customerPoints = new ElasticCart.CustomerPoints();
// ポイント一覧を20件ずつ、有効期限が近い順に取得
customerPoints.fetch({ limit: 20, sort:'expired_at', direction: 'asc' }, function (results) {
        // 総該当件数の取得
        customerPoints.getMeta().total;
        // 総ページ数の取得
        customerPoints.getMeta().total_pages;
        // 現在のページの取得
        customerPoints.getMeta().page;
        // 次のページが存在するか
        customerPoints.hasNext();
        // 次のページのポイント一覧を取得
        customerPoints.fetchNext(function (nextResults) {
            // nextResults が次のポイント一覧
        });
        // 前のページが存在するか
        customerPoints.hasPrev();
        // 前のページのポイント一覧を取得
        customerPoints.fetchPrev(function (prevResults) {
            // prevResults が前のポイント一覧
        });

    })

リクエストパラメーター

パラメーター名 In 型 必須 説明
store_code query string false 店舗コード
limit query integer(int32) false 表示件数
page query integer(int32) false 表示ページ
sort query string false ソート対象
direction query string false ソート方向

オプション値

sort
パラメーター名 値 説明
sort expired_at 有効期限
sort activated_at ポイント付与日
sort remaining_point 残りポイント数
direction
パラメーター名 値 説明
direction asc 昇順
direction desc 降順

レスポンス

ステータスコード 意味 説明
200 OK 顧客所持ポイントの一覧

200 レスポンス

{
  "meta": {
      "success": true,
      "status": 200,
      "has_prev": false,
      "has_next": false,
      "total": 1,
      "total_pages": 1,
      "per_page": 20,
      "page": 1,
      "current": 1,
      "next": null,
      "prev": null
  },
  "data": {
      "points": [
        {
            "id": 1,
            "customer_id": 1,
            "order_id": 1,
            "name": "購入ポイント100",
            "point_addition_rule_id": 1,
            "activated_at": "2019-02-01 11:22:33",
            "point": "100",
            "remaining_point": "300",
            "expired_at": "2037-03-31 23:59:59",
            "status": "active",
            "store_code": "default",
            "usable_any_store": "true"
            }
      ]
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> points array<ポイント> 所持ポイント
>> id integer(int64) ID
>> customer_id integer(int64) 顧客ID
>> order_id integer(int64) 注文ID
>> name string ポイント名称
>> point_addition_rule_id integer(int64) ポイント付与ルールID
>> activated_at string(date-time) ポイント付与日
>> point integer 付与ポイント数
>> remaining_point integer 残りポイント数
>> expired_at string(date-time) 有効期限
>> status string ポイントステータス
>> store_code string 付与先店舗コード
>> usable_any_store boolean 他店舗使用可フラグ
プロパティ名 型 説明
meta MetaApiPaging メタ情報 ページング
> success boolean レスポンス成功
> has_prev boolean 前のページが存在するか
> has_next boolean 次のページが存在するか
> total integer 全件数
> total_pages integer 全ページ数
> per_page integer ページあたり表示件数
> page integer 現在のページ
> current integer 表示件数
> next string(url) 次のページのURL
> prev string(url) 前のページのURL

モデルスキーマ

Point(ポイント)

{
  "id": 1,
  "customer_id": 1,
  "order_id": 1,
  "name": "購入ポイント100",
  "point_addition_rule_id": 1,
  "activated_at": "2019-02-01 11:22:33",
  "point": "100",
  "remaining_point": "300",
  "expired_at": "2037-03-31 23:59:59",
  "status": "active",
  "store_code": "default",
  "usable_any_store": "true"
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
customer_id integer(int64) false none 顧客ID
order_id integer(int64) false none 注文ID
name string false none ポイント名称
point_addition_rule_id integer(int64) false none ポイント付与ルールID
activated_at string(date-time) false none ポイント付与日
point integer false none 付与ポイント数
remaining_point integer false none 残りポイント数
expired_at string(date-time) false none 有効期限
status string false none ポイントステータス
store_code string false none 付与先店舗コード
usable_any_store boolean false none 他店舗使用可フラグ

オプション値

ポイントステータス
プロパティ名 値 説明
status draft 未確定
status active 有効
status disable 無効

PointSummary(所持ポイント概要)

{
  "customer_id": 1,
  "remaining_points": 500,
  "will_soon_expire_points": [
    {
      "customer_id": 1,
      "expired_at": "2018-12-31T23:59:59+09:00",
      "sum_of_points": 100
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
customer_id integer(int64) false none 顧客ID
remaining_points integer false none 所持ポイント数
will_soon_expire_points array<WillSoonExpirePoint> false none まもなく期限切れとなるポイント数

WillSoonExpirePoint(まもなく期限切れとなるポイント数)

{
  "customer_id": 1,
  "expired_at": "2018-12-31T23:59:59+09:00",
  "sum_of_points": 100
}

プロパティ

プロパティ名 型 必須 制限 説明
customer_id integer(int64) false none 顧客ID
expired_at string(date-time) false none 期限日時
sum_of_points integer false none 期限切れとなる合計ポイント数

簡易ブログプラグイン (TinyBlog)

ブログ記事リストの取得

公開中の記事リストを取得します。

GET /tiny_blog/posts.json HTTP/1.1
use Elcart\TinyBlogPosts;

// 最新の10件を取得する
$posts = (new TinyBlogPosts())->search(['limit' => 10]);
// 次のページが存在するか
$posts->hasNext();
// 前のページが存在するか
$posts->hasPrev();
// 現在のページ数
$posts->getCurrentPage();
// 全ページ数
$posts->getTotalPages();

// 取得したデータを利用する
foreach ($posts as $post) {
    /** @var Elcart\Entity\TinyBlogPost $post */
    $post->title; // タイトル
    $post->body; // コンテンツ
    $post->eyecatch_url['small']; // アイキャッチ画像URL
    $post->publish_datetime; // 公開日時
}

リクエストパラメーター

パラメーター名 In 型 必須 説明
limit query integer(int32) false 表示件数
page query integer(int32) false 表示ページ

レスポンス

ステータスコード 意味 説明
200 OK ブログ記事の一覧

200 レスポンス

{
  "data": {
    "posts": {
      "title": "夏の特別セール",
      "body": "7月のお得なセールのお知らせです。...",
      "eyecatch_url": {
        "original": "https://example.com/uploads/TinyBlogPosts/original.jpg",
        "thumb": "https://example.com/uploads/TinyBlogPosts/thumb.jpg",
        "small": "https://example.com/uploads/TinyBlogPosts/small.jpg",
        "large": "https://example.com/uploads/TinyBlogPosts/large.jpg"
      },
      "publish_datetime": "2020-12-23T11:22:33+09:00"
    }
  },
  "meta": {
    "success": true,
    "has_prev": true,
    "has_next": true,
    "total": 99,
    "total_pages": 12,
    "per_page": 20,
    "page": 2,
    "current": 20,
    "next": "https://example.com/cart/api/v1/tiny_blog/posts?page=3",
    "prev": "https://example.com/cart/api/v1/tiny_blog/posts?page=1"
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object 投稿リストの取得
> posts TinyBlogPost ブログ記事
>> title string ページタイトル
>> body string コンテンツ
>> eyecatch_url TinyBlogPostEyecatchUrl アイキャッチ画像URL
>>> original string 元画像URL
>>> thumb string 画像URL(サムネイル)
>>> small string 画像URL(小)
>>> large string 画像URL(大)
>> publish_datetime string(date-time) 公開日時
meta MetaApiPaging メタ情報 ページング
> success boolean レスポンス成功
> has_prev boolean 前のページが存在するか
> has_next boolean 次のページが存在するか
> total integer 全件数
> total_pages integer 全ページ数
> per_page integer ページあたり表示件数
> page integer 現在のページ
> current integer 表示件数
> next string(url) 次のページのURL
> prev string(url) 前のページのURL

指定記事の取得

GET /tiny_blog/posts/{id}.json HTTP/1.1
use Elcart\TinyBlogPosts;

// id:2 の記事を取得する
$post = (new TinyBlogPosts())->get(2);

// 取得したデータを利用する
if ($post) {
    $post->title; // タイトル
    $post->body; // コンテンツ
    $post->eyecatch_url['small']; // アイキャッチ画像URL
    $post->publish_datetime; // 公開日時
}

リクエストパラメーター

パラメーター名 In 型 必須 説明
id path integer true 投稿ID

レスポンス

ステータスコード 意味 説明
200 OK ブログ記事

200 レスポンス

{
  "data": {
    "post": {
      "title": "夏の特別セール",
      "body": "7月のお得なセールのお知らせです。...",
      "eyecatch_url": {
        "original": "https://example.com/uploads/TinyBlogPosts/original.jpg",
        "thumb": "https://example.com/uploads/TinyBlogPosts/thumb.jpg",
        "small": "https://example.com/uploads/TinyBlogPosts/small.jpg",
        "large": "https://example.com/uploads/TinyBlogPosts/large.jpg"
      },
      "publish_datetime": "2020-12-23T11:22:33+09:00"
    }
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object 投稿取得
> post TinyBlogPost ブログ記事
>> title string ページタイトル
>> body string コンテンツ
>> eyecatch_url TinyBlogPostEyecatchUrl アイキャッチ画像URL
>>> original string 元画像URL
>>> thumb string 画像URL(サムネイル)
>>> small string 画像URL(小)
>>> large string 画像URL(大)
>> publish_datetime string(date-time) 公開日時

モデルスキーマ

TinyBlogPost (ブログ記事)

{
  "title": "夏の特別セール",
  "body": "7月のお得なセールのお知らせです。...",
  "eyecatch_url": {
    "original": "https://example.com/uploads/TinyBlogPosts/original.jpg",
    "thumb": "https://example.com/uploads/TinyBlogPosts/thumb.jpg",
    "small": "https://example.com/uploads/TinyBlogPosts/small.jpg",
    "large": "https://example.com/uploads/TinyBlogPosts/large.jpg"
  },
  "publish_datetime": "2020-12-23T11:22:33+09:00"
}

プロパティ

プロパティ名 型 必須 制限 説明
title string false none ページタイトル
body string false none コンテンツ
eyecatch_url TinyBlogPostEyecatchUrl false none アイキャッチ画像URL
publish_datetime string(date-time) false none 公開日時

TinyBlogPostEyecatchUrl (アイキャッチ画像URL)

{
  "original": "https://example.com/uploads/TinyBlogPosts/original.jpg",
  "thumb": "https://example.com/uploads/TinyBlogPosts/thumb.jpg",
  "small": "https://example.com/uploads/TinyBlogPosts/small.jpg",
  "large": "https://example.com/uploads/TinyBlogPosts/large.jpg"
}

プロパティ

プロパティ名 型 必須 制限 説明
original string false none 元画像URL
thumb string false none 画像URL(サムネイル)
small string false none 画像URL(小)
large string false none 画像URL(大)

顧客画像アップロードプラグイン (CustomerUploadImage)

画像の投稿

POST /profile/customer_upload_image HTTP/1.1

HTML部分

  <form class="customer-upload-image-form" id="upload-image-form">
    <fieldset>
      <label for="image">画像の選択</label>
      <input
        id="image"
        name="image"
        placeholder=""
        required="required"
        type="file" />
    </fieldset>
    <fieldset>
      <label for="comment" class="input__label">コメント</label>
      <textarea type="text" id="comment" name="comment"> </textarea>
    </fieldset>

    <button id="btn" type="button">この内容で送信する</button>
  </form>

スクリプト部分

  var btn = document.getElementById('btn');
  btn.addEventListener('click', function() {
    var image = document.querySelector('input[name=image]');
    var CustomerUploadImages = new ElasticCart.CustomerUploadImages();

    CustomerUploadImages.post({
      image: image.files[0],
      comment: document.getElementById('comment').value
    })
      .then(result => {
        // アップロード成功時の処理
        console.log(result);
      })
      .catch(error => {
        // アップロード失敗時の処理
        console.log(error);
      });
  });

リクエストパラメーター

パラメーター名 In 型 必須 説明
image body string(binary) true 画像ファイル
comment body string false コメント

レスポンス

ステータスコード 意味 説明
200 OK 顧客アップロード画像

200 レスポンス

{
  "data": {
    "customer_upload_image": {
      "id": 1,
      "posted_at": "item-001",
      "comment": "example comments"
    }
  }
}

### レスポンススキーマ

ステータスコード **200**

|プロパティ名|型|説明|
|---|---|---|---|---|
|data|object| |
|<i>&gt;</i>customer_upload_image|[CustomerUploadImage](#schema-customeruploadimage)|顧客アップロード画像|
|<i>&gt;</i><i>&gt;</i>id|integer(int64)|ID|
|<i>&gt;</i><i>&gt;</i>posted_at|string|投稿日時|
|<i>&gt;</i><i>&gt;</i>comment|string|コメント|

<aside class="warning">
この操作には認証が必要です。<code>/customer/login</code> により顧客ログイン状態となっている必要があります。
</aside>

<h2 id="customer-upload-image-schema">モデルスキーマ</h2>

### CustomerUploadImage(顧客アップロード画像)

<a id="schema-customeruploadimage"></a>

```json
{
  "id": 1,
  "posted_at": "item-001",
  "comment": "example comments"
}

プロパティ

プロパティ名 型 必須 制限 説明
id integer(int64) false none ID
posted_at string false none 投稿日時
comment string false none コメント

配送予定日表示プラグイン (EstimatedArrivalDate)

全ての配送事業者の配送予定日リストの取得

GET /estimated_arrival_dates HTTP/1.1
const estimatedArrivalDates = new ElasticCart.EstimatedArrivalDates();
estimatedArrivalDates.fetch((results) => {
    // results が 配送事業者ごとの配送予定日リスト
});
$results = elcart_get_estimated_arrival_dates();

// 取得したデータを利用する
foreach ($results as $result) {
    /** @var Elcart\Entity\EstimatedArrivalDateByDeliveryProvider $result */
    $result->delivery_provider->name; // 配送業者名
    foreach ($result->arrival_dates as $arrivalDate) {
        /** @var Elcart\Entity\ArrivalDatesByRegion $arrivalDate */
        $arrivalDate->region; // 地域名
        $arrivalDate->arrival_date; // 配送予定日
    }
}

// デフォルトの配送業者の配送予定日を取得する
$defaultProviderResult = $results->getDefault();
$defaultProviderResult->delivery_provider->name; // 配送業者名
foreach ($defaultProviderResult->arrival_dates as $arrivalDate) {
    /** @var Elcart\Entity\ArrivalDatesByRegion $arrivalDate */
    $arrivalDate->region; // 地域名
    $arrivalDate->arrival_date; // 配送予定日
}

リクエストパラメーター

パラメーター名 In 型 必須 説明
time query string(date-time) false 基準時刻

レスポンス

ステータスコード 意味 説明
200 OK 配送事業者の配送予定日リスト

200 レスポンス

{
  "data": {
    "arrivalDates": [
      {
        "delivery_provider": {
          "name": "default",
          "is_default": "true"
        },
        "arrival_dates": [
          {
            "region": "北海道",
            "arrival_date": "2019-11-22 11:22:33"
          }
        ]
      }
    ]
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object 全ての配送事業者の配送予定日リスト取得
> arrivalDates ArrivalDatesByDeliveryProvider 全ての配送事業者の配送予定日リスト
>> delivery_provider object 配送業者
>>> name string 配送業者名
>>> is_default boolean 標準の配送業者フラグ
>> arrival_dates array<ArrivalDateByRegion> 最短配送予定日のリスト
>>> region string 地域名
>>> arrival_date string(date-time) 最短配送日

モデルスキーマ

ArrivalDatesByDeliveryProvider (配送業者別最短配送日リスト)

{
  "delivery_provider": {
    "name": "default",
    "is_default": "true"
  },
  "arrival_dates": [
    {
      "region": "北海道",
      "arrival_date": "2019-11-22 11:22:33"
    }
  ]
}

プロパティ

プロパティ名 型 必須 制限 説明
delivery_provider object false none 配送業者
> name string false none 配送業者名
> is_default boolean false none 標準の配送業者フラグ
arrival_dates array<ArrivalDateByRegion> false none 最短配送予定日のリスト

ArrivalDateByRegion (地域別最短配送日)

{
  "region": "北海道",
  "arrival_date": "2019-11-22 11:22:33"
}

プロパティ

プロパティ名 型 必須 制限 説明
region string false none 地域名
arrival_date string(date-time) false none 最短配送日

レンタルプラグイン (Rental)

決済待ち注文の取得

見積り後支払いの注文フローにおいて、トークンから決済待ちの注文を取得します。

GET /rental/payment_awaiting_order/exists HTTP/1.1
// 決済待ち注文の有効なトークン
var token = '{有効なトークン}';
ElasticCart.RentalOrder.exists(token, function (order) {
     // 注文情報 `order`を使った処理
}, errorCallback);

リクエストパラメーター

パラメーター名 In 型 必須 説明
token query string true 照会トークン

レスポンス

ステータスコード 意味 説明
200 OK 注文情報

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_postcode": "8100001",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_postcode": "8100001",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_postcode": "8100001",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object  
> order Order 注文情報

決済待ち注文の確定

見積り後支払いの注文フローにおいて、決済待ちの注文を確定し、注文を完了します。

POST /rental/payment_awaiting_order/place_order HTTP/1.1
new ElasticCart.RentalOrder().placeOrder({
    token: '{有効な決済待ち注文のトークン}',
    card: '{有効なカードトークン}'
}, function(order) {
    // 注文の確定 成功時の処理
    alert('ご注文ありがとうございます。');
}, function(response) {
    // 注文の確定 失敗時の処理
    alert('注文の確定に失敗しました。');
});

リクエストパラメーター

パラメーター名 In 型 必須 説明
token body string true 照会トークン
card body string false カードトークン(PAY.jp/Stripe)

レスポンス

ステータスコード 意味 説明
200 OK 注文情報
404 Not Found トークン無効
422 Unprocessable Entity 注文確定失敗(入力エラー)

200 レスポンス

{
  "data": {
    "order": {
      "id": 1,
      "store_code": "default",
      "status": "draft",
      "ordered_at": "2018-12-23T11:22:33+09:00",
      "shipping_at": "2018-12-23T11:22:33+09:00",
      "canceled_at": "2018-12-23T11:22:33+09:00",
      "memo": "",
      "customer_id": 1,
      "customer_lastname": "山田",
      "customer_firstname": "太郎",
      "customer_lastname_kana": "ヤマダ",
      "customer_firstname_kana": "タロウ",
      "customer_phone": "09011110000",
      "customer_email": "customer@example.com",
      "customer_agree_terms": true,
      "customer_force_register": true,
      "customer_postcode": "8100001",
      "customer_pref": "福岡県",
      "customer_address_city": "福岡市中央区",
      "customer_address_street": "天神1-2",
      "customer_address_building": "サンプルビル305",
      "customer_gender": "2",
      "customer_gender_name": "女性",
      "customer_birthday": "1980-08-09",
      "customer_fullname": "山田 太郎",
      "customer_fullname_kana": "ヤマダ タロウ",
      "billing_same_to_customer": true,
      "billing_lastname": "山田",
      "billing_firstname": "太郎",
      "billing_lastname_kana": "ヤマダ",
      "billing_firstname_kana": "タロウ",
      "billing_phone": "09011110000",
      "billing_postcode": "8100001",
      "billing_pref": "福岡県",
      "billing_address_city": "福岡市中央区",
      "billing_address_street": "天神1-2",
      "billing_address_building": "サンプルビル305",
      "billing_fullname": "山田 太郎",
      "billing_fullname_kana": "ヤマダ タロウ",
      "shipping_same_to_billing": true,
      "shipping_lastname": "山田",
      "shipping_firstname": "太郎",
      "shipping_lastname_kana": "ヤマダ",
      "shipping_firstname_kana": "タロウ",
      "shipping_phone": "09011110000",
      "shipping_postcode": "8100001",
      "shipping_pref": "福岡県",
      "shipping_address_city": "福岡市中央区",
      "shipping_address_street": "天神1-2",
      "shipping_address_building": "サンプルビル305",
      "shipping_fullname": "山田 太郎",
      "shipping_fullname_kana": "ヤマダ タロウ",
      "payment_type": "bank",
      "payment_status": 0,
      "total": 11660,
      "subtotal": 10000,
      "subtotal_discount": 0,
      "subtotal_discounted": true,
      "shipping_cost": 560,
      "shipping_discount": 0,
      "shipping_discounted": true,
      "other_cost": 0,
      "other_cost_discounted": true,
      "payment_cost": 300,
      "payment_cost_discounted": true,
      "tax": 800,
      "tax_type": 2,
      "tax_calculate_type": 2,
      "tax_rounding_method": 1,
      "delivery_time": "00",
      "details": [
        {
          "id": 1,
          "order_id": 1,
          "product_id": 1,
          "code": "item-001",
          "name": "サンプル商品",
          "unit_price": 1500,
          "amount": 2,
          "price": 3000,
          "discount": 200,
          "discounted": true,
          "actual_price": 2800,
          "tax_rate": 10,
          "tax_type": 1,
          "tax_mark": "*",
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "wrapping_type": "内祝い",
          "wrapping_text": "山田 太郎",
          "shipping_category_id": 1,
          "shipping_category": {
            "id": 1,
            "name": "常温",
            "default_fee": 1500,
            "enable_shipping_with_other": true,
            "css_class": "-shipping-normal"
          },
          "discounts": [
            {
              "id": 1,
              "order_id": 1,
              "order_detail_id": 1,
              "target": "item",
              "target_name": "商品値引き",
              "priority": 10,
              "name": "初回購入割引",
              "discount": 300
            }
          ]
        }
      ],
      "taxes": [
        {
          "id": 1,
          "tax": 1000,
          "subtotal": 10000,
          "discount": 0,
          "tax_rate": 10,
          "tax_type": 0,
          "tax_calculate_type": 2,
          "tax_rounding_method": 1,
          "mark": "※",
          "description": "※印は軽減税率対象商品"
        }
      ],
      "payment_request": {},
      "subtotal_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "shipping_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "payment_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ],
      "other_cost_discounts": [
        {
          "id": 1,
          "order_id": 1,
          "order_detail_id": 1,
          "target": "item",
          "target_name": "商品値引き",
          "priority": 10,
          "name": "初回購入割引",
          "discount": 300
        }
      ]
    }
  }
}

404 422レスポンス

{
    "meta": {
        "message": "string",
        "inputs": "object",
        "errors": "object"
    }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object  
> order Order 注文情報

ステータスコード 404

プロパティ名 型 説明
data object
> disable_dates array [ ]
meta object
> success boolean レスポンス成功
> message string エラーメッセージ

ステータスコード 422

プロパティ名 型 説明
meta InvalidInputResponse エラーレスポンス(入力エラー)
> message string エラーメッセージ
> inputs object 入力内容
> errors object エラー内容

日別貸し出し可能数の取得

指定商品の指定期間における、貸し出し可能数、単価を取得します。

GET /products/{code}/rental_calendar HTTP/1.1
<?php
elcart_get_product_rental_calendar('{商品コード}', '{取得開始日}', '{取得終了日}');

// 例:商品コード`item-001`の商品の2019/9/1〜2010/9/15までの日別貸し出し可能数の取得
elcart_get_product_rental_calendar('item-001', '2019-09-01', '2019-09-15');
new ElasticCart.ProductRentalCalendar().fetchCalendar(
    '{商品コード}',
    '{取得開始日}',
    '{取得終了日}'
);

// 例:商品コード`item-001`の商品の2019/9/1〜2010/9/15までの日別貸し出し可能数の取得
new ElasticCart.ProductRentalCalendar().fetchCalendar(
    'item-001',
    '2019-09-01',
    '2019-09-15'
);

リクエストパラメーター

パラメーター名 In 型 必須 説明
code path string true 商品コード
since query string(date) true 取得開始日
until query string(date) true 取得終了日

レスポンス

ステータスコード 意味 説明
200 OK 日別貸し出し可能数
404 Not Found 貸し出し在庫設定なし

200 レスポンス

{
  "meta": {
    "success": true
  },
  "data": {
    "calendar": [
      {
        "date": "2019-09-01",
        "weekday": 0,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-02",
        "weekday": 1,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-03",
        "weekday": 2,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-04",
        "weekday": 3,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-05",
        "weekday": 4,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-06",
        "weekday": 5,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-07",
        "weekday": 6,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-08",
        "weekday": 0,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-09",
        "weekday": 1,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-10",
        "weekday": 2,
        "remaining": 5,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-11",
        "weekday": 3,
        "remaining": 3,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-12",
        "weekday": 4,
        "remaining": 3,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-13",
        "weekday": 5,
        "remaining": 3,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-14",
        "weekday": 6,
        "remaining": 3,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      },
      {
        "date": "2019-09-15",
        "weekday": 0,
        "remaining": 3,
        "unit_price": 1000,
        "unit_price_with_tax": 1000,
        "unit_price_without_tax": 926,
        "tax_type": 1
      }
    ]
  }
}


404 レスポンス

{
    "data": {
        "disable_dates": []
    },
    "meta": {
        "success": false,
        "message": "日別貸し出し可能数が取得できません。"
    }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> calendar RentalCalendar 日別貸し出し可能数
>> date string(date) 日付
>> weekday integer 曜日
>> remaining integer 在庫数
>> unit_price integer 日別レンタル単価
>> unit_price_with_tax integer 税込み日別レンタル単価
>> unit_price_without_tax integer 税抜き日別レンタル単価
>> tax_type integer 消費税区分

ステータスコード 404

プロパティ名 型 説明
data object
> disable_dates array [ ]
meta object
> success boolean レスポンス成功
> message string エラーメッセージ

貸し出し不可日の取得

指定商品の指定期間における、貸し出し不可日を取得します。

GET /products/{code}/rental_calendar/disable_dates HTTP/1.1
<?php
elcart_get_product_rental_disable_dates('{商品コード}', '{取得開始日}', '{取得終了日}');

// 例 商品コード`item-001`の商品の2019/9/1〜2010/9/30までの貸し出し不可日を取得
elcart_get_product_rental_disable_dates('item-001', '2019-09-01', '2019-09-30');

new ElasticCart.ProductRentalCalendar().fetchDisableDates(
    '{商品コード}',
    '{取得開始日}',
    '{取得終了日}'
);

// 例:商品コード`item-001`の商品の2019/9/1〜2010/9/30までの貸し出し不可日を取得
new ElasticCart.ProductRentalCalendar().fetchDisableDates(
    'item-001',
    '2019-09-01',
    '2019-09-30'
);

リクエストパラメーター

パラメーター名 In 型 必須 説明
code path string true 商品コード
since query string(date) true 取得開始日
until query string(date) true 取得終了日

レスポンス

ステータスコード 意味 説明
200 OK 貸し出し不可日
404 Not Found 貸し出し不可日なし

200 レスポンス

{
    "data": {
        "disable_dates": [
            "2019-09-26",
            "2019-09-27",
            "2019-09-28",
            "2019-09-29",
            "2019-09-30"
        ]
    }
}

404 レスポンス

{
    "data": {
        "disable_dates": []
    },
    "meta": {
        "success": false,
        "message": "貸し出し不可日が取得できません。"
    }
}

レスポンススキーマ

ステータスコード 200

プロパティ名 型 説明
data object
> disable_dates array 貸し出し不可日

ステータスコード 404

プロパティ名 型 説明
data object
> disable_dates array [ ]
meta object
> success boolean レスポンス成功
> message string エラーメッセージ

モデルスキーマ

RentalCalendar(日別貸し出し可能数)

{
  "date": "2019-05-23",
  "weekday": 4,
  "remaining": 9,
  "unit_price": 1500,
  "unit_price_with_tax": 1500,
  "unit_price_without_tax": 1500,
  "tax_type": 1
}

プロパティ

プロパティ名 型 必須 制限 説明
date string(date) false none 日付
weekday integer false none 曜日
remaining integer false none 在庫数
unit_price integer false none 日別レンタル単価
unit_price_with_tax integer false none 税込み日別レンタル単価
unit_price_without_tax integer false none 税抜き日別レンタル単価
tax_type integer false none 表示単価の税区分