---
title: "RevenueCat webhook"
method: POST
path: "/api/webhooks/revenuecat"
tags: ["Webhooks", "Commerce and purchases"]
---

# RevenueCat webhook

`POST /api/webhooks/revenuecat`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/webhooks/revenuecat`
- Auth: HTTP bearer

Grants coins on NON_RENEWING_PURCHASE. product_id may be a store SKU (com.engage.coins_*) or a legacy tier_*_coins id. An unknown coin product returns 500 UNKNOWN_PRODUCT. CANCELLATION with cancel_reason CUSTOMER_SUPPORT claws back a coin grant (balance may go negative; free price-0 claims still succeed). Unmatched coin refunds return 500 PURCHASE_NOT_FOUND. REFUND_REVERSED re-credits a refunded coin grant once (App Store). Use Authorization: Bearer with REVENUECAT_WEBHOOK_SECRET.

## Request body

- object
  - `event` object
    - `type` string
    - `id` string, nullable, required: RevenueCat event id. The key is always present; the value can be null. Retries reuse it. A coin refund with a missing or empty id returns 400.
    - `app_user_id` string
    - `product_id` string
    - `transaction_id` string
    - `original_transaction_id` string: Preferred match key for the original coin grant.
    - `cancel_reason` string: On CANCELLATION, CUSTOMER_SUPPORT is a refund.
    - `currency` string

## Response `200`

{ received: true }

## Other responses

- `400`: VALIDATION_ERROR — invalid payload, a purchase with no transaction id, or a coin refund or reversal with no event id
- `401`: UNAUTHORIZED
- `500`: INTERNAL_ERROR, PURCHASE_NOT_FOUND when a coin refund matches no grant, or UNKNOWN_PRODUCT when the coin SKU is not seeded

## Changes

- **2026-11-18** `6de639c52609`: 1 breaking, 7 info
  - added the new required request property `event/id`
  - added the new optional request property `event/cancel_reason`
  - added the new optional request property `event/currency`
  - added the new optional request property `event/original_transaction_id`
  - …4 more
- **2026-03-12** `099fcb1a1540`: 1 info
  - api tag `Commerce and purchases` added
- **2026-03-08** `120afc4ee72c`: 3 info
  - the endpoint scheme security `webhookSecret` was added to the API
  - the endpoint scheme security `bearerAuth` was removed from the API
  - api tag `Webhooks` added
- **2026-03-08** `ca10899d061e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/webhooks/revenuecat/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
