Revost Tasks API
17 endpoints across 6 resource groups
InternalShifts
/api/v1/internal/shifts/extend-instances
シフトインスタンス延長
繰り返しシフトの将来インスタンスを生成します
Request Body
シフトID。省略時は全繰り返しシフトを対象にする
Responses
Response Schema (200)
curl -X POST "http://localhost:8092/api/v1/internal/shifts/extend-instances" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"shift_id": "string"
}'{
"ok": true
}const response = await fetch("http://localhost:8092/api/v1/internal/shifts/extend-instances", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"shift_id": "string"
})
});
const data = await response.json();/api/v1/internal/shifts/generate-instances
シフトインスタンス生成
指定シフトのインスタンスを生成します
Request Body
シフトID
生成開始日時
生成終了日時
繰り返しルール
タイムゾーン
既存インスタンスを再生成するか
Responses
Response Schema (200)
curl -X POST "http://localhost:8092/api/v1/internal/shifts/generate-instances" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"shift_id": "string",
"start_at": "2024-01-01T00:00:00Z",
"end_at": "2024-01-01T00:00:00Z",
"rrule": "string",
"timezone": "string",
"regenerate": true
}'{
"ok": true
}const response = await fetch("http://localhost:8092/api/v1/internal/shifts/generate-instances", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"shift_id": "string",
"start_at": "2024-01-01T00:00:00Z",
"end_at": "2024-01-01T00:00:00Z",
"rrule": "string",
"timezone": "string",
"regenerate": true
})
});
const data = await response.json();InternalRewards
/api/v1/internal/rewards/grant-invitation-bonus
招待ボーナス付与
招待コード利用後に招待者・被招待者へコイン報酬を付与します
Request Body
招待利用ID
招待者ユーザーID
被招待者ユーザーID
Responses
Response Schema (200)
curl -X POST "http://localhost:8092/api/v1/internal/rewards/grant-invitation-bonus" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"invitation_usage_id": "string",
"inviter_id": "string",
"invitee_id": "string"
}'{
"ok": true
}const response = await fetch("http://localhost:8092/api/v1/internal/rewards/grant-invitation-bonus", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"invitation_usage_id": "string",
"inviter_id": "string",
"invitee_id": "string"
})
});
const data = await response.json();InternalPaymentRefunds
/api/v1/internal/payment-refunds/{refund_id}/process
返金処理
PaymentRefund を起点に paid coin を回収し、未回収分は DebtCase/UserDebt に記録します
Parameters
| Parameter | Type | Description |
|---|---|---|
refund_id REQUIRED | string | — |
Request Body
実行依頼した管理者ID。webhook 起因では null
Responses
Response Schema (200)
curl -X POST "http://localhost:8092/api/v1/internal/payment-refunds/{refund_id}/process" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"requested_by_admin_user_id": "string"
}'{
"ok": true
}const response = await fetch("http://localhost:8092/api/v1/internal/payment-refunds/{refund_id}/process", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"requested_by_admin_user_id": "string"
})
});
const data = await response.json();InternalWebhooks
/api/v1/internal/webhooks/process-notification
Webhook通知処理
保存済みの Apple / Google 購入通知を処理し、返金時はコイン回収へ進めます
Request Body
通知プロバイダー
プロバイダー通知種別
プロバイダー側決済ID
プロバイダー通知ID
返金処理ID。返金以外の通知では null
Responses
Response Schema (200)
curl -X POST "http://localhost:8092/api/v1/internal/webhooks/process-notification" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"provider": "google",
"notification_type": "string",
"provider_payment_id": "string",
"provider_notification_id": "string",
"payment_refund_id": "string"
}'{
"ok": true
}const response = await fetch("http://localhost:8092/api/v1/internal/webhooks/process-notification", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"provider": "google",
"notification_type": "string",
"provider_payment_id": "string",
"provider_notification_id": "string",
"payment_refund_id": "string"
})
});
const data = await response.json();InternalNotifications
/api/v1/internal/notifications/dispatch-pending
pending通知ディスパッチ
scheduledAt が到達済みの pending 通知を一括処理します
Request Body
1リクエストで処理する最大件数。省略時は 100、上限は 500
Responses
Response Schema (200)
curl -X POST "http://localhost:8092/api/v1/internal/notifications/dispatch-pending" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"limit": 0
}'{
"ok": true,
"attempted_count": 0,
"processed_count": 0,
"failed_count": 0
}const response = await fetch("http://localhost:8092/api/v1/internal/notifications/dispatch-pending", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"limit": 0
})
});
const data = await response.json();/api/v1/internal/notifications/send
通知送信
1件の通知を FCM 経由で送信します
Request Body
通知ID
Responses
Response Schema (200)
今回処理したか
処理後の通知ステータス
curl -X POST "http://localhost:8092/api/v1/internal/notifications/send" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"notification_id": "string"
}'{
"ok": true,
"processed": true,
"status": "PENDING"
}const response = await fetch("http://localhost:8092/api/v1/internal/notifications/send", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"notification_id": "string"
})
});
const data = await response.json();InternalCoin
/api/v1/internal/coin/coin-grants/{outbox_id}/process
IAPコイン付与処理
決済成功後のコイン付与 outbox を1件処理します
Parameters
| Parameter | Type | Description |
|---|---|---|
outbox_id REQUIRED | string | — |
Responses
Response Schema (200)
今回処理したか
決済ID
処理後残高
curl -X POST "http://localhost:8092/api/v1/internal/coin/coin-grants/{outbox_id}/process" \
-H "Authorization: Bearer <token>"{
"processed": true,
"payment_id": "string",
"balance_coin": 0
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/coin-grants/{outbox_id}/process", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();/api/v1/internal/coin/jobs/gift-bag-items/expire
期限切れギフトバッグアイテム処理ジョブ
期限切れ gift_bag_items を expire として処理します
Request Body
実行対象年月(YYYY-MM)
dry-run 実行
Responses
Response Schema (200)
ジョブ識別子
受理結果
curl -X POST "http://localhost:8092/api/v1/internal/coin/jobs/gift-bag-items/expire" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"year_month": "string",
"dry_run": true
}'{
"job_id": "string",
"accepted": true
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/jobs/gift-bag-items/expire", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"year_month": "string",
"dry_run": true
})
});
const data = await response.json();/api/v1/internal/coin/jobs/iap-recovery/run
IAP recovery ジョブ
DBに残っている未完了 IAP 作業を検出し、対応する worker task を再投入します
Request Body
dry-run 実行。true の場合はDB更新・Cloud Tasks enqueue を行わない
対象種別ごとの最大取得件数。省略時は100、上限は500
Responses
Response Schema (200)
ジョブ識別子
受理結果
dry-run 実行か
検出した候補件数
Cloud Tasks へ投入できた件数
Cloud Tasks 投入に失敗した件数
検出した対象ID
Cloud Tasks 投入に失敗した対象ID
検出した候補件数
Cloud Tasks へ投入できた件数
Cloud Tasks 投入に失敗した件数
検出した対象ID
Cloud Tasks 投入に失敗した対象ID
検出した候補件数
Cloud Tasks へ投入できた件数
Cloud Tasks 投入に失敗した件数
検出した対象ID
Cloud Tasks 投入に失敗した対象ID
検出した候補件数
Cloud Tasks へ投入できた件数
Cloud Tasks 投入に失敗した件数
検出した対象ID
Cloud Tasks 投入に失敗した対象ID
手動確認が必要な候補件数
手動確認が必要な provider notification event ID
curl -X POST "http://localhost:8092/api/v1/internal/coin/jobs/iap-recovery/run" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"dry_run": true,
"limit_per_kind": 0
}'{
"job_id": "string",
"accepted": true,
"dry_run": true,
"verification_requests": {
"candidate_count": 0,
"enqueued_count": 0,
"failed_count": 0,
"ids": [
"string"
],
"failed_ids": [
"string"
]
},
"coin_grant_outbox": {
"candidate_count": 0,
"enqueued_count": 0,
"failed_count": 0,
"ids": [
"string"
],
"failed_ids": [
"string"
]
},
"provider_notification_events": {
"candidate_count": 0,
"enqueued_count": 0,
"failed_count": 0,
"ids": [
"string"
],
"failed_ids": [
"string"
]
},
"store_completions": {
"candidate_count": 0,
"enqueued_count": 0,
"failed_count": 0,
"ids": [
"string"
],
"failed_ids": [
"string"
]
},
"manual_review_provider_events": {
"candidate_count": 0,
"ids": [
"string"
]
}
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/jobs/iap-recovery/run", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"dry_run": true,
"limit_per_kind": 0
})
});
const data = await response.json();/api/v1/internal/coin/jobs/lots/expire
期限切れロット処理ジョブ
期限切れ coin_lots を expire として処理します
Request Body
実行対象年月(YYYY-MM)
dry-run 実行
Responses
Response Schema (200)
ジョブ識別子
受理結果
curl -X POST "http://localhost:8092/api/v1/internal/coin/jobs/lots/expire" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"year_month": "string",
"dry_run": true
}'{
"job_id": "string",
"accepted": true
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/jobs/lots/expire", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"year_month": "string",
"dry_run": true
})
});
const data = await response.json();/api/v1/internal/coin/jobs/purchase-intents/expire
pending intent 失効ジョブ
一定時間経過した pending purchase_intents を expired に遷移します
Request Body
実行対象年月(YYYY-MM)
dry-run 実行
Responses
Response Schema (200)
ジョブ識別子
受理結果
curl -X POST "http://localhost:8092/api/v1/internal/coin/jobs/purchase-intents/expire" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"year_month": "string",
"dry_run": true
}'{
"job_id": "string",
"accepted": true
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/jobs/purchase-intents/expire", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"year_month": "string",
"dry_run": true
})
});
const data = await response.json();/api/v1/internal/coin/jobs/reconciliation/run
整合性チェックジョブ
残高・ロット・債務の整合性チェックを実行します
Request Body
実行対象年月(YYYY-MM)
dry-run 実行
Responses
Response Schema (200)
ジョブ識別子
受理結果
残高 vs ロット合計チェック結果
各整合性チェック結果
チェック名
照合対象件数
不整合件数
不整合の詳細(上位100件)
対象ID
期待値
実際値
詳細
curl -X POST "http://localhost:8092/api/v1/internal/coin/jobs/reconciliation/run" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"year_month": "string",
"dry_run": true
}'{
"job_id": "string",
"accepted": true,
"balance_vs_lot": null,
"checks": [
{
"check_name": "string",
"checked_count": 0,
"discrepancy_count": 0,
"discrepancies": [
{
"id": "string",
"expected": 0,
"actual": 0,
"detail": "string"
}
]
}
]
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/jobs/reconciliation/run", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"year_month": "string",
"dry_run": true
})
});
const data = await response.json();/api/v1/internal/coin/jobs/withdrawals/payout
出金支払いジョブ
確定済み出金の支払い処理を実行します
Request Body
実行対象年月(YYYY-MM)
dry-run 実行
Responses
Response Schema (200)
ジョブ識別子
受理結果
curl -X POST "http://localhost:8092/api/v1/internal/coin/jobs/withdrawals/payout" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"year_month": "string",
"dry_run": true
}'{
"job_id": "string",
"accepted": true
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/jobs/withdrawals/payout", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"year_month": "string",
"dry_run": true
})
});
const data = await response.json();/api/v1/internal/coin/purchase-verifications/{verification_request_id}/process
IAP検証依頼処理
受け付け済みの検証依頼を1件処理し、成功/失敗結果をDBへ保存します
Parameters
| Parameter | Type | Description |
|---|---|---|
verification_request_id REQUIRED | string | — |
Responses
Response Schema (200)
今回処理したか
決済ID
コイン付与 outbox ID
curl -X POST "http://localhost:8092/api/v1/internal/coin/purchase-verifications/{verification_request_id}/process" \
-H "Authorization: Bearer <token>"{
"processed": true,
"payment_id": "string",
"coin_grant_outbox_id": "string"
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/purchase-verifications/{verification_request_id}/process", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();/api/v1/internal/coin/store-completions/{store_completion_id}/process
Store完了処理
コイン付与済みの IAP purchase に対して Google consume / Apple finishTransaction を1件処理し、結果をDBへ保存します
Parameters
| Parameter | Type | Description |
|---|---|---|
store_completion_id REQUIRED | string | — |
Responses
Response Schema (200)
今回処理したか
処理結果
curl -X POST "http://localhost:8092/api/v1/internal/coin/store-completions/{store_completion_id}/process" \
-H "Authorization: Bearer <token>"{
"processed": true,
"outcome": "succeeded"
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/store-completions/{store_completion_id}/process", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();/api/v1/internal/coin/webhooks/provider-events/{event_id}/process
Provider webhook event 処理
保存済みの Apple / Google webhook event を分類し、購入・返金・ignored・要手動調査へ振り分けます
Parameters
| Parameter | Type | Description |
|---|---|---|
event_id REQUIRED | string | — |
Responses
Response Schema (200)
今回処理したか
処理結果
curl -X POST "http://localhost:8092/api/v1/internal/coin/webhooks/provider-events/{event_id}/process" \
-H "Authorization: Bearer <token>"{
"processed": true,
"action": "processed"
}const response = await fetch("http://localhost:8092/api/v1/internal/coin/webhooks/provider-events/{event_id}/process", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();