/v1/clients/{id}/saved-cards取引先が保存したカードの一覧
取引先が同意して保存したカードを、新しい順に返します。カード番号は返さず、ブランド・末尾4桁・期限・同意した文言だけです。
パスの値
- idstring必須
100文字まで
返る項目data の中身 · 200
- idstring
- clientIdstring
- brandstring | null
- last4string | null
- expMonthinteger | null
- expYearinteger | null
- statusenum
activerevoked - testModeboolean
テストモードで保存したカード
- consentTextstring
取引先が同意した文言
- consentedAtstring (date-time)
- revokedAtstring (date-time) | null
起こりうるエラー共通のエラー
- 403insufficient_scope
キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります
- 404not_found
対象がない、またはこのワークスペースのものではない
/v1/…/{id}/saved-cardscurl https://tooon.app/api/v1/clients/clx8k2m0a0001/saved-cards \
-H "Authorization: Bearer $TOOON_API_KEY"{
"data": [
{
"id": "clx8k2m0a0001",
"clientId": "clx8k2m0a0001",
"brand": "…",
"last4": "…",
"expMonth": 0,
"expYear": 0,
"status": "active",
"testMode": true,
"consentText": "…",
"consentedAt": "2026-11-01T09:00:00.000Z",
"revokedAt": "2026-11-01T09:00:00.000Z"
}
]
}/v1/saved-cards/{id}/revoke保存したカードを解除する
取引先から解除を頼まれたときなどに、理由つきで解除します。Stripe からも外し、次から請求に使えません。
パスの値
- idstring必須
100文字まで
送る項目JSON · 1項目
- reasonstring必須
300文字まで
返る項目data の中身 · 200
- idstring
- clientIdstring
- brandstring | null
- last4string | null
- expMonthinteger | null
- expYearinteger | null
- statusenum
activerevoked - testModeboolean
テストモードで保存したカード
- consentTextstring
取引先が同意した文言
- consentedAtstring (date-time)
- revokedAtstring (date-time) | null
起こりうるエラー共通のエラー
- 400invalid_request
送った値が正しくない。message にどこが違うかが入ります
- 403insufficient_scope
キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります
- 404not_found
対象がない、またはこのワークスペースのものではない
/v1/…/{id}/revokecurl -X POST https://tooon.app/api/v1/saved-cards/clx8k2m0a0001/revoke \
-H "Authorization: Bearer $TOOON_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"reason": "…"
}'{
"data": {
"id": "clx8k2m0a0001",
"clientId": "clx8k2m0a0001",
"brand": "…",
"last4": "…",
"expMonth": 0,
"expYear": 0,
"status": "active",
"testMode": true,
"consentText": "…",
"consentedAt": "2026-11-01T09:00:00.000Z",
"revokedAt": "2026-11-01T09:00:00.000Z"
}
}/v1/invoices/{id}/card-charges保存したカードで請求書を払ってもらう
請求書の取引先が保存したカードで、請求額を払ってもらいます(画面のカード決済と同じ金額・手数料)。入金済みになるのは決済が確定したときで、invoice.paid の Webhook で届きます。カード会社の本人確認が要るときは requires_customer_action を返すので、取引先に支払いページを案内してください。同じ Idempotency-Key の再送は同じ結果を返します。いまはテストモードだけです。
パスの値
- idstring必須
100文字まで
送る項目JSON · 1項目
- savedCardIdstring必須
100文字まで
返る項目data の中身 · 200
- idstring
請求書のID
- paymentIntentIdstring
- resultenum
succeededprocessingrequires_customer_actionfailed - failureCodestring | null
- failureMessagestring | null
起こりうるエラー共通のエラー
- 400invalid_request
送った値が正しくない。message にどこが違うかが入ります
- 403insufficient_scope
キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります
- 404not_found
対象がない、またはこのワークスペースのものではない
/v1/…/{id}/card-chargescurl -X POST https://tooon.app/api/v1/invoices/clx8k2m0a0001/card-charges \
-H "Authorization: Bearer $TOOON_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"savedCardId": "clx8k2m0a0001"
}'{
"data": {
"id": "clx8k2m0a0001",
"paymentIntentId": "clx8k2m0a0001",
"result": "succeeded",
"failureCode": "…",
"failureMessage": "…"
}
}/v1/clients/{id}/saved-cards/setup-links取引先にカードを保存してもらうリンクを作る
Stripe の画面へのリンク(24時間有効)を返します。取引先が同意の文言を見てカードを保存すると、保存したカードの一覧に入ります。リンクを取引先に届けるのは呼び出した側です。いまはテストモードだけで、本番では 409 saved_card_charges_unavailable を返します。
パスの値
- idstring必須
100文字まで
送る項目JSON · 1項目
- returnUrlstring
保存した後・やめた後に戻る先
返る項目data の中身 · 201
- urlstring
- expiresAtstring (date-time)
- consentTextstring
起こりうるエラー共通のエラー
- 400invalid_request
送った値が正しくない。message にどこが違うかが入ります
- 403insufficient_scope
キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります
- 404not_found
対象がない、またはこのワークスペースのものではない
- 409saved_card_charges_unavailable
本番で
/v1/…/{id}/saved-cards/setup-linkscurl -X POST https://tooon.app/api/v1/clients/clx8k2m0a0001/saved-cards/setup-links \
-H "Authorization: Bearer $TOOON_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"returnUrl": "https://tooon.app/…"
}'{
"data": {
"url": "https://tooon.app/…",
"expiresAt": "2026-11-01T09:00:00.000Z",
"consentText": "…"
}
}