NudgeLink Billing API

The billing API from NudgeLink — 8 operation(s) for billing.

GitHub OpenAPI

Operations 8

GET /api/v1/billing/summary Summary #
GET /api/v1/billing/credit-status Credit Status #
GET /api/v1/billing/credit-history Credit History #
POST /api/v1/billing/start Start #
POST /api/v1/billing/checkout Checkout #
POST /api/v1/billing/topup Topup #
POST /api/v1/billing/portal Portal #
POST /api/v1/billing/webhook Webhook #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nudgelink-co:nudgelink-co-billing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

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.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nudgelink-co-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: NudgeLink Billing API
  version: 0.1.0
tags:
- name: Billing
paths:
  /api/v1/billing/summary:
    get:
      tags:
      - Billing
      summary: Summary
      operationId: summary_api_v1_billing_summary_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingSummary'
      security:
      - HTTPBearer: []
  /api/v1/billing/credit-status:
    get:
      tags:
      - Billing
      summary: Credit Status
      operationId: credit_status_api_v1_billing_credit_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditStatusOut'
      security:
      - HTTPBearer: []
  /api/v1/billing/credit-history:
    get:
      tags:
      - Billing
      summary: Credit History
      description: 'Every credit spent, returned or added, newest first (Yarik 2026-10-03:

        Billing showed only the balance, so a Scout charge could not be told apart

        from outreach spending — or from a bug). Read from the ledger rows that

        deduct_credits / refund_credits / admin grants already write.'
      operationId: credit_history_api_v1_billing_credit_history_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Limit
      - name: before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Before
      - name: before_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Before Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditHistoryOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/billing/start:
    post:
      tags:
      - Billing
      summary: Start
      operationId: start_api_v1_billing_start_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartSubscriptionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/billing/checkout:
    post:
      tags:
      - Billing
      summary: Checkout
      description: 'Create a Stripe Checkout Session for the chosen plan and return its

        hosted ``url``. The frontend redirects the browser to it. The subscription

        is only persisted once Stripe fires ``checkout.session.completed`` to the

        webhook below — we never trust the browser redirect alone.'
      operationId: checkout_api_v1_billing_checkout_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartSubscriptionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
                title: Response Checkout Api V1 Billing Checkout Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/billing/topup:
    post:
      tags:
      - Billing
      summary: Topup
      description: 'Open a one-off Stripe Checkout for the 3,000-credit pack ($25). Credits

        arrive from the webhook once Stripe confirms payment.'
      operationId: topup_api_v1_billing_topup_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
                title: Response Topup Api V1 Billing Topup Post
      security:
      - HTTPBearer: []
  /api/v1/billing/portal:
    post:
      tags:
      - Billing
      summary: Portal
      description: 'Create a Stripe Billing Portal session and return its hosted ``url`` so

        the client can update their card, download invoices, switch plan, or cancel.


        In STRIPE_MODE=mock there''s no portal — we return the billing page URL so the

        dev/test flow still resolves. Real mode requires the Billing Portal to be

        configured once in the Stripe dashboard.'
      operationId: portal_api_v1_billing_portal_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
                title: Response Portal Api V1 Billing Portal Post
      security:
      - HTTPBearer: []
  /api/v1/billing/webhook:
    post:
      tags:
      - Billing
      summary: Webhook
      description: 'Verified, transactional ledger processing. Failed writes are retried by Stripe.


        Invoice payment owns credits and revenue. Checkout completion alone does

        not prove payment (delayed payment methods can complete before settlement).

        A client row lock serializes different events for the same customer; the

        unique event id handles retries without hiding unrelated database errors.'
      operationId: webhook_api_v1_billing_webhook_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
                title: Response Webhook Api V1 Billing Webhook Post
components:
  schemas:
    StartSubscriptionRequest:
      properties:
        plan:
          type: string
          title: Plan
        interval:
          type: string
          enum:
          - month
          - year
          title: Interval
          default: month
      type: object
      required:
      - plan
      title: StartSubscriptionRequest
    CreditHistoryOut:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CreditHistoryItem'
          type: array
          title: Items
        since:
          type: string
          format: date-time
          title: Since
        totals:
          additionalProperties:
            type: integer
          type: object
          title: Totals
        next_before:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Next Before
        next_before_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Next Before Id
      type: object
      required:
      - items
      - since
      - totals
      title: CreditHistoryOut
    CreditStatusOut:
      properties:
        is_trial:
          type: boolean
          title: Is Trial
        out_of_credits:
          type: boolean
          title: Out Of Credits
        credits_balance:
          type: integer
          title: Credits Balance
        allowance:
          type: integer
          title: Allowance
        contacted:
          type: integer
          title: Contacted
        accepted:
          type: integer
          title: Accepted
        replied:
          type: integer
          title: Replied
        waiting:
          type: integer
          title: Waiting
        subscribe_bonus_until:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Subscribe Bonus Until
        subscribe_bonus_credits:
          type: integer
          title: Subscribe Bonus Credits
        connect_bonus_until:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Connect Bonus Until
        connect_bonus_credits:
          type: integer
          title: Connect Bonus Credits
        plan:
          anyOf:
          - type: string
          - type: 'null'
          title: Plan
        plan_comped:
          type: boolean
          title: Plan Comped
          default: false
        pilot_ended:
          type: boolean
          title: Pilot Ended
          default: false
        pilot_running:
          type: boolean
          title: Pilot Running
          default: false
        can_topup:
          type: boolean
          title: Can Topup
          default: false
      type: object
      required:
      - is_trial
      - out_of_credits
      - credits_balance
      - allowance
      - contacted
      - accepted
      - replied
      - waiting
      - subscribe_bonus_until
      - subscribe_bonus_credits
      - connect_bonus_until
      - connect_bonus_credits
      title: CreditStatusOut
      description: Feeds the dashboard's out-of-credits banner (services/credit_status.py).
    CreditHistoryItem:
      properties:
        at:
          type: string
          format: date-time
          title: At
        kind:
          type: string
          title: Kind
        action:
          type: string
          title: Action
        credits:
          type: integer
          title: Credits
        balance_after:
          anyOf:
          - type: integer
          - type: 'null'
          title: Balance After
      type: object
      required:
      - at
      - kind
      - action
      - credits
      title: CreditHistoryItem
    BillingSummary:
      properties:
        subscription_plan:
          anyOf:
          - type: string
          - type: 'null'
          title: Subscription Plan
        guarantee_status:
          type: string
          title: Guarantee Status
        pilot_start_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Pilot Start At
        billing_cycle_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Billing Cycle Start
        next_cycle_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Next Cycle At
        paused_days_client:
          type: integer
          title: Paused Days Client
        paused_days_system:
          type: integer
          title: Paused Days System
        credits_balance:
          type: integer
          title: Credits Balance
          default: 0
        credits_included:
          type: integer
          title: Credits Included
          default: 0
        credits_used_this_cycle:
          type: integer
          title: Credits Used This Cycle
          default: 0
        has_stripe_subscription:
          type: boolean
          title: Has Stripe Subscription
          default: false
        plan_comped:
          type: boolean
          title: Plan Comped
          default: false
        can_topup:
          type: boolean
          title: Can Topup
          default: false
        credits_topup_balance:
          type: integer
          title: Credits Topup Balance
          default: 0
        pilot_expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Pilot Expires At
        plan_active:
          type: boolean
          title: Plan Active
          default: false
        billing_interval:
          anyOf:
          - type: string
          - type: 'null'
          title: Billing Interval
        renews_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Renews At
      type: object
      required:
      - subscription_plan
      - guarantee_status
      - pilot_start_at
      - billing_cycle_start
      - next_cycle_at
      - paused_days_client
      - paused_days_system
      title: BillingSummary
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer