APIリファレンス業務委託契約

業務委託契約

パートナーとの契約(Tooonの「発注」)

POST/v1/partner-orders

業務委託契約を登録する(externalRef で上書き)

パートナーとの業務委託契約(Tooonの「発注」)を登録します。登録した契約はTooonの画面にも出て、画面から直せます。請求書作成依頼はこの契約に対して作ります。

externalRef を付けると、同じ値で何度呼んでも契約は1件です。2回目からは、本文に含めた項目だけを書き換えます。別のパートナーの契約だったときは 409 partner_mismatch、完了(completed)か取り消し(canceled)の契約なら 409 invalid_status を返します。

通貨はワークスペースの通貨です。案件・受注・予算とのつなぎ込みは画面で行います。

送る項目JSON · 12項目

  • rolestring | null

    担当役割

    200文字まで

  • scopestring | null

    依頼範囲

    4,000文字まで

  • isIncludingTaxboolean

    金額が税込か(既定 false)

  • startDatestring (date) | null

    契約の開始日

  • endDatestring (date) | null

    契約の終了日

  • contractTermsstring | null

    契約条件

    10,000文字まで

  • subcontractingPolicyenum

    再委託(既定 not_set)

    not_setnot_allowedrequires_approvalallowed_without_disclosureallowed_with_vendor_disclosureallowed_with_budget_disclosure
  • statusenum

    既定 draft。completed / canceled にした契約は、その後 API から書き換えられません

    draftactivecompletedcanceled
  • externalRefstring

    呼び出し元システムでの識別子。同じ値なら同じ契約として扱います

    200文字まで

  • partnerIdstring必須

    パートナーのID。POST /v1/partners の応答や GET /v1/partners で確認できます

    100文字まで

  • titlestring必須

    契約名

    200文字まで

  • amountinteger必須

    契約金額(円)

    1〜10,000,000,000

返る項目data の中身 · 200

  • idstring
  • externalRefstring | null
  • partnerIdstring
  • titlestring
  • rolestring | null

    担当役割

  • scopestring | null

    依頼範囲

  • statusenum
    draftactivecompletedcanceled
  • amountinteger

    契約金額(円)

  • currencystring
  • isIncludingTaxboolean
  • startDatestring | null
  • endDatestring | null
  • contractTermsstring | null

    契約条件

  • subcontractingPolicyenum

    再委託

    not_setnot_allowedrequires_approvalallowed_without_disclosureallowed_with_vendor_disclosureallowed_with_budget_disclosure
  • createdAtstring
  • updatedAtstring

起こりうるエラー共通のエラー

  • 400invalid_request

    送った値が正しくない。message にどこが違うかが入ります

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 409partner_mismatch

    別のパートナーの契約だったとき

  • 409invalid_status

    完了(completed)か取り消し(canceled)の契約のとき

POST/v1/partner-orders
curl -X POST https://tooon.app/api/v1/partner-orders \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "externalRef": "staff-0001",
  "partnerId": "clx8k2m0a0001",
  "title": "Webサイト制作の業務委託",
  "amount": 100000
}'
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "externalRef": "staff-0001",
    "partnerId": "clx8k2m0a0001",
    "title": "Webサイト制作の業務委託",
    "role": "…",
    "scope": "…",
    "status": "draft",
    "amount": 100000,
    "currency": "JPY",
    "isIncludingTax": false,
    "startDate": "2026-11-30",
    "endDate": "2026-11-30",
    "contractTerms": "…",
    "subcontractingPolicy": "not_set",
    "createdAt": "2026-11-01T09:00:00.000Z",
    "updatedAt": "2026-11-01T09:00:00.000Z"
  }
}
GET/v1/partner-orders/{id}

業務委託契約を取得する

パスの値

  • idstring必須

    業務委託契約のID

    100文字まで

返る項目data の中身 · 200

  • idstring
  • externalRefstring | null
  • partnerIdstring
  • titlestring
  • rolestring | null

    担当役割

  • scopestring | null

    依頼範囲

  • statusenum
    draftactivecompletedcanceled
  • amountinteger

    契約金額(円)

  • currencystring
  • isIncludingTaxboolean
  • startDatestring | null
  • endDatestring | null
  • contractTermsstring | null

    契約条件

  • subcontractingPolicyenum

    再委託

    not_setnot_allowedrequires_approvalallowed_without_disclosureallowed_with_vendor_disclosureallowed_with_budget_disclosure
  • createdAtstring
  • updatedAtstring

起こりうるエラー共通のエラー

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

GET/v1/partner-orders/{id}
curl https://tooon.app/api/v1/partner-orders/clx8k2m0a0001 \
  -H "Authorization: Bearer $TOOON_API_KEY"
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "externalRef": "staff-0001",
    "partnerId": "clx8k2m0a0001",
    "title": "Webサイト制作の業務委託",
    "role": "…",
    "scope": "…",
    "status": "draft",
    "amount": 100000,
    "currency": "JPY",
    "isIncludingTax": false,
    "startDate": "2026-11-30",
    "endDate": "2026-11-30",
    "contractTerms": "…",
    "subcontractingPolicy": "not_set",
    "createdAt": "2026-11-01T09:00:00.000Z",
    "updatedAt": "2026-11-01T09:00:00.000Z"
  }
}
PATCH/v1/partner-orders/{id}

業務委託契約を更新する

本文に含めた項目だけを書き換えます。null を送るとその項目を空にします。externalRef を付けると、画面で登録した契約を呼び出し元のシステムとつなげられます。完了(completed)か取り消し(canceled)の契約は 409 invalid_status を返します。パートナーは変えられません。契約・請求が紐づいた発注の取消は、この汎用更新では行えません。

パスの値

  • idstring必須

    業務委託契約のID

    100文字まで

送る項目JSON · 11項目

  • rolestring | null

    担当役割

    200文字まで

  • scopestring | null

    依頼範囲

    4,000文字まで

  • isIncludingTaxboolean

    金額が税込か(既定 false)

  • startDatestring (date) | null

    契約の開始日

  • endDatestring (date) | null

    契約の終了日

  • contractTermsstring | null

    契約条件

    10,000文字まで

  • subcontractingPolicyenum

    再委託(既定 not_set)

    not_setnot_allowedrequires_approvalallowed_without_disclosureallowed_with_vendor_disclosureallowed_with_budget_disclosure
  • statusenum

    既定 draft。completed / canceled にした契約は、その後 API から書き換えられません

    draftactivecompletedcanceled
  • externalRefstring | null

    呼び出し元システムでの識別子。null で外します

    200文字まで

  • titlestring

    契約名

    200文字まで

  • amountinteger

    契約金額(円)

    1〜10,000,000,000

返る項目data の中身 · 200

  • idstring
  • externalRefstring | null
  • partnerIdstring
  • titlestring
  • rolestring | null

    担当役割

  • scopestring | null

    依頼範囲

  • statusenum
    draftactivecompletedcanceled
  • amountinteger

    契約金額(円)

  • currencystring
  • isIncludingTaxboolean
  • startDatestring | null
  • endDatestring | null
  • contractTermsstring | null

    契約条件

  • subcontractingPolicyenum

    再委託

    not_setnot_allowedrequires_approvalallowed_without_disclosureallowed_with_vendor_disclosureallowed_with_budget_disclosure
  • createdAtstring
  • updatedAtstring

起こりうるエラー共通のエラー

  • 400invalid_request

    送った値が正しくない。message にどこが違うかが入ります

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

  • 409invalid_status

    完了(completed)か取り消し(canceled)の契約のとき

PATCH/v1/partner-orders/{id}
curl -X PATCH https://tooon.app/api/v1/partner-orders/clx8k2m0a0001 \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "externalRef": "staff-0001"
}'
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "externalRef": "staff-0001",
    "partnerId": "clx8k2m0a0001",
    "title": "Webサイト制作の業務委託",
    "role": "…",
    "scope": "…",
    "status": "draft",
    "amount": 100000,
    "currency": "JPY",
    "isIncludingTax": false,
    "startDate": "2026-11-30",
    "endDate": "2026-11-30",
    "contractTerms": "…",
    "subcontractingPolicy": "not_set",
    "createdAt": "2026-11-01T09:00:00.000Z",
    "updatedAt": "2026-11-01T09:00:00.000Z"
  }
}