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

# Buy a pack of photo credits with the saved card

> Buy 50, 250 or 1000 photos with the saved card, no human needed. Send an `Idempotency-Key` to retry safely.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/me/credits/top-ups
openapi: 3.1.0
info:
  title: rial API
  version: 0.1.0
  description: 'Prove a photo is real. Base URL: https://api.rial.io'
  contact:
    name: rial-platform team
    url: https://github.com/Rial-ventures-Inc/rial-platform
  license:
    name: UNLICENSED — proprietary, internal use only
servers:
  - url: https://api.rial.io
    description: Production
security: []
tags:
  - name: Verifications
    description: >-
      Create, fetch, list, and finalize verifications. The core of the API —
      every tenant integration starts here.
  - name: Templates
    description: >-
      Publish, update, revoke and inspect link templates — the reusable capture
      links behind `/l/{token}` (a compact JWT carrying the org and template
      slugs; the legacy `/l/{org}/{slug}` keeps resolving). Callable with a
      secret key; each publish snapshots a versioned capture spec (GET-83).
  - name: Databases
    description: >-
      Create, update, inspect and synchronize tenant-scoped databases used by
      reusable verification templates. Callable with a dashboard session or
      secret API key.
  - name: Credits
    description: >-
      Prepaid photo credits at US$0.20 a photo, bought in packs by an agent with
      the card a person saved, under a monthly spend cap. While credits remain,
      Pro features are on. Callable with a dashboard session or secret API key.
paths:
  /v1/me/credits/top-ups:
    post:
      tags:
        - Credits
      summary: Buy a pack of photo credits with the saved card
      description: >-
        Buy 50, 250 or 1000 photos with the saved card, no human needed. Send an
        `Idempotency-Key` to retry safely.
      parameters:
        - schema:
            type: string
          required: false
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                photos:
                  anyOf:
                    - type: number
                      enum:
                        - 50
                    - type: number
                      enum:
                        - 250
                    - type: number
                      enum:
                        - 1000
              required:
                - photos
              additionalProperties: false
      responses:
        '200':
          description: Charged and credited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditTopUp'
        '202':
          description: Charged; the credit lands when the payment settles.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditTopUp'
        '400':
          description: >-
            `photos` is not 50, 250 or 1000, or `Idempotency-Key` is empty or
            over 200 characters.
        '401':
          description: The session or secret API key is invalid.
        '402':
          description: >-
            `spend_cap_exceeded`, `card_declined` or
            `card_requires_authentication`. Nothing was charged.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      decline_code:
                        type: string
                      month_spent_cents:
                        type: integer
                      monthly_cap_cents:
                        type: integer
                      idempotency_key:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: A person needs billing rights; a secret API key always may.
        '409':
          description: >-
            `payment_method_required`: no card saved, or the saved one is gone.
            `idempotency_key_reused`: the key belongs to a different purchase.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      decline_code:
                        type: string
                      month_spent_cents:
                        type: integer
                      monthly_cap_cents:
                        type: integer
                      idempotency_key:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '503':
          description: >-
            `payment_status_unknown`: Stripe did not answer and the card may
            have been charged; retry with the `idempotency_key` in the body,
            which charges at most once. `payments_unavailable`: nothing was
            attempted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      decline_code:
                        type: string
                      month_spent_cents:
                        type: integer
                      monthly_cap_cents:
                        type: integer
                      idempotency_key:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
      security:
        - bearerApiKey: []
components:
  schemas:
    CreditTopUp:
      type: object
      properties:
        status:
          type: string
          enum:
            - succeeded
            - processing
        photos:
          type: integer
        amount_cents:
          type: integer
        payment_id:
          type: string
        balance_cents:
          type: integer
      required:
        - status
        - photos
        - amount_cents
        - payment_id
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: rk_secret_<key>
      description: >-
        Secret API key, created in the dashboard under Settings → API. Send it
        as `Authorization: Bearer rk_secret_…` from your server only.
        Publishable keys (`pk_live_…`) are for the native SDKs and reach the
        capture endpoints alone. An unknown key returns 401.

````

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