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

> ## Agent Instructions
> Money is always a decimal string at the currency's precision (for example "29.00"), paired with an ISO 4217 currency field. Never use minor units.
> Build against the sandbox first: base URL https://sandbox-api.bachs.io with sk_sandbox_ keys. Production is https://api.bachs.io with sk_live_ keys; going live is a key swap.
> Treat webhooks (for example collection.succeeded) as the source of truth for fulfilment, never client-side events or redirects.
> Subscriptions are created by completing a checkout for a recurring product. There is no direct create-subscription endpoint.
> IDs carry resource prefixes (cust_, prod_, sub_, chk_, inv_, ref_) and timestamps are ISO 8601 UTC.

# Archive a product

> Archives a product so it can no longer be used in new checkouts or subscriptions. Existing subscriptions keep billing. This is idempotent: archiving an already-archived product succeeds. Reverse it with [Unarchive Product](/api-reference/products/unarchive-product). Requires the `products:write` scope.



## OpenAPI

````yaml /docs/openapi/openapi.json post /v1/products/{product_id}/archive
openapi: 3.0.3
info:
  title: Bachs API
  version: 1.0.0
  description: >-
    The Bachs API lets you accept payments, manage subscriptions, and move money
    across African markets.


    - **Authentication:** pass your secret key as `Authorization: Bearer
    sk_...`. See [Authentication](/authentication) for keys, scopes, and sandbox
    vs production.

    - **Errors:** errors use `detail` and `error_code`; `doc_url` and
    field-level `errors` are optional. See [Errors](/errors).

    - **Pagination:** list endpoints return `{ items, pagination }`. See
    [Pagination](/guides/pagination).

    - **Idempotency:** use `Idempotency-Key` on public `POST` and `PATCH`;
    reconcile uncertain write outcomes before retrying. See
    [Idempotency](/guides/idempotency).

    - **Base URLs and rate limits:** see the
    [Introduction](/api-reference/overview).
  contact:
    name: Bachs Support
    url: https://bachs.io
servers:
  - url: https://api.bachs.io
    description: Production
  - url: https://sandbox-api.bachs.io
    description: Sandbox
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Accept payments from customers
  - name: Refunds
    description: Create and manage customer refunds
  - name: Disputes
    description: Respond to chargebacks and manage dispute evidence
  - name: Balances
    description: View balances and account information
  - name: Conversions
    description: Quote, execute, and query currency conversions
  - name: Payouts
    description: Withdraw funds to external accounts
  - name: Webhooks
    description: Receive real-time payment notifications
  - name: Authentication
    description: API key management and authentication
  - name: Customers
    description: Create and manage customers
  - name: Products
    description: Define and manage your billing catalog
  - name: Product Groups
    description: Bundle products for multi-plan checkout
  - name: Media
    description: Upload files and get an upload_id to attach to products
  - name: Checkouts
    description: Create and manage API-driven checkouts without products
  - name: Subscriptions
    description: >-
      Recurring billing. Subscriptions are created through checkout; manage them
      here.
  - name: Customer sessions
    description: >-
      Open a hosted portal session so a customer can manage their own
      subscriptions, invoices and cards.
  - name: Accounts
    description: >-
      Create the accounts your platform onboards, request their capabilities,
      walk them through their requirements, and read what they still owe.
  - name: Transfers
    description: Move funds between your platform and the accounts you own.
  - name: Platform Fees
    description: Read the platform's cut of an account's sale.
  - name: Virtual Accounts
    description: Create and read fixed bank account numbers for receiving deposits.
  - name: Files
paths:
  /v1/products/{product_id}/archive:
    post:
      tags:
        - Products
      summary: Archive a product
      description: >-
        Archives a product so it can no longer be used in new checkouts or
        subscriptions. Existing subscriptions keep billing. This is idempotent:
        archiving an already-archived product succeeds. Reverse it with
        [Unarchive Product](/api-reference/products/unarchive-product). Requires
        the `products:write` scope.
      operationId: archiveProduct
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Product archived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
              example:
                id: prod_1a2b3c4d5e6f7g8h
                organization_id: acct_7KpQ2mNv4XbR9dLc
                name: Pro Plan
                description: Full access, billed monthly.
                price:
                  currency: USD
                  price_type: fixed
                  amount: '29.00'
                  preset_amount: null
                  minimum_amount: null
                  maximum_amount: null
                  currency_options: []
                prices:
                  - currency: USD
                    amount: '29.00'
                    minimum_amount: null
                    maximum_amount: null
                    is_default: true
                billing_cycle:
                  interval: month
                  frequency: 1
                trial_period: null
                status: archived
                metadata:
                  tier: pro
                media: []
                actor_id: usr_abc123
                total_payments: 0
                total_amount: '0.00'
                created_at: '2026-07-13T14:00:00.000Z'
                updated_at: '2026-07-13T14:00:00.000Z'
                archived_at: '2026-07-13T14:30:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ProductResponse:
      type: object
      properties:
        id:
          type: string
          example: prod_1a2b3c4d5e6f
          description: Unique identifier for the product, prefixed with `prod_`.
        organization_id:
          type: string
          description: The account that owns the product.
          example: acct_7KpQ2mNv4XbR9dLc
        name:
          type: string
          description: Display name of the product.
          example: Pro Plan
        description:
          type: string
          nullable: true
          description: Optional description of the product. `null` when not set.
          example: Monthly access to all Pro features.
        price:
          $ref: '#/components/schemas/PriceResponse'
          description: Primary price for the product, in the product's default currency.
          example:
            price_type: fixed
            currency: USD
            amount: '29.00'
        status:
          type: string
          enum:
            - active
            - archived
          description: >-
            Status of the product. `active`: Live and available for use in
            checkouts and subscriptions. `archived`: Retired. Kept for reference
            but not available for new purchases.
          example: active
        metadata:
          type: object
          nullable: true
          description: Your own key-value data attached to the product, returned unchanged.
          example:
            order_id: ORD-9876
            tier: pro
        media:
          type: array
          items:
            $ref: '#/components/schemas/MediaItemResponse'
          description: >-
            Media items (images) attached to the product. Empty when none are
            set.
        actor_id:
          type: string
          description: Identifier of the user or key that created the product.
          example: usr_abc123
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the product was created.
          example: '2026-07-13T14:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the product was last updated.
          example: '2026-07-13T14:00:00.000Z'
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When set, the product is archived and cannot be used in new
            checkouts. `null` while the product is active.
          example: null
        billing_cycle:
          allOf:
            - $ref: '#/components/schemas/SubscriptionCadence'
          nullable: true
          description: >-
            How often the product bills. Provide a cadence to make the product
            recurring, or omit it for a one-time product.
        trial_period:
          allOf:
            - $ref: '#/components/schemas/TrialPeriod'
          nullable: true
          description: >-
            A free trial before the first charge, given as a duration like `{
            "interval": "day", "frequency": 14 }` for 14 days. The customer
            isn't charged until the trial ends. Only valid on a recurring
            product.
        prices:
          type: array
          description: >-
            All prices configured on the product, one per currency. Each has
            `currency`, `amount`, optional `minimum_amount` and
            `maximum_amount`, and `is_default`.
          items:
            type: object
        total_payments:
          type: integer
          description: >-
            Running count of completed payments for this product. Starts at `0`
            and increments as customers pay.
          example: 0
        total_amount:
          type: string
          description: >-
            Running total collected for this product, as a decimal string in the
            product currency. Starts at `"0.00"`.
          example: '0.00'
    PriceResponse:
      type: object
      properties:
        currency:
          type: string
          example: USD
        price_type:
          type: string
          enum:
            - fixed
            - free
            - custom
          description: >-
            How the product is priced. `fixed`: a set amount, given in `amount`.
            `free`: no charge. `custom`: the customer pays what they want,
            bounded by `minimum_amount` and `maximum_amount` with an optional
            `preset_amount` suggestion.
          example: fixed
        amount:
          type: string
          example: '29.00'
          description: Price in the primary currency as a decimal string.
        preset_amount:
          type: string
          nullable: true
          description: >-
            Suggested amount prefilled at checkout for a custom price, as a
            decimal string. Only used when `price_type` is `custom`.
          example: '15.00'
        minimum_amount:
          type: string
          example: '5.00'
          nullable: true
          description: >-
            Minimum the customer must pay. Present only when `price_type` is
            `custom`.
        maximum_amount:
          type: string
          example: '500.00'
          nullable: true
          description: >-
            Maximum the customer may pay. Present only when `price_type` is
            `custom`.
        currency_options:
          type: array
          items:
            $ref: '#/components/schemas/CurrencyOptionResponse'
    MediaItemResponse:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
          nullable: true
        file_name:
          type: string
        mime_type:
          type: string
        file_size_bytes:
          type: integer
        created_at:
          type: string
          format: date-time
    SubscriptionCadence:
      type: object
      properties:
        interval:
          type: string
          enum:
            - day
            - week
            - month
            - year
          description: >-
            Unit of time for each billing cycle. `day`: billed daily. `week`:
            billed weekly. `month`: billed monthly. `year`: billed yearly.
          example: month
        frequency:
          type: integer
          description: >-
            Number of intervals per cycle. For example, `interval` `month` with
            `frequency` `3` bills every three months.
          example: 1
    TrialPeriod:
      type: object
      description: >-
        The length of the free trial before the first charge, expressed as a
        count of time units. For example, `{ "interval": "day", "frequency": 14
        }` is a 14-day trial.
      properties:
        interval:
          type: string
          enum:
            - day
            - week
            - month
            - year
          description: >-
            The unit of time the trial is measured in: `day`, `week`, `month`,
            or `year`.
          example: day
        frequency:
          type: integer
          description: >-
            How many `interval` units the trial lasts. For example, `interval`
            `day` with `frequency` `14` is a 14-day trial.
          example: 14
      required:
        - interval
        - frequency
    Error:
      type: object
      description: Standard error response format used across all API endpoints
      properties:
        detail:
          type: string
          description: Human-readable error message explaining what went wrong.
          example: Invalid request parameters
        error_code:
          type: string
          description: >-
            Machine-readable error code. Use this to handle errors
            programmatically. Common codes: VALIDATION_ERROR, UNAUTHORIZED,
            FORBIDDEN, NOT_FOUND, CONFLICT, TOO_MANY_REQUESTS,
            INTERNAL_SERVER_ERROR, BAD_GATEWAY, SERVICE_UNAVAILABLE.
          example: VALIDATION_ERROR
        errors:
          type: array
          description: >-
            Optional field-level details on some validation errors. Other
            validation responses contain only detail and error_code. Entry
            fields depend on the validation source.
          items:
            type: object
            properties:
              field:
                type: string
                description: The field that failed validation.
                example: amount
              message:
                type: string
                description: Description of the validation failure.
                example: Amount must be a positive decimal string
              type:
                type: string
                description: Error type identifier.
                example: value_error
              code:
                type: string
                description: >-
                  Optional requirement-field rejection code. Some validation
                  entries provide code instead of type.
                example: currency_not_supported
            required:
              - field
              - message
        doc_url:
          type: string
          description: Optional link to documentation for this error; some errors omit it.
          example: https://docs.bachs.io/api-reference/error-reference#general
      required:
        - detail
        - error_code
    CurrencyOptionResponse:
      type: object
      properties:
        currency:
          type: string
          example: GHS
        amount:
          type: string
          example: '35.00'
        minimum_amount:
          type: string
          example: '5.00'
          nullable: true
        maximum_amount:
          type: string
          example: '500.00'
          nullable: true
  responses:
    Unauthorized:
      description: >-
        Unauthorized - Invalid, missing, or expired API key. Verify your API key
        is correctly formatted and included in the Authorization header as
        `Bearer sk_sandbox_...` or `Bearer sk_live_...`. Check that your key
        hasn't been revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Invalid API key
            error_code: UNAUTHORIZED
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window
          schema:
            type: integer
            example: 95
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
    Forbidden:
      description: >-
        Forbidden - API key does not have permission for the requested resource.
        Verify you're using the correct account's API key and that you're not
        trying to access another account's data.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: API key does not have permission for this operation
            error_code: FORBIDDEN
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window
          schema:
            type: integer
            example: 95
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
    NotFound:
      description: >-
        Not Found - The requested resource does not exist. Verify the resource
        ID is correct and that it belongs to your account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Resource not found
            error_code: NOT_FOUND
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current window
          schema:
            type: integer
            example: 95
        X-RateLimit-Reset:
          description: Unix timestamp when the rate limit window resets
          schema:
            type: integer
            example: 1706102400
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Bearer token authentication. Pass your API key as `Authorization: Bearer
        sk_...`. See [Authentication](/authentication) for keys, scopes, and
        sandbox vs production.

````

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