> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get billing

> The owner's plan, what it allows and has used, the last invoices and the plans on sale.

> [!NOTE]
>
> Needs `billing:read`. Only a workspace owner has a plan here; a teammate gets `403`. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

Gives the plan of the key's user:

* `plan` and `plan_name`, `cycle` (`monthly` or `yearly`, `null` on Free) and `status`: `free`, `active`, `canceled` (paid until `ends_at`, then Free), `past_due` (a payment failed) or `paused` (a break, billing again at `renews_at`).
* `renews_at` when it next bills, and `first_week_ends_at` while the owner's first week runs.
* `limits`: social accounts, this month's posts on Free (`null` when posts are unlimited), and AI credits left.
* `extra_accounts` on plans that have them (Agency).
* `invoices`: the last 12, newest first, each with its page. `null` when Stripe couldn't be reached just now; the rest of the answer is still there.
* `plans`: the plans on sale, with their monthly and yearly prices in dollars. `sale` is a sale running now, for an owner who doesn't pay.

To pay for, change or cancel the plan, make a link with [Create a billing link](https://docs.postsyncer.com/api-reference/billing/create-link.md).

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `billing:read`, its user is inactive, or the user owns no workspace. | No: the workspace owner's key does it. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [Billing from an agent](https://docs.postsyncer.com/guides/billing-from-an-agent.md): the pay link and the other links, step by step.
* [Plan limits](https://docs.postsyncer.com/plan-limits.md): what each plan allows, and the answer at a limit.


## OpenAPI

````yaml GET /billing
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
  - name: Billing
    description: >-
      The owner's plan, invoices and the links that pay for, change or cancel
      it.
  - name: Team
    description: A workspace's teammates and invitations, and their roles.
  - name: Notifications
    description: >-
      Your bell and notification settings, and the workspace's Slack, Discord
      and Telegram channels.
  - name: Blog-to-social
    description: Blog feeds that turn a workspace's new articles into posts.
  - name: Products
    description: Products the workspace's posts can promote.
  - name: Contacts
    description: People who commented on the workspace's posts, and the lists they are on.
  - name: Profile
    description: 'The key''s user: their name and sign-in email.'
  - name: API keys
    description: 'Your API keys: listing and deleting them.'
  - name: Agent sign-up
    description: >-
      An AI agent signs a person up with a code emailed to them, and gets their
      first key. No key needed.
paths:
  /billing:
    get:
      tags:
        - Billing
      summary: Get billing
      description: >-
        Needs `billing:read`. Gives the key's user's own plan: its key and name,
        cycle and status, when it renews or ends, the first week's end while it
        runs, the limits and what's used (accounts, this month's posts on Free,
        AI credits), extra accounts, the last 12 invoices, and the plans on sale
        with their monthly and yearly prices. Only a workspace owner has a plan
        here; a teammate gets `403`. To pay for, change or cancel the plan, make
        a link with `POST /billing/links`.
      operationId: getBilling
      responses:
        '200':
          description: The plan, usage, invoices and plans on sale.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Billing'
              examples:
                default:
                  summary: Free, in the first week
                  value:
                    plan: free
                    plan_name: Free
                    cycle: null
                    status: free
                    renews_at: null
                    ends_at: null
                    first_week_ends_at: '2030-03-15T09:00:00+00:00'
                    limits:
                      accounts:
                        scope: total
                        allowed: 2
                        used: 2
                      posts: null
                      ai_credits:
                        left: 80
                        allowed: 100
                        used: 20
                        resets_at: '2030-04-08T09:00:00+00:00'
                    extra_accounts: null
                    invoices: []
                    plans:
                      - plan: starter-v2
                        name: Starter
                        monthly_price: 29
                        yearly_price: 24
                        yearly_total: 288
                        accounts: 10
                        accounts_per_workspace: false
                        credits: 1000
                        workspaces: 1000
                      - plan: pro-v2
                        name: Pro
                        monthly_price: 49
                        yearly_price: 39
                        yearly_total: 468
                        accounts: 30
                        accounts_per_workspace: false
                        credits: 2000
                        workspaces: 1000
                      - plan: agency-v2
                        name: Agency
                        monthly_price: 99
                        yearly_price: 79
                        yearly_total: 948
                        accounts: 100
                        accounts_per_workspace: false
                        credits: 4000
                        workspaces: 1000
                    sale: null
                free_month_used:
                  summary: Free, this month's posts used
                  value:
                    plan: free
                    plan_name: Free
                    cycle: null
                    status: free
                    renews_at: null
                    ends_at: null
                    first_week_ends_at: null
                    limits:
                      accounts:
                        scope: total
                        allowed: 2
                        used: 1
                      posts:
                        allowed: 20
                        used: 20
                        left: 0
                        resets_at: '2030-04-08T09:00:00+00:00'
                      ai_credits:
                        left: 100
                        allowed: 100
                        used: 0
                        resets_at: '2030-04-08T09:00:00+00:00'
                    extra_accounts: null
                    invoices: []
                    plans:
                      - plan: starter-v2
                        name: Starter
                        monthly_price: 29
                        yearly_price: 24
                        yearly_total: 288
                        accounts: 10
                        accounts_per_workspace: false
                        credits: 1000
                        workspaces: 1000
                      - plan: pro-v2
                        name: Pro
                        monthly_price: 49
                        yearly_price: 39
                        yearly_total: 468
                        accounts: 30
                        accounts_per_workspace: false
                        credits: 2000
                        workspaces: 1000
                      - plan: agency-v2
                        name: Agency
                        monthly_price: 99
                        yearly_price: 79
                        yearly_total: 948
                        accounts: 100
                        accounts_per_workspace: false
                        credits: 4000
                        workspaces: 1000
                    sale: null
                payer:
                  summary: Pro, paid yearly
                  value:
                    plan: pro-v2
                    plan_name: Pro
                    cycle: yearly
                    status: active
                    renews_at: '2031-03-08T09:00:00+00:00'
                    ends_at: null
                    first_week_ends_at: null
                    limits:
                      accounts:
                        scope: total
                        allowed: 30
                        used: 12
                      posts: null
                      ai_credits:
                        left: 1840
                        allowed: null
                        used: null
                        resets_at: null
                    extra_accounts: null
                    invoices:
                      - number: HC-0002
                        date: '2030-03-08T09:00:00+00:00'
                        status: paid
                        total: 46800
                        currency: USD
                        amount: $468.00
                        url: https://invoice.stripe.com/i/acct_example/test_example
                    plans:
                      - plan: starter-v2
                        name: Starter
                        monthly_price: 29
                        yearly_price: 24
                        yearly_total: 288
                        accounts: 10
                        accounts_per_workspace: false
                        credits: 1000
                        workspaces: 1000
                      - plan: pro-v2
                        name: Pro
                        monthly_price: 49
                        yearly_price: 39
                        yearly_total: 468
                        accounts: 30
                        accounts_per_workspace: false
                        credits: 2000
                        workspaces: 1000
                      - plan: agency-v2
                        name: Agency
                        monthly_price: 99
                        yearly_price: 79
                        yearly_total: 948
                        accounts: 100
                        accounts_per_workspace: false
                        credits: 4000
                        workspaces: 1000
                    sale: null
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: >-
            The key lacks `billing:read`, its user is inactive, or the key's
            user owns no workspace (billing is the owner's).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks billing:read
                  value:
                    message: >-
                      This API key does not have the "billing:read" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                not_owner:
                  summary: A teammate, not an owner
                  value:
                    message: >-
                      Only the workspace owner can see billing or change the
                      plan, so ask them.
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    Billing:
      type: object
      description: The owner's plan, usage, invoices and the plans on sale.
      required:
        - plan
        - plan_name
        - cycle
        - status
        - renews_at
        - ends_at
        - first_week_ends_at
        - limits
        - extra_accounts
        - invoices
        - plans
        - sale
      properties:
        plan:
          type: string
          description: The plan's key, like `free` or `pro-v2`.
        plan_name:
          type: string
          description: The plan as people read it, like `Pro`.
        cycle:
          type: string
          nullable: true
          enum:
            - monthly
            - yearly
          description: How the plan is paid. `null` on Free.
        status:
          type: string
          enum:
            - free
            - active
            - canceled
            - past_due
            - paused
          description: >-
            `canceled`: paid until `ends_at`, then Free. `past_due`: a payment
            failed; a `card_and_invoices` link fixes it. `paused`: a break,
            billing again at `renews_at`.
        renews_at:
          type: string
          format: date-time
          nullable: true
          description: When the plan next bills.
        ends_at:
          type: string
          format: date-time
          nullable: true
          description: When a canceled plan ends.
        first_week_ends_at:
          type: string
          format: date-time
          nullable: true
          description: 'While the owner''s first week runs: when it ends. `null` otherwise.'
        limits:
          type: object
          required:
            - accounts
            - posts
            - ai_credits
          properties:
            accounts:
              type: object
              required:
                - scope
                - allowed
                - used
              properties:
                scope:
                  type: string
                  enum:
                    - total
                    - workspace
                  description: >-
                    `total`: counted across every workspace the owner has.
                    `workspace`: per workspace (older plans), here the owner's
                    first workspace.
                allowed:
                  type: integer
                used:
                  type: integer
            posts:
              type: object
              nullable: true
              description: >-
                This month's posts on Free. `null` when posts are unlimited (a
                paid plan, or the first week).
              required:
                - allowed
                - used
                - left
                - resets_at
              properties:
                allowed:
                  type: integer
                used:
                  type: integer
                left:
                  type: integer
                resets_at:
                  type: string
                  format: date-time
            ai_credits:
              type: object
              required:
                - left
                - allowed
                - used
                - resets_at
              properties:
                left:
                  type: integer
                  description: AI credits left.
                allowed:
                  type: integer
                  nullable: true
                  description: Free's credits this month; `null` on a paid plan.
                used:
                  type: integer
                  nullable: true
                  description: Free's credits used this month; `null` on a paid plan.
                resets_at:
                  type: string
                  format: date-time
                  nullable: true
                  description: When Free's credits start over; `null` on a paid plan.
        extra_accounts:
          type: object
          nullable: true
          description: >-
            Accounts above the plan's included ones, on plans that have them
            (Agency). `null` otherwise.
          required:
            - included
            - count
            - in_use
            - price
            - period
            - monthly_price
            - can_add
          properties:
            included:
              type: integer
            count:
              type: integer
              description: Extra accounts held.
            in_use:
              type: integer
            price:
              type: integer
              description: Dollars per extra account for the plan's cycle.
            period:
              type: string
              enum:
                - month
                - year
            monthly_price:
              type: integer
            can_add:
              type: boolean
        invoices:
          type: array
          nullable: true
          description: >-
            The last 12 invoices, newest first. `null` when they couldn't be
            read just now.
          items:
            type: object
            required:
              - number
              - date
              - status
              - total
              - currency
              - amount
              - url
            properties:
              number:
                type: string
                nullable: true
              date:
                type: string
                format: date-time
              status:
                type: string
                description: '`paid`, `open`, `void` or `uncollectible`.'
              total:
                type: integer
                description: In the currency's smallest unit (cents).
              currency:
                type: string
                description: Like `USD`.
              amount:
                type: string
                description: The total as people read it, like `$29.00`.
              url:
                type: string
                nullable: true
                description: The invoice's page, where it can be paid or downloaded.
        plans:
          type: array
          description: The plans on sale.
          items:
            type: object
            required:
              - plan
              - name
              - monthly_price
              - yearly_price
              - yearly_total
              - accounts
              - accounts_per_workspace
              - credits
              - workspaces
            properties:
              plan:
                type: string
                description: The key `POST /billing/links` takes.
              name:
                type: string
              monthly_price:
                type: number
                description: Dollars a month, paid monthly.
              yearly_price:
                type: number
                description: Dollars a month, paid yearly.
              yearly_total:
                type: number
                description: Dollars a year, paid yearly.
              accounts:
                type: integer
                description: Social accounts included.
              accounts_per_workspace:
                type: boolean
              credits:
                type: integer
                description: AI credits a month.
              workspaces:
                type: integer
                nullable: true
                description: Workspaces allowed; `null` for no limit.
        sale:
          type: object
          nullable: true
          description: >-
            A sale running now, for an owner who doesn't pay. `null` otherwise,
            and always for a payer.
          required:
            - key
            - name
            - percent
            - ends_at
            - ends_label
            - cycle
            - prices
          properties:
            key:
              type: string
            name:
              type: string
            percent:
              type: integer
            ends_at:
              type: string
              format: date-time
            ends_label:
              type: string
            cycle:
              type: string
              description: 'The cycle the sale''s price is for (`annual`: paid yearly).'
            prices:
              type: object
              description: >-
                By plan key: the first year's price, that year by the month, and
                the normal year.
              additionalProperties:
                type: object
                required:
                  - first_year
                  - per_month
                  - normally
                properties:
                  first_year:
                    type: number
                  per_month:
                    type: number
                  normally:
                    type: integer
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
        error:
          type: string
          description: >-
            A code a few errors add, such as `rate_limited`. See [Handle
            errors](/essentials/error-handling#answers-with-an-error-code).
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.