{"openapi":"3.1.0","info":{"title":"soysoy API(パートナー用)","description":"自分が担当の取引を扱う API。できることと断られることは画面と同じ。\n\n顧客の申し込みと公開の承認はない。顧客本人が顧客ページで行う。","version":"1"},"servers":[{"url":"https://staging.soysoy.app/api/partner/v1"}],"security":[{"bearer":[]}],"tags":[{"name":"アカウント","description":"トークンの持ち主"},{"name":"取引","description":"取引を作る、読む、動かす"},{"name":"サイト","description":"zip のアップロードと、表示する版の切り替え"},{"name":"ヒアリング","description":"顧客の回答と写真"},{"name":"公開のあと","description":"公開したあとの手作業の記録"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"パートナー用のトークン(hm_partner_…)。アカウントの「AI アシスタントと自動化」で作る"}},"schemas":{"Me":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["partner","admin"],"description":"役割。partner パートナー、admin 管理者"}},"required":["id","name","email","role"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"理由の番号","example":"not-found"},"message":{"type":"string","description":"理由の説明(日本語)"},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"項目ごとの理由のコード(`invalid` のとき)。shopName: required、invalid。slug: required、length、charset、edge-hyphen、double-hyphen、reserved、taken、locked。kind: invalid、locked、closed。意味は details とリファレンスの「入力の誤りの理由」","example":{"slug":"taken"}},"phase":{"type":"string","description":"取引のいまの状態(`wrong-phase` のとき)","example":"live"},"next":{"type":"string","description":"代わりにすること(`wrong-phase` のとき。message の後ろの文と同じ)","example":"解約は顧客が顧客ページから行います。"},"details":{"type":"object","additionalProperties":{"type":"string"},"description":"項目ごとの理由を人が読む 1 文で(`fields` があるとき)","example":{"slug":"この URL の名前はほかのサイトで使われています。ほかの名前にしてください。"}}},"required":["code","message"]}},"required":["error"]},"DealList":{"type":"object","properties":{"deals":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Deal"},{"type":"object","properties":{"staffName":{"type":"string","description":"担当の名前"}},"required":["staffName"]}]}},"total":{"type":"integer","description":"条件に合う取引の数"},"page":{"type":"integer"},"pages":{"type":"integer"}},"required":["deals","total","page","pages"]},"Deal":{"type":"object","properties":{"id":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"refCode":{"type":"string","description":"受付番号。顧客とのやりとりで使う","example":"HM-260924-15"},"shopName":{"type":"string","description":"店舗名","example":"鳥源"},"kind":{"type":"string","enum":["food","beauty","clinic","retail","school","other"],"description":"業種。food 飲食店、beauty 美容室・サロン、clinic 整体院・治療院、retail 物販のお店、school 教室・スクール、other そのほか。ヒアリングの質問と、顧客ページやメールでのお店の呼び方(院、教室)がこれに合わせて変わる","example":"food"},"phase":{"type":"string","enum":["draft","proposed","applied","review","revising","approved","live","ended","canceled"],"description":"取引の状態。draft 下書き、proposed 顧客に提案中、applied 申し込み済み(ヒアリング)、review 顧客の確認待ち、revising 修正の依頼を受けた、approved 公開の承認済みで初回の支払い待ち、live 公開中、ended 解約で終わった、canceled キャンセル"},"planId":{"type":"string","description":"プランの ID"},"priceMonthly":{"type":"integer","description":"月額(円、税込)。作ったときの金額で、いまは 3,300 円","example":3300},"note":{"type":"string","description":"メモ。顧客には見えない"},"staffId":{"type":"string","description":"担当のメンバーの ID"},"reviewVersion":{"type":["integer","null"],"description":"確認依頼を出した版。顧客が公開を承認するのはこの版"},"customerUrl":{"type":["string","null"],"description":"顧客ページの URL。下書きのあいだは null(最初の zip をアップロードすると入る)。顧客に送るのは人の仕事"},"site":{"type":"object","properties":{"slug":{"type":"string","description":"サイトの URL の名前","example":"torigen"},"url":{"type":"string","description":"サイトの URL(独自ドメインがあればそちら)"},"status":{"type":"string","enum":["demo","live","suspended"],"description":"demo ご提案のサイト(検索よけつき)、live 公開中、suspended 非公開"},"activeVersion":{"type":["integer","null"],"description":"いま表示している版"},"customDomain":{"type":["string","null"],"description":"独自ドメイン"}},"required":["slug","url","status","activeVersion","customDomain"]},"views":{"type":"object","properties":{"count":{"type":"integer"},"first":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"last":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"}},"required":["count","first","last"],"description":"顧客ページが開かれた回数と日時"},"followup":{"type":"object","properties":{"indexRequestedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"gbpGuidedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"}},"required":["indexRequestedAt","gbpGuidedAt"],"description":"公開のあとの作業を済にした日時(Search Console、Google ビジネスプロフィール)"},"times":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","description":"日時(ISO 8601、UTC)","example":"2026-09-25T03:04:05.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"日時(ISO 8601、UTC)","example":"2026-09-25T03:04:05.000Z"},"proposedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"appliedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"reviewRequestedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"approvedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"liveAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"canceledAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"endedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"},"erasedAt":{"type":["string","null"],"format":"date-time","description":"日時(ISO 8601、UTC)。まだなら null"}},"required":["createdAt","updatedAt","proposedAt","appliedAt","reviewRequestedAt","approvedAt","liveAt","canceledAt","endedAt","erasedAt"]}},"required":["id","refCode","shopName","kind","phase","planId","priceMonthly","note","staffId","reviewVersion","customerUrl","site","views","followup","times"]},"DealCreate":{"type":"object","properties":{"shopName":{"type":"string","maxLength":60,"description":"店舗名。60 文字まで","example":"鳥源"},"slug":{"type":"string","minLength":3,"maxLength":40,"description":"サイトの URL の名前(https://<slug>.<配信ドメイン>)。半角の英小文字・数字・ハイフンで 3〜40 文字(大文字は小文字にする)。公開の承認までは変えられる(顧客がヒアリングで変えることもある)","example":"torigen"},"kind":{"type":"string","default":"other","enum":["food","beauty","clinic","retail","school","other"],"example":"food","description":"業種。food 飲食店、beauty 美容室・サロン、clinic 整体院・治療院、retail 物販のお店、school 教室・スクール、other そのほか。ヒアリングの質問と、顧客ページやメールでのお店の呼び方(院、教室)がこれに合わせて変わる。省くと other"},"note":{"type":"string","maxLength":1000,"description":"メモ。顧客には見えない。1,000 文字まで"}},"required":["shopName","slug"]},"DealDetail":{"allOf":[{"$ref":"#/components/schemas/Deal"},{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/Version"},"description":"アップロードした版。新しい順"},"customer":{"type":["object","null"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"cardRegistered":{"type":"boolean","description":"顧客がカードを登録したか"},"card":{"type":["object","null"],"properties":{"brand":{"type":["string","null"]},"last4":{"type":"string"}},"required":["brand","last4"],"description":"登録したカード。管理用の接続先だけが返す"}},"required":["name","email","phone","cardRegistered"],"description":"顧客の連絡先。申し込みの前は null"},"log":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"actor":{"type":"string"},"at":{"type":"string","format":"date-time","description":"日時(ISO 8601、UTC)","example":"2026-09-25T03:04:05.000Z"}},"required":["type","actor","at"]},"description":"取引の記録。新しい 50 件"}},"required":["versions","customer","log"]}]},"Version":{"type":"object","properties":{"version":{"type":"integer","description":"版の番号(v1 なら 1)"},"status":{"type":"string","enum":["uploading","ready","failed"],"description":"uploading 処理中、ready 使える、failed 失敗"},"fileCount":{"type":"integer"},"totalBytes":{"type":"integer"},"skipped":{"type":"array","items":{"type":"string"},"description":"読み飛ばしたファイル(__MACOSX、Thumbs.db、. で始まるもの)"},"createdAt":{"type":"string","format":"date-time","description":"日時(ISO 8601、UTC)","example":"2026-09-25T03:04:05.000Z"},"previewUrl":{"type":["string","null"],"description":"この版のプレビューの URL(ready のときだけ)"}},"required":["version","status","fileCount","totalBytes","skipped","createdAt","previewUrl"]},"DealUpdate":{"type":"object","properties":{"shopName":{"type":"string","maxLength":60,"description":"店舗名。60 文字まで","example":"鳥源"},"slug":{"type":"string","minLength":3,"maxLength":40,"description":"サイトの URL の名前(https://<slug>.<配信ドメイン>)。半角の英小文字・数字・ハイフンで 3〜40 文字(大文字は小文字にする)。公開の承認までは変えられる(顧客がヒアリングで変えることもある)","example":"torigen"},"kind":{"type":"string","enum":["food","beauty","clinic","retail","school","other"],"example":"food","description":"業種。food 飲食店、beauty 美容室・サロン、clinic 整体院・治療院、retail 物販のお店、school 教室・スクール、other そのほか。ヒアリングの質問と、顧客ページやメールでのお店の呼び方(院、教室)がこれに合わせて変わる。顧客がヒアリングに回答したあとは変えられない(fields.kind が locked)"},"note":{"type":"string","maxLength":1000,"description":"メモ。顧客には見えない。1,000 文字まで"}}},"Uploaded":{"type":"object","properties":{"version":{"type":"integer","description":"新しい版の番号"},"fileCount":{"type":"integer"},"skipped":{"type":"array","items":{"type":"string"},"description":"読み飛ばしたファイル"},"shown":{"type":"boolean","description":"この版が表示する版になったか。下書きの取引の最初の版は true で、顧客ページもできる"},"customerUrl":{"type":["string","null"],"description":"顧客ページの URL(取引の customerUrl と同じ)"}},"required":["version","fileCount","skipped","shown","customerUrl"]},"Activate":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"description":"表示する版の番号(v1 なら 1)","example":2}},"required":["version"]},"Hearing":{"type":"object","properties":{"responses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"日時(ISO 8601、UTC)","example":"2026-09-25T03:04:05.000Z"},"round":{"type":"integer","description":"0 はヒアリングの回答。1 から先は修正の依頼の通し番号","example":1},"counted":{"type":"boolean","description":"修正の依頼が顧客の回数(公開の前に 2 回)に数えられているか。uncountRevision で false にできる。ヒアリングの回答は false"},"formVersion":{"type":"string","description":"設問の版。ヒアリングは末尾が業種","example":"2026-09-25.1-food"},"answers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"section":{"type":"string"},"label":{"type":"string","description":"設問"},"value":{"type":"array","items":{"type":"string"},"description":"回答(選んだ選択肢の名前、入力した文)。写真のほかの設問"}},"required":["id","section","label","value"]},{"type":"object","properties":{"id":{"type":"string"},"section":{"type":"string"},"label":{"type":"string"},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"顧客の端末でのファイル名"},"contentType":{"type":"string"},"size":{"type":"integer","description":"バイト数"},"url":{"type":"string","description":"写真そのものの URL(同じトークンで GET する)"}},"required":["id","name","contentType","size","url"]},"description":"送った写真。写真の設問"}},"required":["id","section","label","photos"]}]}}},"required":["id","createdAt","round","counted","formVersion","answers"]}}},"required":["responses"]}},"parameters":{}},"paths":{"/me":{"get":{"operationId":"getMe","tags":["アカウント"],"summary":"トークンの持ち主","description":"このトークンの持ち主のメンバーを返す。","responses":{"200":{"description":"トークンの持ち主","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals":{"get":{"operationId":"listDeals","tags":["取引"],"summary":"取引の一覧","description":"自分が担当の取引を更新の新しい順に 50 件ずつ返す。","parameters":[{"schema":{"type":"string","enum":["draft","proposed","applied","review","revising","approved","live","ended","canceled"],"description":"状態で絞り込む"},"required":false,"description":"状態で絞り込む","name":"phase","in":"query"},{"schema":{"type":"string","description":"店舗名、受付番号(HM- はなくてもよい)、顧客の電話番号(数字だけで比べる)、メールアドレス、URL の名前、独自ドメインの一部で絞り込む","example":"鳥源"},"required":false,"description":"店舗名、受付番号(HM- はなくてもよい)、顧客の電話番号(数字だけで比べる)、メールアドレス、URL の名前、独自ドメインの一部で絞り込む","name":"q","in":"query"},{"schema":{"type":"integer","description":"ページ。50 件ずつ","minimum":1,"default":1},"required":false,"description":"ページ。50 件ずつ","name":"page","in":"query"}],"responses":{"200":{"description":"取引の一覧","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealList"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createDeal","tags":["取引"],"summary":"取引の作成","description":"取引を下書きで作る。顧客には何も届かない。料金は指定できない(月額 3,300 円、税込)。業種(kind)はヒアリングの回答が届くまで変えられる。","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealCreate"}}}},"responses":{"201":{"description":"作った取引","headers":{"Location":{"schema":{"type":"string","description":"作った取引の API の URL(パス)"},"required":true,"description":"作った取引の API の URL(パス)"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"`bad-request` リクエストの形が正しくありません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`invalid` 入力を確認してください(fields を見てください)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}":{"get":{"operationId":"getDeal","tags":["取引"],"summary":"取引の詳細","description":"取引と、アップロードした版(プレビューの URL つき)、顧客の連絡先、取引の記録を返す。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"取引の詳細","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealDetail"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateDeal","tags":["取引"],"summary":"取引の変更","description":"送った項目だけを変える。slug は公開の承認のあとは変えられない(fields.slug が locked)。slug を変えると、ご提案のサイトのアドレスもすぐに変わり、前のアドレスでは開けなくなる。kind は顧客がヒアリングに回答したあとは変えられない(fields.kind が locked)。顧客には何も届かない。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealUpdate"}}}},"responses":{"200":{"description":"変えたあとの取引","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"`bad-request` リクエストの形が正しくありません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`invalid` 入力を確認してください(fields を見てください)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/versions":{"post":{"operationId":"uploadVersion","tags":["サイト"],"summary":"zip のアップロード","description":"サイトの zip を新しい版としてアップロードする。本文は zip そのもの。いちばん上に index.html が要る。ファイル名に使えるのは半角の英数字と . _ - ( ) + @ と空白だけ。zip は 30MB、500 ファイル、1 ファイル 15MB、展開後の合計 100MB まで。下書きの取引では、この版がそのまま表示する版になり、顧客ページができる(shown が true、customerUrl が入る。issue は要らない)。顧客にメールは届かない。そのほかの取引では表示は変わらない(activate で切り替える)。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"},{"schema":{"type":"string","default":"site.zip","description":"版の一覧に出すファイル名。200 文字まで","example":"site.zip"},"required":false,"description":"版の一覧に出すファイル名。200 文字まで","name":"name","in":"query"}],"requestBody":{"required":true,"content":{"application/zip":{"schema":{"type":"string","contentMediaType":"application/zip"}}}},"responses":{"201":{"description":"新しい版","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Uploaded"}}}},"400":{"description":"`bad-request` リクエストの形が正しくありません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`too-large` zip の上限(30MB)を超えています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`zip` zip を受け付けられません。理由は message にあります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/activate":{"post":{"operationId":"activateVersion","tags":["サイト"],"summary":"表示する版の切り替え","description":"アップロードした版をサイトの URL で見える版にする。すぐに切り替わる。公開前はご提案のサイトが、公開中は公開中のサイトが変わる。顧客にメールは届かない(確認を頼むのは request-review)。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activate"}}}},"responses":{"200":{"description":"表示している版","content":{"application/json":{"schema":{"type":"object","properties":{"activeVersion":{"type":"integer"}},"required":["activeVersion"]}}}},"400":{"description":"`bad-request` リクエストの形が正しくありません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`bad-version` この版は表示できません(アップロードが済んだ版を指定してください)\n`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/issue":{"post":{"operationId":"issueLink","tags":["取引"],"summary":"リンクの発行(ふつうは不要)","description":"ふつうは要らない: 下書きの取引は、最初の zip のアップロードで顧客ページができる。顧客ページがすでにある取引(proposed)には、何もせずにその取引を返す。表示する版があって顧客ページがまだない下書き(2026-09-24 より前に作ったもの)には、顧客ページを発行する。customerUrl を顧客に送るのは呼ぶ側の仕事で、この API は送らない。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"顧客ページのある取引(customerUrl が入る)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`no-active-version` 先に表示する版を選んでください(activate)\n`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/request-review":{"post":{"operationId":"requestReview","tags":["取引"],"summary":"確認依頼","description":"いま表示している版の確認を顧客に頼む。顧客に「ホームページが完成しました」のメールが届く。この版が、顧客が公開を承認する版になる。修正の依頼のあとは、直した版をアップロードして表示を切り替えてから呼ぶ。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"確認を頼んだ版","content":{"application/json":{"schema":{"type":"object","properties":{"reviewVersion":{"type":"integer"}},"required":["reviewVersion"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`no-active-version` 先に表示する版を選んでください(activate)\n`wrong-phase` いまの状態ではこの操作はできません\n`unchanged` 修正の依頼のあとは、直した版をアップロードして表示する版に切り替えてから確認依頼を出してください","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/cancel":{"post":{"operationId":"cancelDeal","tags":["取引"],"summary":"キャンセル","description":"公開前の取引をキャンセルする。取り消せない。サイトは見られなくなり、slug はほかの取引で使えるようになる。申し込み済みの顧客には、キャンセルのお知らせのメールが届く。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"キャンセルした","content":{"application/json":{"schema":{"type":"object","properties":{"phase":{"type":"string","enum":["canceled"]}},"required":["phase"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/rotate-token":{"post":{"operationId":"rotateToken","tags":["取引"],"summary":"リンクの再発行","description":"顧客ページの URL を作り直す。古い URL はすぐに使えなくなる。キャンセルや解約で終わった取引はできない。顧客が申し込みで確認済みのメールアドレスがあれば、新しい URL をそこへメールで送る(`mailed`)。なければ新しい URL を顧客に送るのは呼ぶ側の仕事。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"新しい顧客ページの URL","content":{"application/json":{"schema":{"type":"object","properties":{"customerUrl":{"type":"string"},"mailed":{"type":"boolean","description":"新しい URL を顧客の確認済みのメールアドレスに送った"}},"required":["customerUrl","mailed"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/suspend":{"post":{"tags":["取引"],"operationId":"suspendSite","summary":"非公開にする","description":"ご提案のサイトをすぐに見られなくする。顧客が公開を承認したあとのサイトは運営だけが止められる(403 suspend-denied)。顧客にメールは届かない。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"非公開かどうか","content":{"application/json":{"schema":{"type":"object","properties":{"suspended":{"type":"boolean"}},"required":["suspended"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`suspend-denied` 顧客が公開を承認したサイトは運営だけが非公開にできます。止めたいときは運営にご連絡ください","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`resume-denied` このサイトは運営だけが公開に戻せます","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/resume":{"post":{"tags":["取引"],"operationId":"resumeSite","summary":"非公開をやめる","description":"自分が非公開にしたサイトを戻す。運営が止めたサイトと、キャンセルと解約で止まったサイトは戻せない(resume-denied)。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"非公開かどうか","content":{"application/json":{"schema":{"type":"object","properties":{"suspended":{"type":"boolean"}},"required":["suspended"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`suspend-denied` 顧客が公開を承認したサイトは運営だけが非公開にできます。止めたいときは運営にご連絡ください","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`resume-denied` このサイトは運営だけが公開に戻せます","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/followup/gbp":{"post":{"tags":["公開のあと"],"operationId":"markFollowupGbp","summary":"公開のあとの作業: Google ビジネスプロフィール","description":"顧客に Google ビジネスプロフィールの「ウェブサイト」に URL を入れてもらったことを記録する(済にする)。公開中の取引だけ。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"済にした作業","content":{"application/json":{"schema":{"type":"object","properties":{"done":{"type":"string","enum":["gbp"]}},"required":["done"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/recontract":{"post":{"operationId":"recontract","tags":["取引"],"summary":"再契約","description":"解約で終わった取引から、同じ URL の新しい取引を下書きで作る(1 回だけ)。前のサイトの最後の版を v1 に写す。siteCopy が copied でなければ zip をアップロードする。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"201":{"description":"新しい取引","headers":{"Location":{"schema":{"type":"string","description":"作った取引の API の URL(パス)"},"required":true,"description":"作った取引の API の URL(パス)"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"新しい取引の ID"},"siteCopy":{"type":"string","enum":["copied","nothing","failed"],"description":"前のサイトの版を写せたか。copied 写した、nothing 写せる版がない、failed 失敗"}},"required":["id","siteCopy"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`wrong-phase` いまの状態ではこの操作はできません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/hearing":{"get":{"operationId":"getHearing","tags":["ヒアリング"],"summary":"ヒアリングの回答","description":"顧客の回答を新しい順に返す(修正の依頼も含む)。設問は回答したときの形で、取引の業種の言葉になっている。写真は URL つきで、中身は files で取り出す。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"}],"responses":{"200":{"description":"回答","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hearing"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/revisions/{responseId}/uncount":{"post":{"operationId":"uncountRevision","tags":["ヒアリング"],"summary":"修正の依頼を回数に数えない","description":"ヒアリングの回答どおりになっていなかったなど、担当のまちがいを直す修正の依頼を、顧客の回数に数えないことにする。顧客ページの残りの回数が 1 回戻る。1 つの依頼に 1 回だけで、元に戻せない。顧客が公開を承認する前(review、revising)だけ。取引のログに残る。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"},{"schema":{"type":"string","description":"修正の依頼の ID(getHearing の responses[].id。round が 1 以上のもの)","example":"hr_2mZ9xT4vB8nR3pW6sK7q"},"required":true,"description":"修正の依頼の ID(getHearing の responses[].id。round が 1 以上のもの)","name":"responseId","in":"path"}],"responses":{"200":{"description":"回数に数えないことにした依頼の通し番号","content":{"application/json":{"schema":{"type":"object","properties":{"round":{"type":"integer"}},"required":["round"]}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`wrong-phase` いまの状態ではこの操作はできません\n`already-uncounted` この修正の依頼はもう回数に数えないことにしています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/files/{fileId}":{"get":{"operationId":"getHearingFile","tags":["ヒアリング"],"summary":"ヒアリングの写真","description":"顧客が送った写真そのもの。Content-Type は写真の形式(image/jpeg、image/png、image/gif、image/webp、image/heic)。","parameters":[{"schema":{"type":"string","description":"取引の ID","example":"dl_7Kq2mZ9xT4vB8nR3pW6s"},"required":true,"description":"取引の ID","name":"id","in":"path"},{"schema":{"type":"string","description":"写真の ID(ヒアリングの回答の photos[].id)","example":"hf_2mZ9xT4vB8nR3pW6sK7q"},"required":true,"description":"写真の ID(ヒアリングの回答の photos[].id)","name":"fileId","in":"path"}],"responses":{"200":{"description":"写真","content":{"image/*":{"schema":{"type":"string","contentMediaType":"image/*"}}}},"401":{"description":"`unauthorized` トークンが使えません。ない、この API 用ではない、期限切れ、取り消し済みのどれかです","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not-found` 見つかりません(ほかの人の取引にも同じように返します)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}