API リファレンス
REST API v1 のエンドポイントの一覧です。リソースごとに、メソッド・パス・必要なスコープ・組織の管理者に限るかをまとめ、詳しい仕様を書いたページへリンクしています。
ベース URL は https://api.sokumitsu.com です。リクエストと応答の形、ページ送り、エラー、回数制限は 共通の仕様 を参照してください。
表の見かた
| 列 | 意味 |
|---|---|
| スコープ | 資格情報に必要なスコープ(認証)。read の欄は、read・write・data:write のどれか 1 つを持っていれば呼べます |
pii | 「要」なら、pii スコープも必要です。無いと 403 です。それ以外の参照は、pii が無ければ個人情報を null にして返します |
| 管理者 | 「要」なら、組織の管理者に限る操作です。組織の API キーは通ります。OAuth のアクセストークンでは、同意した利用者がいま組織の管理者でなければ 403 です |
| 成功 | 成功したときの HTTP ステータス |
writeスコープは、OAuth では組織の管理者にしか付きません。writeの要るエンドポイントは、OAuth では実質的に管理者だけが呼べます- 顧客・案件・見積・帳票・商品・商品マスタ・組織・同期ジョブのエンドポイントは、組織の契約が有効でなければ
402です。GET /api/v1/whoamiは契約の状態にかかわらず答えます(共通の仕様) - パスの
{...}は ID です(ID の形)
資格情報の確認
詳細: 認証
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/whoami | なし(有効な資格情報) | — | — | 200 | 資格情報の組織・スコープ・種類。契約の状態にかかわらず答えます |
顧客
詳細: 顧客
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/customers | read | — | — | 200 | 顧客の検索と一覧 |
GET | /api/v1/customers/{customerId} | read | — | — | 200 | 顧客の詳細と、最近の見積。応答ヘッダーに ETag |
POST | /api/v1/customers | data:write | 要 | — | 201 | 顧客を登録する。Idempotency-Key を使えます |
PATCH | /api/v1/customers/{customerId} | data:write | 要 | — | 200 | 顧客を部分更新する。If-Match(ETag か updatedAt)を使えます |
案件
詳細: 案件
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/deals | read | — | — | 200 | 案件の検索と一覧 |
GET | /api/v1/deals/{dealId} | read | — | — | 200 | 案件の詳細と、紐づく見積。応答ヘッダーに ETag |
GET | /api/v1/deals/{dealId}/documents | read | — | — | 200 | 案件と、その案件の見積で出力した帳票の履歴 |
POST | /api/v1/deals | data:write | — | — | 201 | 案件を登録する。Idempotency-Key を使えます |
PATCH | /api/v1/deals/{dealId} | data:write | — | — | 200 | 案件を部分更新する。If-Match(ETag か updatedAt)を使えます |
見積
詳細: 見積
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/quotes | read | — | — | 200 | 見積の検索と一覧 |
GET | /api/v1/quotes/{quoteId} | read | — | — | 200 | 見積の詳細(明細・合計・税率別の内訳・前受金・変更見積)。応答ヘッダーに ETag |
GET | /api/v1/quotes/{quoteId}/documents | read | — | — | 200 | 見積から出力した帳票の履歴 |
POST | /api/v1/quotes | data:write | 要 | — | 201 | 見積を下書きで作る。Idempotency-Key を使えます |
PATCH | /api/v1/quotes/{quoteId} | data:write | 要 | — | 200 | 下書きの見積を部分更新する。確定済みは 409。If-Match(ETag か updatedAt)を使えます |
POST | /api/v1/quotes/{quoteId}/duplicate | data:write | 要 | — | 201 | 見積を複製して新しい下書きを作る。Idempotency-Key を使えます |
POST | /api/v1/quotes/{quoteId}/deal | data:write | — | — | 200 | 見積を案件に紐づける・見積から案件を作る・紐づけを外す。案件を作るときは Idempotency-Key を使えます |
見積の確定と、顧客・案件・見積の削除は API ではできません。
帳票
詳細: 見積
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/documents/{documentId}/content | read | 要 | — | 200 | 保管してある帳票の PDF(application/pdf) |
GET | /api/v1/report-templates | read | — | — | 200 | 帳票テンプレートの一覧 |
GET | /api/v1/report-templates/{templateId} | read | — | — | 200 | 帳票テンプレートの定義(公開中と下書き) |
GET | /api/v1/report-fields | read | — | — | 200 | 帳票に差し込める項目の一覧 |
帳票の出力履歴は、見積(GET /api/v1/quotes/{quoteId}/documents)と案件(GET /api/v1/deals/{dealId}/documents)から取ります。
商品
詳細: 商品
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/products | read | — | — | 200 | 商品の一覧(価格タイプごとの価格・カテゴリ・税率) |
GET | /api/v1/products/{productId} | read | — | — | 200 | 商品の詳細。無効な商品も返します |
POST | /api/v1/products | write | — | — | 201 | 商品を作る |
PATCH | /api/v1/products/{productId} | write | — | — | 200 | 商品を部分更新する |
PATCH | /api/v1/products | write | — | — | 200 | 商品をまとめて更新する(200 件まで。要素ごとの部分成功) |
DELETE | /api/v1/products/{productId} | write | — | — | 200 | 商品を削除する。見積やオプションで使われていれば 400 |
GET | /api/v1/products/{productId}/option-overrides | read | — | — | 200 | 商品ごとのオプションの上書き(PUT の本文と同じ形) |
PUT | /api/v1/products/{productId}/option-overrides | write | — | — | 200 | 商品ごとのオプションの上書きを、送った一覧のとおりにそろえる。省いた側はいまのまま |
商品マスタ
詳細: 商品マスタ
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/tax-rates | read | — | — | 200 | この組織で選べる税率(組織が許していれば旧税率も) |
GET | /api/v1/quote-types | read | — | — | 200 | 見積タイプと、各タイプで使う商品カテゴリ |
POST | /api/v1/quote-types | write | — | — | 201 | 見積タイプを作る |
PATCH | /api/v1/quote-types/{quoteTypeId} | write | — | — | 200 | 見積タイプを部分更新する |
DELETE | /api/v1/quote-types/{quoteTypeId} | write | — | — | 200 | 見積タイプを削除する。使用中なら 400 |
PUT | /api/v1/quote-types/{quoteTypeId}/categories | write | — | — | 200 | 見積タイプで使う商品カテゴリを、送った一覧のとおりにそろえる |
GET | /api/v1/price-types | read | — | — | 200 | 価格タイプ |
POST | /api/v1/price-types | write | — | — | 201 | 価格タイプを作る |
PATCH | /api/v1/price-types/{priceTypeId} | write | — | — | 200 | 価格タイプを部分更新する |
DELETE | /api/v1/price-types/{priceTypeId} | write | — | — | 200 | 価格タイプを削除する。使用中なら 400 |
GET | /api/v1/product-categories | read | — | — | 200 | 商品カテゴリ |
POST | /api/v1/product-categories | write | — | — | 201 | 商品カテゴリを作る |
PATCH | /api/v1/product-categories/{categoryId} | write | — | — | 200 | 商品カテゴリを部分更新する |
DELETE | /api/v1/product-categories/{categoryId} | write | — | — | 200 | 商品カテゴリを削除する。使用中なら 400 |
PUT | /api/v1/product-categories/{categoryId}/product-order | write | — | — | 200 | カテゴリ内の商品の並び順を変える(送った商品だけ) |
GET | /api/v1/options | read | — | — | 200 | オプションと選択肢の一覧 |
GET | /api/v1/options/{optionId} | read | — | — | 200 | オプションの詳細(選択肢・所属するセット・商品ごとの上書き) |
POST | /api/v1/options | write | — | — | 201 | オプションを作る |
PATCH | /api/v1/options/{optionId} | write | — | — | 200 | オプションを部分更新する |
DELETE | /api/v1/options/{optionId} | write | — | — | 200 | オプションを削除する。使用中なら 400 |
GET | /api/v1/option-sets | read | — | — | 200 | オプションセットの一覧 |
POST | /api/v1/option-sets | write | — | — | 201 | オプションセットを作る |
PATCH | /api/v1/option-sets/{optionSetId} | write | — | — | 200 | オプションセットを部分更新する |
DELETE | /api/v1/option-sets/{optionSetId} | write | — | — | 200 | オプションセットを削除する。使っている商品があれば 400 |
組織
詳細: 組織
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/organization | read | — | — | 200 | 組織の表示情報と、見積の既定値 |
GET | /api/v1/members | read | — | — | 200 | 組織のメンバー。メールアドレスは pii があるときだけ |
GET | /api/v1/custom-fields | read | — | — | 200 | カスタム項目の定義。管理者だけに見せる項目は、管理者でない利用者の OAuth には返しません |
GET | /api/v1/search | read | — | — | 200 | 顧客・見積・案件の横断検索 |
GET | /api/v1/analytics | read | — | — | 200 | 分析ダッシュボードの数値。プランの対象外なら 403 |
GET | /api/v1/audit-logs | read | — | 要 | 200 | 監査ログ。プランの対象外なら 403。変更内容と対象の名前は pii があるときだけ |
Salesforce 連携
接続(/api/v1/connections/...)のエンドポイントは、OAuth では組織の管理者だけが呼べます。接続先に問い合わせる操作(objects・fields・suggest・test/...)と events は、有効な接続でなければ 409 です。接続の一覧・詳細と、送信先・項目の対応の読み書きは、失効した接続でもできます。
| メソッド | パス | スコープ | pii | 管理者 | 成功 | 内容 |
|---|---|---|---|---|---|---|
GET | /api/v1/connections | read | — | 要 | 200 | 接続の一覧(失効したものも含む) |
GET | /api/v1/connections/{connectionId} | read | — | 要 | 200 | 接続の詳細 |
GET | /api/v1/connections/{connectionId}/targets/{entityType} | read | — | 要 | 200 | 送信先と項目の対応 |
PUT | /api/v1/connections/{connectionId}/targets/{entityType} | write | — | 要 | 200 | 送信先と項目の対応を保存する(送った内容で置き換え) |
DELETE | /api/v1/connections/{connectionId}/targets/{entityType} | write | — | 要 | 200 | 送信先の設定を消して既定に戻す |
POST | /api/v1/connections/{connectionId}/targets/{entityType}/suggest | write | — | 要 | 200 | 項目の対応を AI に提案させる(保存しない。AI の利用枠を使う) |
POST | /api/v1/connections/{connectionId}/targets/{entityType}/test/preview | read | — | 要 | 200 | テスト送信で送る内容を組み立てて返す(Salesforce には送らない) |
POST | /api/v1/connections/{connectionId}/targets/{entityType}/test/send | write | — | 要 | 200 | 実データ 1 件を実際に送る |
POST | /api/v1/connections/{connectionId}/targets/{entityType}/test/cleanup | write | — | 要 | 200 | テスト送信で作ったレコードを消し、紐づけを外す |
POST | /api/v1/connections/{connectionId}/targets/{entityType}/test/explain | write | — | 要 | 200 | テスト送信のエラーを AI に解説させる(AI の利用枠を使う) |
GET | /api/v1/connections/{connectionId}/objects | read | — | 要 | 200 | 接続先のオブジェクトの一覧 |
GET | /api/v1/connections/{connectionId}/objects/{objectName}/fields | read | — | 要 | 200 | 接続先のオブジェクトの項目の一覧 |
POST | /api/v1/connections/{connectionId}/events | write | — | 要 | 200 | Salesforce 側の更新をソクミツに反映する(逆方向の通知) |
GET | /api/v1/connections/{connectionId}/contact-field-mappings | read | — | 要 | 200 | 非推奨。 取引先責任者と顧客の項目の対応。targets/customer を使ってください |
PUT | /api/v1/connections/{connectionId}/contact-field-mappings | write | — | 要 | 200 | 非推奨。 同上を保存する |
POST | /api/v1/connections/{connectionId}/contact-field-mappings/suggest | write | — | 要 | 200 | 非推奨。 同上を AI に提案させる |
GET | /api/v1/sync-jobs | read | — | 要 | 200 | Salesforce との同期ジョブの一覧 |
POST | /api/v1/sync-jobs/{jobId}/retry | write | — | 要 | 200 | 失敗した送信の同期ジョブを送り直す |