Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent
with a free APIs.io key —
sign in with
GitHub,
Google or
LinkedIn.
No form to fill in; signing in shares your email address with us (Privacy).
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: V³ News API v3 Billing Google API
version: 0.1.0
tags:
- name: billing-google
paths:
/billing/google/validate-purchase:
post:
tags:
- billing-google
summary: Validate Purchase
description: 'Verify a Play Billing purchase and upsert the member''s Google
subscription row.
Flow:
1. Fetch authoritative state via subscriptionsv2.get — the
client''s token is an unverified hint until this confirms it.
2. Refuse to grant on PENDING (carrier billing not yet
authorized) or EXPIRED states.
3. UPSERT member_subscriptions ON CONFLICT (google_purchase_token).
4. Return gating-relevant fields so the client can update
local state without a second GET /billing/subscription.
Auth: standard ``current_member`` — same posture as the Apple
validate-receipt route. A stolen token without a session can''t
grant access to a different member.'
operationId: validate_purchase_billing_google_validate_purchase_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ValidatePurchaseRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ValidatePurchaseResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/billing/google/webhook:
post:
tags:
- billing-google
summary: Rtdn Webhook
description: 'Receive a Real-Time Developer Notification.
Pub/Sub wraps the notification as::
{"message": {"messageId": "...", "data": "",
"publishTime": "..."}, "subscription": "..."}
Posture:
* OIDC-authenticated (see _verify_pubsub_oidc). The endpoint is
whitelisted from Clerk auth in main.py — Google has no member
session.
* Idempotent on messageId via the google_notifications UNIQUE
constraint; Pub/Sub retries on non-2xx.
* The decoded payload is a HINT. State mutations only happen
after re-fetching authoritative state via subscriptionsv2.get.
* Processing errors return 200 after being recorded in the
audit row — retrying a deterministic handler bug forever
would just spam the audit table. The unprocessed partial
index keeps failures findable for replay.'
operationId: rtdn_webhook_billing_google_webhook_post
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Rtdn Webhook Billing Google Webhook Post
components:
schemas:
ValidatePurchaseRequest:
properties:
purchase_token:
type: string
title: Purchase Token
description: Opaque Play Billing purchase token from the mobile client
product_id:
type: string
title: Product Id
description: Play subscription product ID (e.g. news.v3.app.standard)
base_plan_id:
anyOf:
- type: string
- type: 'null'
title: Base Plan Id
description: Play base plan ID — monthly / annual
type: object
required:
- purchase_token
- product_id
title: ValidatePurchaseRequest
ValidatePurchaseResponse:
properties:
ok:
type: boolean
title: Ok
subscription_source:
type: string
const: google
title: Subscription Source
status:
type: string
title: Status
plan_period:
type: string
title: Plan Period
current_period_end:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Current Period End
type: object
required:
- ok
- subscription_source
- status
- plan_period
- current_period_end
title: ValidatePurchaseResponse
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError