UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 52.7 kB
{"openapi":"3.0.0","servers":[{"url":"https://api.shop-pro.jp"}],"info":{"contact":{"name":"お問い合せ窓口","url":"https://shop-pro.jp/?mode=inq"},"description":"# カラーミーショップアプリストア API\n\n[アプリストア](https://app.shop-pro.jp/)にて公開するアプリに対して、一般公開している[カラーミーショップAPI](https://developer.shop-pro.jp/docs/colorme-api)に加えて、カラーミーショップアプリストアAPI(以下、アプリストアAPIといいます)を利用することが出来ます。アプリストアAPIでは以下のことが行えます。\n- 課金データ(アプリ内課金、従量課金)の作成\n- インラインスクリプトタグの取得・作成・更新・削除\n- スクリプトタグの取得・作成・更新・削除\n\n## 利用手順\n\nアプリストアAPIを利用するには、OAuth認証が必要です。OAuth認証の基本的な流れについては[カラーミーショップAPIドキュメント](https://developer.shop-pro.jp/docs/colorme-api)を参照してください。\nアプリストアAPIの利用のために、以下のscopeが追加で指定可能になります。[カラーミーショップAPIドキュメント](https://developer.shop-pro.jp/docs/colorme-api)に掲載されているscopeと合わせてご利用ください。\n\n|スコープ|機能|\n|---|---|\n|`write_application_charge`|課金データの作成|\n|`read_shop_script_tags`|ショップページのスクリプトタグを参照|\n|`write_shop_script_tags`|ショップページへスクリプトタグを追加・更新|\n|`read_inline_script_tags`|インラインスクリプトタグを参照|\n|`write_inline_script_tags`|インラインスクリプトタグを追加・更新|\n|`read_script_tags`|スクリプトタグを参照(deprecated)|\n|`write_script_tags`|スクリプトタグを追加・更新(deprecated)|\n\n(例) カラーミーショップアカウントの認証ページを表示\n```\nhttps://api.shop-pro.jp/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=read_products%20write_products%20write_application_charge\n```\n\n## 課金設定\n料金プラン(月額課金・従量課金・買い切り)による課金や、アプリ内課金をご利用いただくにはアプリごとに課金設定の登録が必要です。\nこの設定は [カラーミーショップ デベロッパー](https://developer.shop-pro.jp) から行うことができます。\n\n登録できる課金形式やその使い方の詳細については[アプリストア 開発ガイドのアプリ課金のページ](https://developer.shop-pro.jp/getting-started/appstore-billing/)をご覧ください\n\n## アプリのインストール\nショップオーナーがアプリをインストールしたとき、以下の処理をカラーミーショップが行います。\n- 選択された料金プランに基づき課金開始\n- インストールフックの呼び出し\n\n### インストールフック\nアプリのインストール時に、インストールに関する情報を `POST` メソッド、 `application/json` 形式で通知します。\n通知先のURLは[カラーミーショップ デベロッパー](https://developer.shop-pro.jp/)にログインし、各アプリストア アプリのアプリ設定から登録を行ってください。\n\n以下のパラメータが送信されます。課金請求に必要なパラメータを含みますので、必ず受け取れるようにしてください。\n\n|パラメータ|機能|形式|\n|---|---|---|\n|`account_id`|インストールしたショップオーナーのアカウントID|PA+8桁の整数|\n|`application_charge_source_id`|プラン課金ID|数字と大文字アルファベットで構成される文字列(6桁以上)|\n|`recurring_application_charge_id`|(買い切り以外の課金の場合)課金契約ID|数字と大文字アルファベットで構成される文字列(6桁以上)|\n|`application_charge_id`|(買い切りの場合)課金契約ID|数字と大文字アルファベットで構成される文字列(6桁以上)|\n|`trial_term`|(無料お試し期間がある場合)無料お試し期間|JSONオブジェクト|\n|`mail`|ショップオーナーへの連絡メールアドレス|文字列|\n\n`application_charge_source_id` はデベロッパーサイトで設定したプラン課金のIDです。インストールされた料金プランの判別にご利用いただけます。\n\n`recurring_application_charge_id` と `application_charge_id` はインストールごとに発行されるユニークなIDです。ショップオーナーが一度アンインストールした後に、再度同じショップオーナーがアプリのインストールを行った際には新たに別のIDが発行されます。\n\n`recurring_application_charge_id` は「買い切り」以外の課金である「無料」「月額」「月額+従量」「月額+初期費用」「従量のみ」のプラン課金のインストールの際に発行されます。\n\n従量による課金を伴うプラン課金の場合は、従量分の料金を請求する際に 課金契約ID(`recurring_application_charge_id`) が必要になるので、必ず記録するようにしてください。\n\n`mail` パラメータの値はショップオーナーへの連絡手段としてご利用いただけます。インストール後に認可フローが中断され、アクセストークンが得られない際のショップオーナーへの連絡手段としてご活用いただけます。このパラメータはカラーミーショップの非公開情報として登録されている値です。左記以外の用途でこの値をアプリの機能で使用しないでください。\n\n例) 買い切りの場合\n```\n{\n \"account_id\": \"PA00000001\",\n \"application_charge_source_id\": \"F3RN9A\",\n \"application_charge_id\": \"A3FT4N\",\n \"mail\": \"shop@example.com\"\n}\n```\n\n例) 月額課金の場合\n```\n{\n \"account_id\": \"PA00000001\",\n \"application_charge_source_id\": \"F3RN9A\",\n \"recurring_application_charge_id\": \"A3FT4N\",\n \"mail\": \"shop@example.com\"\n}\n```\n\n無料お試し期間を設定した課金の場合、以下の情報を `trial_term` パラメータとして送信します。\n無料お試し期間中は従量課金APIを呼び出して課金請求することはできません。\n\n|パラメータ|機能|形式|\n|---|---|---|\n|`starts_at`|無料お試し開始日時|整数値(UNIXタイムスタンプ)|\n|`ends_at`|無料お試し終了日時|整数値(UNIXタイムスタンプ)|\n\n例) 無料お試し期間がある月額課金の場合\n```\n{\n \"account_id\": \"PA00000001\",\n \"application_charge_source_id\": \"F3RN9A\",\n \"recurring_application_charge_id\": \"A3FT4N\",\n \"mail\": \"shop@example.com\",\n \"trial_term\" {\n \"starts_at\": 1565017200,\n \"ends_at\": 1567609200\n }\n}\n```\n\n受け取りに成功した場合は、以下のパラメータを `application/json` 形式でレスポンスボディに付与し、\nステータスコード `200` レスポンスをカラーミーショップへ返却してください。\nステータスコード `200` レスポンスをカラーミーショップが受け取れない場合、もしくは以下のパラメーターが返却されなかった場合、インストールを中止し、インストールによって発生した情報は破棄されます。\n\n|パラメータ|機能|形式|\n|---|---|---|\n|`redirect_url`|インストール成功後に遷移するURL|文字列(URL)|\n\n例)\n```\n{\n \"redirect_url\": \"https://example.com\"\n}\n```\nインストール完了後、インストールフックのレスポンスパラメータの `redirect_url` へ画面遷移しますので、APIを利用する場合は `redirect_url` より先の画面でOAuth認証の実装をお願いします。\n\n## アプリのアンインストール\nショップオーナーがアプリをアンインストールしたとき、以下の処理をカラーミーショップが行います。\n- OAuth認証のアクセストークンの無効化\n- 登録したインラインスクリプトタグ・スクリプトタグの削除\n- 月額課金形式の場合、継続課金の無効化\n\n### アンインストールフック\nアンインストール直後に `POST` メソッドで、以下の情報を `application/json` 形式で通知します。\n通知先のURLは[カラーミーショップ デベロッパー](https://developer.shop-pro.jp/)にログインし、各アプリストア アプリのアプリ設定から登録を行ってください。\n\n※ [アンインストールAPI](#operation/deleteInstallation)のご利用によるアンインストール時はアンインストールフックは通知されません。\n\n受け取りに成功した場合はステータスコード `200` のレスポンスを返却してください。\n\n|パラメータ|機能|形式|\n|---|---|---|\n|`account_id`|アンインストールしたショップオーナーのアカウントID|PA+8桁の整数|\n|`application_charge_source_id`|プラン課金ID|数字と大文字アルファベットで構成される文字列(6桁以上)|\n|`uninstalled_at`|アンインストール日時|整数値(UNIXタイムスタンプ)|\n|`reason`|アンインストール理由| `by_shop_owner` (ショップオーナーによる)<br /> `by_unpaid` (未払いによる) |\n|`recurring_application_charge_id`|(買い切り以外の課金の場合)課金契約ID|数字と大文字アルファベットで構成される文字列(6桁以上)|\n|`usage_charge`|(従量課金の場合)従量課金アンインストール情報|JSONオブジェクト|\n\nアンインストールフックの通知が伴うアンインストールは以下の操作のいずれかによって行われます。アンインストールの理由を `reason` パラメータで確認できます。\n\n|reasonパラメータの値|アンインストール理由|\n|---|---|\n|`by_shop_owner`|ショップオーナーによるアンインストール操作|\n|`by_unpaid`|ポイント不足による利用料徴収の失敗による自動アンインストール|\n\n課金契約ID `recurring_application_charge_id` はインストールフックで通知したIDと同じIDが通知されます。\n\n料金プランが従量課金の場合、アンインストール後に従量課金データの作成を可能にするために、以下の情報を `usage_charge` パラメータとして送信します。\nアンインストール後はOAuthのアクセストークンが無効化されているため、アクセストークンを利用して従量課金APIを呼び出すことができなくなります。\nアンインストール後はアクセストークンの代わりに `api_token` をリクエストヘッダーに含め、従量課金APIを呼び出してください。\n無料お試し期間中にアプリがアンインストールされた場合は、`api_token` は発行されません。\n詳しくは、[従量課金データの作成](https://app.shop-pro.jp/open_api#operation/createUsageCharge)を参照してください。\n`api_token` を利用した従量課金APIの呼び出しは、ポイント締め日 `closing_on` までとなっておりますので、ご注意ください。\n\n|パラメータ|機能|形式|\n|---|---|---|\n|`api_token`|アンインストール後に従量課金APIを利用いただくために必要な情報|文字列|\n|`closing_on`|ポイント締め日|整数値(UNIXタイムスタンプ)|\n\n通常、 `closing_on` は、アンインストール直前まで利用されていた契約の期間の月末となります。以下に例を示します。\n\n|アンインストール日|直前まで利用されていた契約の期間|closing_on の示す日時|\n|---|---|---|\n|2021/01/09|2021/12/10〜2021/01/09|2021/01/31|\n|2021/01/10|2021/01/10〜2021/02/09|2021/02/28|\n\n従量課金の場合のユーザーの契約期間については[こちら](https://shop-pro.jp/manual/appstore_fee)をご参照ください\n\nアンインストールフックの例を以下に示します。\n\n例) 買い切りの場合\n```\n{\n \"account_id\": \"PA00000001\",\n \"application_charge_source_id\": \"Q21GPC\",\n \"uninstalled_at\": 1552022739,\n \"reason\": \"by_shop_owner\"\n}\n```\n\n例) 月額課金の場合\n```\n{\n \"account_id\": \"PA00000001\",\n \"application_charge_source_id\": \"EW3V21\",\n \"recurring_application_charge_id\": \"F3RN9A\",\n \"uninstalled_at\": 1552022740,\n \"reason\": \"by_shop_owner\"\n}\n```\n\n例) 従量課金を含む月額課金の場合\n```\n{\n \"account_id\": \"PA00000001\",\n \"application_charge_source_id\": \"WA37CA\",\n \"recurring_application_charge_id\": \"F3WQ1S\",\n \"uninstalled_at\": 1552022740,\n \"reason\": \"by_shop_owner\",\n \"usage_charge\": {\n \"api_token\": \"token\",\n \"closing_on\": 1552533465\n }\n}\n```\n\n### アンインストールフックのリトライ\nステータスコード `200` のレスポンスをカラーミーショップが受け取れない場合は、ステータスコード `200` をカラーミーショップが受け取るまで、以下の条件で再度アンインストール情報を送信します。\nなお、カラーミーショップによるアンインストール処理は、アンインストールフックの送信結果の成否によらず、アンインストールが実行されたときに完了します。\n\n- 2時間30分ごとにアンインストールフックの仕様に基づき再送します\n- 最大で合計19回再送します\n- すべての再送の試行でステータスコード `200` をカラーミーショップが受け取れない場合は、公認デベロッパー申請時に登録されたメールアドレス宛にメールを送信します\n\n## インストール・アンインストールフックの署名検証\n`X-Appstore-Signature` リクエストヘッダーに含まれる署名を検証して、リクエストがカラーミーショップから送信されたことを確認することを推奨します。\n\n検証の手順は以下のとおりです。\n\n1. カラーミーショップが発行した `webhook_secret` を秘密鍵として、HMAC-SHA256アルゴリズムを使用してリクエストボディのダイジェスト値を取得します。\n2. ダイジェスト値をBase64エンコードした値とリクエストヘッダーに付与された署名( `X-Appstore-Signature` の値)が一致することを確認します。\n\n\nサンプルコード(ruby)\n```ruby\nWEBHOOK_SECRET = 'my_webhook_secret'\n\npayload_body = request.body.read\nsignature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', WEBHOOK_SECRET, payload_body))\nActiveSupport::SecurityUtils.secure_compare(signature, request.env['HTTP_X_APPSTORE_SIGNATURE'])\n```\n\n### 発信元IPアドレスについて\n\n発信元IPアドレスは固定ではありません。そのためIPアドレスが固定されていることを前提としてアプリケーションを開発しないでください。\n\nインストールフックおよびアンインストールフックのリクエストの発信元を検証する場合は上記の署名検証を行なってください。\n","termsOfService":"https://api.shop-pro.jp/developers/tos","title":"カラーミーショップアプリストア API","version":"1.0.0","x-apisguru-categories":["ecommerce"],"x-description-language":"jp","x-logo":{"url":"https://static-www.shop-pro.jp/img/cms_components/cms_header/cms_header_brand.svg"},"x-origin":[{"format":"swagger","url":"https://api.shop-pro.jp/appstore//v1/open_api.json","version":"2.0"}],"x-providerName":"shop-pro.jp"},"tags":[{"name":"application_charge","x-displayName":"課金"},{"description":"ショップページにスクリプトタグを挿入するAPIです。\n\nスクリプトタグエンドポイントを利用する場合、以下の点にご注意ください。\n- スクリプトを配信するサーバは、適切なCORSヘッダ(e.g. `Access-Control-Allow-Origin`) をレスポンスに付与する必要があります\n- 登録済みスクリプトの内容を変更した場合は、都度更新リクエストにて適切な `integrity` パラメータを送信する必要があります\n- 登録するスクリプトのURLスキームは `https` のみになります\n- 登録・更新時にカラーミーAPIがスクリプトを取得します。スクリプトが取得できない場合は登録できません\n- スクリプトタグAPIで挿入されたスクリプトタグは、アプリがアンインストールされると自動で削除されます\n","name":"script","x-displayName":"スクリプトタグ"},{"description":"スクリプトタグを挿入するAPIです。※新規デベロッパーはこのエンドポイントを利用できません。代わりに [スクリプトタグ](/open_api#tag/script) をご利用ください","name":"script(deprecated)","x-displayName":"スクリプトタグ(deprecated)"},{"description":"インラインスクリプトを挿入するAPIです。※新規デベロッパーはこのエンドポイントを利用できません","name":"inline_script","x-displayName":"インラインスクリプト(deprecated)"},{"description":"アプリをアンインストールするAPIです。","name":"uninstallation","x-displayName":"アンインストール"}],"paths":{"/appstore/v1/application_charges.json":{"post":{"description":"「アプリ内課金」はすでにインストール済みのアプリ上において、利用者が追加の買い切りによる課金によって新たなアプリ内の機能を提供される場合などに、利用者へ買い切りの課金分の請求を行うための課金形式です。\n\nこの課金はプラン課金の情報に紐付かないため、リクエストされたタイミングで課金データが作成されます。また、同一のアプリ内課金IDで同じ利用者へ複数回請求を行うことも可能です。\n\nただし、アプリの基本機能として提供しているサービスを利用した量やその頻度などに伴って毎月異なった額の請求を行うような課金については、プラン課金の「従量による課金」の機能を使って請求を行う必要があります。\n","operationId":"postApplicationCharge","requestBody":{"content":{"application/json":{"schema":{"properties":{"application_charge":{"properties":{"application_charge_source_id":{"description":"アプリ内課金ID","example":"5S1DAG","type":"string"}},"type":"object"}},"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"application_charge":{"additionalProperties":false,"properties":{"id":{"description":"課金ID","example":"T21SUDG","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"point":{"description":"ポイント請求額(税抜)","example":500,"type":"integer"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_application_charge"]}],"summary":"アプリ内課金データの作成","tags":["application_charge"]}},"/appstore/v1/installation.json":{"delete":{"description":"このAPIは OAuth のアクセストークンに紐付くアプリケーションをショップから削除します。\nこのAPIを利用した場合、ショップオーナーがアンインストールした場合と異なり、アンインストールフックは実行されません。\n代わりにアンインストールフックで通知される情報は、このAPIのレスポンスに含まれています。\n\nアンインストール時の注意点については、[アプリのアンインストール](https://app.shop-pro.jp/open_api#section/API/アプリのインストール)を参照して下さい。\n","operationId":"deleteInstallation","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"アンインストールしたショップオーナーのアカウントID","example":"PA00000000","type":"string"},"application_charge_source_id":{"description":"プラン課金ID","example":"5S1DAG","type":"string"},"recurring_application_charge_id":{"description":"(買い切り以外の課金の場合)課金契約ID","example":"F3WQ1S","type":"string"},"uninstalled_at":{"description":"アンインストール日時","example":1569920014,"type":"integer"},"usage_charge":{"description":"(従量課金の場合)従量課金アンインストール情報","properties":{"api_token":{"description":"アンインストール後に従量課金APIを利用いただくために必要な情報","example":"token","type":"string"},"closing_on":{"description":"ポイント締め日","example":1572598664,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"アンインストール成功"}},"security":[{"OAuth2":[]}],"summary":"アプリストアアプリのアンインストール","tags":["uninstallation"]}},"/appstore/v1/recurring_application_charges/{recurringApplicationChargeId}/usage_charges.json":{"post":{"description":"アプリ内で基本機能が利用された頻度に伴って毎月の請求が変動するようなアプリの場合は「従量課金」を使って利用者に変動分の請求を行うことができます。\n※無料お試し期間中のショップに対しては従量課金データを作成できません。\n","operationId":"createUsageCharge","parameters":[{"description":"課金契約ID","in":"path","name":"recurringApplicationChargeId","required":true,"schema":{"type":"string"}},{"description":"アンインストール後の従量課金の精算をする際に、 `Authorization` ヘッダへアクセストークンを指定する代わりにこのヘッダを指定することで、このAPIを実行することができます。\nインストール中は指定不要で、アンインストール後のみ必須となります。\nアンインストールフックで通知される `usage_charge.api_token` の値を指定してください。\nこのヘッダは、アンインストールフックで通知される `usage_charge.closing_on` まで有効です。この期間を過ぎると従量課金を精算できなくなりますのでご注意ください。詳しくは [アプリのアンインストール](#section/API/アプリのアンインストール) をご確認ください。","in":"header","name":"X-Appstore-Usage-Charge-Token","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"usage_charge":{"properties":{"description":{"description":"従量課金の発生理由。使用可能文字は ASCII, JIS X 0208, JIS X 0201, JIS X 0212に限ります。([デベロッパー](https://developer.shop-pro.jp) ページに掲載される各アプリの「従量課金」一覧で登録内容を確認できます。カラーミーショップ側がこのパラメータを参照して課金の内容を確認することがあります。)","example":"2019/4 メール送信分","maxLength":50,"type":"string"},"point":{"description":"ポイント数(税抜)。100 円以上 100 万円以下が指定可能。このポイントに消費税を加算してショップオーナーに請求します。","example":100,"type":"integer"}},"required":["point","description"],"type":"object"}},"type":"object"}}},"description":"従量課金データ","required":true},"responses":{"201":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"usage_charge\": {\n \"id\": \"X20SHDG\",\n \"point\": 10,\n \"description\": \"2019-04-15 メール送信\",\n \"make_date\": 146579000,\n \"update_date\": 1494497000\n }\n}"}},"schema":{"properties":{"usage_charge":{"additionalProperties":false,"properties":{"description":{"description":"従量課金発生理由","example":"2019/4 メール送信分","type":"string"},"id":{"description":"従量課金ID","example":"X20SHDG","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"point":{"description":"ポイント請求額(税抜)","example":100,"type":"integer"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_application_charge"]}],"summary":"従量課金データの作成","tags":["application_charge"]}},"/appstore/v1/script_tags.json":{"get":{"description":"","operationId":"getShopScriptTags","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tags":{"items":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA12345678","type":"string"},"display_scope":{"description":"スクリプトを出力するページ\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n","enum":["shop","thanks_page"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"integrity":{"description":"スクリプトファイルのハッシュ値(script tagのintegrity属性)","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"OAuthアプリケーションID","example":12,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["read_shop_script_tags"]}],"summary":"スクリプトタグの取得","tags":["script"]},"post":{"description":"","operationId":"createShopScriptTag","requestBody":{"$ref":"#/components/requestBodies/createShopScriptTagScriptTag"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA12345678","type":"string"},"display_scope":{"description":"スクリプトを出力するページ\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n","enum":["shop","thanks_page"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"integrity":{"description":"スクリプトファイルのハッシュ値(script tagのintegrity属性)","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"OAuthアプリケーションID","example":12,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_shop_script_tags"]}],"summary":"スクリプトタグの作成","tags":["script"]}},"/appstore/v1/script_tags/{scriptTagId}.json":{"delete":{"description":"","operationId":"deleteScriptTag","parameters":[{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No Content"}},"security":[{"OAuth2":["write_shop_script_tags"]}],"summary":"スクリプトタグの削除","tags":["script"]},"get":{"description":"","operationId":"getShopScriptTag","parameters":[{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA12345678","type":"string"},"display_scope":{"description":"スクリプトを出力するページ\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n","enum":["shop","thanks_page"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"integrity":{"description":"スクリプトファイルのハッシュ値(script tagのintegrity属性)","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"OAuthアプリケーションID","example":12,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["read_shop_script_tags"]}],"summary":"スクリプトタグの取得","tags":["script"]},"put":{"description":"","operationId":"updateShopScriptTag","parameters":[{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}],"requestBody":{"$ref":"#/components/requestBodies/createShopScriptTagScriptTag"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA12345678","type":"string"},"display_scope":{"description":"スクリプトを出力するページ\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n","enum":["shop","thanks_page"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"integrity":{"description":"スクリプトファイルのハッシュ値(script tagのintegrity属性)","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"OAuthアプリケーションID","example":12,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_shop_script_tags"]}],"summary":"スクリプトタグの更新","tags":["script"]}},"/v1/inline_script_tags.json":{"get":{"description":"","operationId":"getInlineScriptTags","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"inline_script_tags":{"items":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA04511366","type":"string"},"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"インラインスクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"アプリID","example":8102,"type":"integer"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["read_inline_script_tags"]}],"summary":"インラインスクリプトタグの取得","tags":["inline_script"]},"post":{"description":"","operationId":"createInlineScriptTag","requestBody":{"content":{"application/json":{"schema":{"properties":{"inline_script_tag":{"properties":{"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"}},"type":"object"}},"type":"object"}}},"description":"作成するインラインスクリプトタグの情報"},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"inline_script_tag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA04511366","type":"string"},"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"インラインスクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"アプリID","example":8102,"type":"integer"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_inline_script_tags"]}],"summary":"インラインスクリプトタグの登録","tags":["inline_script"]}},"/v1/inline_script_tags/{inlineScriptTagId}.json":{"delete":{"description":"","operationId":"deleteInlineScriptTag","parameters":[{"description":"インラインスクリプトタグID","in":"path","name":"inlineScriptTagId","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No Content"}},"security":[{"OAuth2":["write_inline_script_tags"]}],"summary":"インラインスクリプトタグの削除","tags":["inline_script"]},"get":{"description":"","operationId":"getInlineScriptTag","parameters":[{"description":"インラインスクリプトタグID","in":"path","name":"inlineScriptTagId","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"inline_script_tag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA04511366","type":"string"},"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"インラインスクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"アプリID","example":8102,"type":"integer"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["read_inline_script_tags"]}],"summary":"インラインスクリプトタグの取得","tags":["inline_script"]},"put":{"description":"","operationId":"updateInlineScriptTag","parameters":[{"description":"インラインスクリプトタグID","in":"path","name":"inlineScriptTagId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"inline_script_tag":{"properties":{"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"}},"type":"object"}},"type":"object"}}},"description":"更新するスクリプトタグの情報"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"inline_script_tag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA04511366","type":"string"},"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"インラインスクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"アプリID","example":8102,"type":"integer"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_inline_script_tags"]}],"summary":"インラインスクリプトタグの更新","tags":["inline_script"]}},"/v1/script_tags.json":{"get":{"description":"","operationId":"getScriptTags","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tags":{"items":{"additionalProperties":false,"properties":{"display_scope":{"description":"スクリプトを出力するページ。\n\n- `all`: ショップページと注文完了ページの両方\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","shop","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["read_script_tags"]}],"summary":"スクリプトタグの取得","tags":["script(deprecated)"]},"post":{"description":"","operationId":"createScriptTag","requestBody":{"$ref":"#/components/requestBodies/createScriptTagScriptTag"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"additionalProperties":false,"properties":{"display_scope":{"description":"スクリプトを出力するページ。\n\n- `all`: ショップページと注文完了ページの両方\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","shop","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_script_tags"]}],"summary":"スクリプトタグの作成","tags":["script(deprecated)"]}},"/v1/script_tags/{scriptTagId}.json":{"delete":{"description":"","parameters":[{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No Content"}},"security":[{"OAuth2":["write_script_tags"]}],"summary":"スクリプトタグの削除","tags":["script(deprecated)"]},"get":{"description":"","operationId":"getScriptTag","parameters":[{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"additionalProperties":false,"properties":{"display_scope":{"description":"スクリプトを出力するページ。\n\n- `all`: ショップページと注文完了ページの両方\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","shop","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["read_script_tags"]}],"summary":"スクリプトタグの取得","tags":["script(deprecated)"]},"put":{"description":"","operationId":"updateScriptTag","parameters":[{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}],"requestBody":{"$ref":"#/components/requestBodies/createScriptTagScriptTag"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"additionalProperties":false,"properties":{"display_scope":{"description":"スクリプトを出力するページ。\n\n- `all`: ショップページと注文完了ページの両方\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","shop","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"type":"object"}}},"description":""}},"security":[{"OAuth2":["write_script_tags"]}],"summary":"スクリプトタグの更新","tags":["script(deprecated)"]}}},"components":{"parameters":{"inlineScriptTagId":{"description":"インラインスクリプトタグID","in":"path","name":"inlineScriptTagId","required":true,"schema":{"type":"integer"}},"recurringApplicationChargeId":{"description":"課金契約ID","in":"path","name":"recurringApplicationChargeId","required":true,"schema":{"type":"string"}},"scriptTagId":{"description":"スクリプトタグID","in":"path","name":"scriptTagId","required":true,"schema":{"type":"integer"}}},"requestBodies":{"createScriptTagScriptTag":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"properties":{"display_scope":{"description":"スクリプトを出力するページ。\n\n- `all`: ショップページと注文完了ページの両方\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","shop","thanks_page","cart"],"example":"shop","type":"string"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"}},"type":"object"}},"type":"object"}}},"description":"作成するスクリプトタグの情報"},"createShopScriptTagScriptTag":{"content":{"application/json":{"schema":{"properties":{"script_tag":{"properties":{"display_scope":{"description":"スクリプトを出力するページ\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n","enum":["shop","thanks_page"],"example":"shop","type":"string"},"integrity":{"description":"スクリプトのハッシュ値をBase64エンコードした値を設定します。この値はスクリプトタグのIntegrity属性値として利用されます。\n詳しくは [サブリソース完全性 - Web セキュリティ | MDN](https://developer.mozilla.org/ja/docs/Web/Security/Subresource_Integrity) (外部サイト) をご覧ください。\n※この値が正しく設定されない場合はブラウザがスクリプトの読み込みをブロックします。この場合、一般的なWebブラウザ(e.g. Google Chrome, Firefox)の開発者ツールのコンソールでエラーを確認できます。\n","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"}},"type":"object"}},"type":"object"}}},"description":"作成するスクリプトタグの情報"}},"schemas":{"ApplicationCharge":{"additionalProperties":false,"properties":{"id":{"description":"課金ID","example":"T21SUDG","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"point":{"description":"ポイント請求額(税抜)","example":500,"type":"integer"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"CartScriptTag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA12345678","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"integrity":{"description":"スクリプトファイルのハッシュ値(script tagのintegrity属性)","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"OAuthアプリケーションID","example":12,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"InlineScriptTag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA04511366","type":"string"},"display_scope":{"description":"インラインスクリプトを出力するページ。\n\n- `all`: カートの途中のページと注文完了ページの両方\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"インラインスクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"アプリID","example":8102,"type":"integer"},"script":{"description":"インラインスクリプト","example":"console.log(\"aaaaa\")","type":"string"},"trigger_event":{"description":"インラインスクリプトを実行するタイミング。\n\n- `object_builded`: JSオブジェクトの作成が完了した時\n","enum":["object_builded"],"example":"object_builded","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"ScriptTag":{"additionalProperties":false,"properties":{"display_scope":{"description":"スクリプトを出力するページ。\n\n- `all`: ショップページと注文完了ページの両方\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n- `cart`: カートの途中のページ\n","enum":["all","shop","thanks_page","cart"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"ShopScriptTag":{"additionalProperties":false,"properties":{"account_id":{"description":"アカウントID","example":"PA12345678","type":"string"},"display_scope":{"description":"スクリプトを出力するページ\n- `shop`: ショップページ\n- `thanks_page`: 注文完了ページ\n","enum":["shop","thanks_page"],"example":"shop","type":"string"},"id":{"description":"スクリプトタグID","example":1342332,"type":"integer"},"integrity":{"description":"スクリプトファイルのハッシュ値(script tagのintegrity属性)","example":"sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"oauth_application_id":{"description":"OAuthアプリケーションID","example":12,"type":"integer"},"src":{"description":"スクリプトURL","example":"https://example.com/example.js","type":"string"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"},"UsageCharge":{"additionalProperties":false,"properties":{"description":{"description":"従量課金発生理由","example":"2019/4 メール送信分","type":"string"},"id":{"description":"従量課金ID","example":"X20SHDG","type":"string"},"make_date":{"description":"作成日時","example":1465784944,"type":"integer"},"point":{"description":"ポイント請求額(税抜)","example":100,"type":"integer"},"update_date":{"description":"更新日時","example":1494496809,"type":"integer"}},"type":"object"}},"securitySchemes":{"OAuth2":{"flows":{"authorizationCode":{"authorizationUrl":"https://api.shop-pro.jp/oauth/authorize","scopes":{"read_inline_script_tags":"インラインスクリプトタグの取得","read_script_tags":"スクリプトタグの取得(deprecated)","read_shop_script_tags":"ショップページへのスクリプトタグの取得","write_application_charge":"課金データを作成","write_inline_script_tags":"インラインスクリプトタグの登録","write_script_tags":"スクリプトタグの登録(deprecated)","write_shop_script_tags":"ショップページへのスクリプトタグの登録"},"tokenUrl":"https://api.shop-pro.jp/oauth/token"}},"type":"oauth2"}}}}