Discovery needs no key. Ratings and market analysis are Pro.
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. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: Parcha Billing API
description: API to deploy Parcha AI Agents
version: '1.0'
tags:
- name: Billing
paths:
/billing/reconcile:
post:
summary: Reconcile Billing Events
description: 'Reconcile Stripe events with local database for the specified lookback period.
This endpoint fetches Stripe events for the specified period and verifies that they have been
properly processed and applied to the local database. It can identify and fix:
- Missing subscription records
- Incorrect plan assignments
- Missing payment/invoice activities
- Orphaned subscription records
- Credit balance mismatches
Args:
lookback_days: Number of days to look back for events (max 30 due to Stripe API limitations)
include_processed: Whether to include already processed events (default: False)
Returns:
Detailed reconciliation report with found issues and fixes applied'
operationId: reconcile_billing_events_billing_reconcile_post
parameters:
- name: lookback_days
in: query
required: false
schema:
type: integer
maximum: 30
minimum: 1
description: Number of days to look back (1-30)
default: 7
title: Lookback Days
description: Number of days to look back (1-30)
- name: include_processed
in: query
required: false
schema:
type: boolean
description: Whether to include already processed events in reconciliation
default: false
title: Include Processed
description: Whether to include already processed events in reconciliation
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BillingReconciliationResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Billing
components:
schemas:
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
BillingReconciliationResponse:
properties:
period:
type: object
title: Period
description: Reconciliation period details
events_processed:
type: integer
title: Events Processed
description: Total number of Stripe events processed
events_skipped:
type: integer
title: Events Skipped
description: Number of events skipped (already processed)
discrepancies_found:
type: integer
title: Discrepancies Found
description: Total number of discrepancies found
fixes_applied:
type: integer
title: Fixes Applied
description: Number of fixes applied
errors:
items:
type: string
type: array
title: Errors
description: List of errors encountered during reconciliation
details:
additionalProperties:
items:
type: object
type: array
type: object
title: Details
description: Detailed breakdown of discrepancies found
type: object
required:
- period
- events_processed
- events_skipped
- discrepancies_found
- fixes_applied
- errors
- details
title: BillingReconciliationResponse
description: Response for billing reconciliation endpoint
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer