Revost Tasks API

17 endpoints across 6 resource groups

InternalShifts

post

/api/v1/internal/shifts/extend-instances

シフトインスタンス延長

繰り返しシフトの将来インスタンスを生成します

Request Body

shift_idstring

シフトID。省略時は全繰り返しシフトを対象にする

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
Example Request
cURL
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"
}'
Response200 OK
{
  "ok": true
}
Node.js
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();
post

/api/v1/internal/shifts/generate-instances

シフトインスタンス生成

指定シフトのインスタンスを生成します

Request Body

shift_idstringrequired

シフトID

start_atstring (date-time)required

生成開始日時

end_atstring (date-time)required

生成終了日時

rrulestring

繰り返しルール

timezonestring

タイムゾーン

regenerateboolean

既存インスタンスを再生成するか

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
Example Request
cURL
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
}'
Response200 OK
{
  "ok": true
}
Node.js
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

post

/api/v1/internal/rewards/grant-invitation-bonus

招待ボーナス付与

招待コード利用後に招待者・被招待者へコイン報酬を付与します

Request Body

invitation_usage_idstringrequired

招待利用ID

inviter_idstringrequired

招待者ユーザーID

invitee_idstringrequired

被招待者ユーザーID

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
Example Request
cURL
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"
}'
Response200 OK
{
  "ok": true
}
Node.js
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

post

/api/v1/internal/payment-refunds/{refund_id}/process

返金処理

PaymentRefund を起点に paid coin を回収し、未回収分は DebtCase/UserDebt に記録します

Parameters

ParameterTypeDescription
refund_id
REQUIRED
string

Request Body

requested_by_admin_user_idstring

実行依頼した管理者ID。webhook 起因では null

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
404404 Not Found エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
Example Request
cURL
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"
}'
Response200 OK
{
  "ok": true
}
Node.js
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

post

/api/v1/internal/webhooks/process-notification

Webhook通知処理

保存済みの Apple / Google 購入通知を処理し、返金時はコイン回収へ進めます

Request Body

providerstringrequired

通知プロバイダー

notification_typestringrequired

プロバイダー通知種別

provider_payment_idstringrequired

プロバイダー側決済ID

provider_notification_idstringrequired

プロバイダー通知ID

payment_refund_idstringrequired

返金処理ID。返金以外の通知では null

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
Example Request
cURL
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"
}'
Response200 OK
{
  "ok": true
}
Node.js
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

post

/api/v1/internal/notifications/dispatch-pending

pending通知ディスパッチ

scheduledAt が到達済みの pending 通知を一括処理します

Request Body

limitinteger (int32)

1リクエストで処理する最大件数。省略時は 100、上限は 500

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
attempted_countinteger (int32)required
processed_countinteger (int32)required
failed_countinteger (int32)required
Example Request
cURL
curl -X POST "http://localhost:8092/api/v1/internal/notifications/dispatch-pending" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "limit": 0
}'
Response200 OK
{
  "ok": true,
  "attempted_count": 0,
  "processed_count": 0,
  "failed_count": 0
}
Node.js
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();
post

/api/v1/internal/notifications/send

通知送信

1件の通知を FCM 経由で送信します

Request Body

notification_idstringrequired

通知ID

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

okbooleanrequired
processedbooleanrequired

今回処理したか

statusstring

処理後の通知ステータス

Example Request
cURL
curl -X POST "http://localhost:8092/api/v1/internal/notifications/send" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "notification_id": "string"
}'
Response200 OK
{
  "ok": true,
  "processed": true,
  "status": "PENDING"
}
Node.js
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

post

/api/v1/internal/coin/coin-grants/{outbox_id}/process

IAPコイン付与処理

決済成功後のコイン付与 outbox を1件処理します

Parameters

ParameterTypeDescription
outbox_id
REQUIRED
string

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

processedbooleanrequired

今回処理したか

payment_idstringrequired

決済ID

balance_coininteger (int32)required

処理後残高

Example Request
cURL
curl -X POST "http://localhost:8092/api/v1/internal/coin/coin-grants/{outbox_id}/process" \
  -H "Authorization: Bearer <token>"
Response200 OK
{
  "processed": true,
  "payment_id": "string",
  "balance_coin": 0
}
Node.js
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();
post

/api/v1/internal/coin/jobs/gift-bag-items/expire

期限切れギフトバッグアイテム処理ジョブ

期限切れ gift_bag_items を expire として処理します

Request Body

year_monthstring

実行対象年月(YYYY-MM)

dry_runboolean

dry-run 実行

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

job_idstringrequired

ジョブ識別子

acceptedbooleanrequired

受理結果

Example Request
cURL
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
}'
Response200 OK
{
  "job_id": "string",
  "accepted": true
}
Node.js
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();
post

/api/v1/internal/coin/jobs/iap-recovery/run

IAP recovery ジョブ

DBに残っている未完了 IAP 作業を検出し、対応する worker task を再投入します

Request Body

dry_runboolean

dry-run 実行。true の場合はDB更新・Cloud Tasks enqueue を行わない

limit_per_kindinteger (int32)

対象種別ごとの最大取得件数。省略時は100、上限は500

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

job_idstringrequired

ジョブ識別子

acceptedbooleanrequired

受理結果

dry_runbooleanrequired

dry-run 実行か

verification_requestsobjectrequired
candidate_countinteger (int32)required

検出した候補件数

enqueued_countinteger (int32)required

Cloud Tasks へ投入できた件数

failed_countinteger (int32)required

Cloud Tasks 投入に失敗した件数

idsArray<string>required

検出した対象ID

string
failed_idsArray<string>required

Cloud Tasks 投入に失敗した対象ID

string
coin_grant_outboxobjectrequired
candidate_countinteger (int32)required

検出した候補件数

enqueued_countinteger (int32)required

Cloud Tasks へ投入できた件数

failed_countinteger (int32)required

Cloud Tasks 投入に失敗した件数

idsArray<string>required

検出した対象ID

string
failed_idsArray<string>required

Cloud Tasks 投入に失敗した対象ID

string
provider_notification_eventsobjectrequired
candidate_countinteger (int32)required

検出した候補件数

enqueued_countinteger (int32)required

Cloud Tasks へ投入できた件数

failed_countinteger (int32)required

Cloud Tasks 投入に失敗した件数

idsArray<string>required

検出した対象ID

string
failed_idsArray<string>required

Cloud Tasks 投入に失敗した対象ID

string
store_completionsobjectrequired
candidate_countinteger (int32)required

検出した候補件数

enqueued_countinteger (int32)required

Cloud Tasks へ投入できた件数

failed_countinteger (int32)required

Cloud Tasks 投入に失敗した件数

idsArray<string>required

検出した対象ID

string
failed_idsArray<string>required

Cloud Tasks 投入に失敗した対象ID

string
manual_review_provider_eventsobjectrequired
candidate_countinteger (int32)required

手動確認が必要な候補件数

idsArray<string>required

手動確認が必要な provider notification event ID

string
Example Request
cURL
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
}'
Response200 OK
{
  "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"
    ]
  }
}
Node.js
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();
post

/api/v1/internal/coin/jobs/lots/expire

期限切れロット処理ジョブ

期限切れ coin_lots を expire として処理します

Request Body

year_monthstring

実行対象年月(YYYY-MM)

dry_runboolean

dry-run 実行

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

job_idstringrequired

ジョブ識別子

acceptedbooleanrequired

受理結果

Example Request
cURL
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
}'
Response200 OK
{
  "job_id": "string",
  "accepted": true
}
Node.js
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();
post

/api/v1/internal/coin/jobs/purchase-intents/expire

pending intent 失効ジョブ

一定時間経過した pending purchase_intents を expired に遷移します

Request Body

year_monthstring

実行対象年月(YYYY-MM)

dry_runboolean

dry-run 実行

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

job_idstringrequired

ジョブ識別子

acceptedbooleanrequired

受理結果

Example Request
cURL
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
}'
Response200 OK
{
  "job_id": "string",
  "accepted": true
}
Node.js
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();
post

/api/v1/internal/coin/jobs/reconciliation/run

整合性チェックジョブ

残高・ロット・債務の整合性チェックを実行します

Request Body

year_monthstring

実行対象年月(YYYY-MM)

dry_runboolean

dry-run 実行

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

job_idstringrequired

ジョブ識別子

acceptedbooleanrequired

受理結果

balance_vs_lotunknownrequired

残高 vs ロット合計チェック結果

checksArray<object>required

各整合性チェック結果

check_namestringrequired

チェック名

checked_countinteger (int32)required

照合対象件数

discrepancy_countinteger (int32)required

不整合件数

discrepanciesArray<object>required

不整合の詳細(上位100件)

idstringrequired

対象ID

expectedinteger (int32)required

期待値

actualinteger (int32)required

実際値

detailstring

詳細

Example Request
cURL
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
}'
Response200 OK
{
  "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"
        }
      ]
    }
  ]
}
Node.js
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();
post

/api/v1/internal/coin/jobs/withdrawals/payout

出金支払いジョブ

確定済み出金の支払い処理を実行します

Request Body

year_monthstring

実行対象年月(YYYY-MM)

dry_runboolean

dry-run 実行

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

job_idstringrequired

ジョブ識別子

acceptedbooleanrequired

受理結果

Example Request
cURL
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
}'
Response200 OK
{
  "job_id": "string",
  "accepted": true
}
Node.js
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();
post

/api/v1/internal/coin/purchase-verifications/{verification_request_id}/process

IAP検証依頼処理

受け付け済みの検証依頼を1件処理し、成功/失敗結果をDBへ保存します

Parameters

ParameterTypeDescription
verification_request_id
REQUIRED
string

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
404404 Not Found エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

processedbooleanrequired

今回処理したか

payment_idstringrequired

決済ID

coin_grant_outbox_idstringrequired

コイン付与 outbox ID

Example Request
cURL
curl -X POST "http://localhost:8092/api/v1/internal/coin/purchase-verifications/{verification_request_id}/process" \
  -H "Authorization: Bearer <token>"
Response200 OK
{
  "processed": true,
  "payment_id": "string",
  "coin_grant_outbox_id": "string"
}
Node.js
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();
post

/api/v1/internal/coin/store-completions/{store_completion_id}/process

Store完了処理

コイン付与済みの IAP purchase に対して Google consume / Apple finishTransaction を1件処理し、結果をDBへ保存します

Parameters

ParameterTypeDescription
store_completion_id
REQUIRED
string

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

processedbooleanrequired

今回処理したか

outcomestringrequired

処理結果

Example Request
cURL
curl -X POST "http://localhost:8092/api/v1/internal/coin/store-completions/{store_completion_id}/process" \
  -H "Authorization: Bearer <token>"
Response200 OK
{
  "processed": true,
  "outcome": "succeeded"
}
Node.js
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();
post

/api/v1/internal/coin/webhooks/provider-events/{event_id}/process

Provider webhook event 処理

保存済みの Apple / Google webhook event を分類し、購入・返金・ignored・要手動調査へ振り分けます

Parameters

ParameterTypeDescription
event_id
REQUIRED
string

Responses

200200 OK レスポンス
400400 Bad Request エラーレスポンス
403403 Forbidden エラーレスポンス
404404 Not Found エラーレスポンス
500500 Internal Server Error エラーレスポンス

Response Schema (200)

processedbooleanrequired

今回処理したか

actionstringrequired

処理結果

Example Request
cURL
curl -X POST "http://localhost:8092/api/v1/internal/coin/webhooks/provider-events/{event_id}/process" \
  -H "Authorization: Bearer <token>"
Response200 OK
{
  "processed": true,
  "action": "processed"
}
Node.js
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();