---
title: "Refresh Coins"
method: POST
path: "/api/payments/refresh-coins"
tags: ["payments"]
---

# Refresh Coins

`POST /api/payments/refresh-coins`

## Request

- Base URL: `https://api.stellara.natlex.it` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stellara.natlex.it/api/payments/refresh-coins`
- Auth: none declared. Required headers: `X-Cron-Secret`

Daily cron: grant next 600-coin cycle to every Pro user whose last
grant is >= 30 days old.

Reuses ``NOTIFICATION_CRON_SECRET`` to avoid adding a second secret to
Secret Manager / Cloud Run. Timing-safe comparison via ``hmac.compare_digest``.

Scheduler job: ``stellara-coin-refresh`` (``0 0 * * *`` UTC). Idempotent —
re-running inside the same 30-day window is a noop for every user.

## Headers

- `X-Cron-Secret` string, required

## Response `200`

Successful Response

- RefreshCoinsResponse
  - `status` string, required
  - `scanned` integer, required
  - `granted` integer, required
  - `skipped` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/natlex/apis/stellara-api.md) · [All operations](https://skmtc.dev/natlex/apis/stellara-api/llms.txt) · [OpenAPI document](https://skmtc.dev/natlex/apis/stellara-api/revisions/e576f046b61f?raw)
