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

# Create a storefront

> A storefront is a public page listing products you already have in the catalog; the buyer picks what they want. The `slug` is the public address and is unique across Infi: one already taken returns 409.




## OpenAPI

````yaml /api-reference/openapi.en.json post /storefronts
openapi: 3.1.0
info:
  title: Infi API
  version: 0.0.1
  description: >
    The Infi REST API: catalog, customers, usage metering, subscriptions,

    invoices, payments and checkout.


    **Authentication.** Send your secret key as `Authorization: Bearer
    sk_test_…`

    (sandbox) or `sk_live_…` (production). The key prefix selects the
    environment.

    Checkout routes (`/pay/*`) and `/public/*` take no key: they run in the

    payer's browser.


    **Idempotency.** Every request that changes data requires an

    `Idempotency-Key` header. A retry with the same key returns the original

    response instead of running again.


    **Amounts.** Money and quantities travel as decimal strings (`"150.00"`,

    `"0.0001"`), never as floating-point numbers.


    **Errors.** The body carries `error_code` (stable, branch on it), `message`

    (for humans) and `tracer_id` (send it to support). Rate-limit and
    idempotency

    errors are nested under `error`, with `code` and `request_id`.
servers:
  - url: https://api-sandbox.beinfi.com
    description: Sandbox
  - url: https://api.beinfi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Catalog
  - name: Customers
  - name: Metering
  - name: Subscriptions
  - name: Invoices
  - name: Payments
  - name: Checkout
  - name: Coupons
  - name: Billing
  - name: Account
  - name: Webhooks
  - name: Test account
  - name: Rail
  - name: Storefronts
paths:
  /storefronts:
    post:
      tags:
        - Storefronts
      summary: Create a storefront
      description: >
        A storefront is a public page listing products you already have in the
        catalog; the buyer picks what they want. The `slug` is the public
        address and is unique across Infi: one already taken returns 409.
      operationId: createStorefront
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StorefrontWrite'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Storefront'
          description: The created storefront.
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationFailed'
components:
  schemas:
    StorefrontWrite:
      type: object
      properties:
        name:
          type: string
        slug:
          type: string
          description: >-
            The public address, 3–40 characters: lowercase letters, digits and
            single dashes. Unique across Infi and not a reserved word.
        description:
          type: string
          nullable: true
        logoObjectKey:
          type: string
          nullable: true
          description: Logo image key, from `POST /catalog/images/presign`.
        bannerObjectKey:
          type: string
          nullable: true
          description: Banner image key, from `POST /catalog/images/presign`.
        theme:
          $ref: '#/components/schemas/StorefrontTheme'
        status:
          type: string
          enum:
            - active
            - disabled
          description: >-
            `disabled` takes the shop offline immediately; `active` brings it
            back.
        fulfillmentMode:
          type: string
          enum:
            - pickup
            - shipping
            - both
          description: >-
            How the buyer receives what they bought. A `pickup` shop never asks
            for an address; `both` lets the buyer choose at checkout.
        pickupNote:
          type: string
          nullable: true
          description: Pickup instructions shown to the buyer.
        shippingFlatAmount:
          type: string
          nullable: true
          description: >-
            Flat shipping, as a decimal string. `"0"` is free; `null` means
            arranged separately. Refused on a pickup-only shop.
        requireAddress:
          type: boolean
          description: >-
            Collects an address even for pickup, for example to put it on the
            nota fiscal.
      description: >-
        Fields to create or update a storefront. On `PATCH` all are optional and
        omitted ones do not change. On `logoObjectKey` and `bannerObjectKey`,
        `""` removes the image.
    Storefront:
      type: object
      required:
        - id
        - slug
        - name
        - theme
        - status
        - fulfillmentMode
        - requireAddress
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
          description: The shop's public address.
        name:
          type: string
        description:
          type: string
          nullable: true
        logoUrl:
          type: string
          nullable: true
          description: Logo image address. `logoObjectKey` carries the matching key.
        logoObjectKey:
          type: string
          nullable: true
          description: Logo image key, from `POST /catalog/images/presign`.
        bannerUrl:
          type: string
          nullable: true
          description: Banner image address.
        bannerObjectKey:
          type: string
          nullable: true
          description: Banner image key, from `POST /catalog/images/presign`.
        theme:
          $ref: '#/components/schemas/StorefrontTheme'
        status:
          type: string
          enum:
            - active
            - disabled
          description: '`active` (live) or `disabled` (offline).'
        fulfillmentMode:
          type: string
          enum:
            - pickup
            - shipping
            - both
          description: 'How the buyer receives: `pickup`, `shipping` or `both`.'
        pickupNote:
          type: string
          nullable: true
          description: Pickup instructions shown to the buyer.
        shippingFlatAmount:
          type: string
          nullable: true
          description: >-
            Flat shipping, as a decimal string. `"0"` is free; `null` means
            arranged separately.
        requireAddress:
          type: boolean
          description: Whether an address is collected even for pickup.
        createdAt:
          type: string
          format: date-time
      description: A storefront in your account.
    StorefrontTheme:
      type: object
      properties:
        accent:
          type: string
          enum:
            - purple
            - teal
            - amber
            - rose
            - blue
            - green
            - brown
            - slate
          description: Accent colour.
        mode:
          type: string
          enum:
            - light
            - dark
          description: Light (`light`) or dark (`dark`) theme.
        layout:
          type: string
          enum:
            - grid
            - list
          description: Products as a grid (`grid`) or a list (`list`).
        whatsapp:
          type: string
          description: Contact WhatsApp shown on the shop.
        instagram:
          type: string
          description: Instagram shown on the shop.
      description: The shop's look, chosen from a fixed set of options.
    ConflictError:
      type: object
      required:
        - message
        - error_code
        - tracer_id
        - resource
        - metadata
      properties:
        message:
          type: string
          description: Human-readable explanation.
        error_code:
          $ref: '#/components/schemas/ErrorCode'
          description: Stable error code. Branch on this field.
        tracer_id:
          type: string
          description: Request identifier. Send it to support.
        resource:
          type: string
          description: The kind of resource in conflict. Empty string when not applicable.
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          description: Conflict details, as key-value pairs. `null` when there are none.
      description: 'Body of a 409 error: the resource''s state does not allow the operation.'
    RequestError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              $ref: '#/components/schemas/ErrorCode'
            message:
              type: string
            request_id:
              type: string
    ValidationError:
      type: object
      required:
        - message
        - error_code
        - tracer_id
        - errors
      properties:
        message:
          type: string
        error_code:
          $ref: '#/components/schemas/ErrorCode'
        tracer_id:
          type: string
        errors:
          type: array
          items:
            type: object
            required:
              - field
              - value
              - constraint
              - description
            properties:
              field:
                type: string
              value:
                type: string
              constraint:
                type: string
              description:
                type: string
          description: >-
            Per-field detail (`field`, `description`). Always present on a
            `422`; may be empty.
      description: >-
        Body of a `422`. Same shape as `Error`, plus `errors[]` with per-field
        detail. That is where the sentence telling you what to fix lives (for
        example, "product has no published version").
    ErrorCode:
      type: string
      examples:
        - internal_error
        - validation_failed
        - bad_request
        - unauthorized
        - forbidden
        - not_found
        - conflict
        - rate_limited
      description: >-
        Stable error code. The list is open: besides the generic codes, each
        area defines its own (`coupon_expired`, `insufficient_balance`,
        `version_not_draft`, `idempotency_key_reused`…). Handle a code you do
        not recognize by its HTTP status and show `message`; do not fail parsing
        the response.
  responses:
    Conflict:
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ConflictError'
              - $ref: '#/components/schemas/RequestError'
      description: >-
        The resource's state does not allow the operation, or the
        `Idempotency-Key` was already used with a different body.
    ValidationFailed:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
      description: One or more fields are invalid. Per-field detail is in `errors[]`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your account's secret key: `Authorization: Bearer sk_test_…` or
        `sk_live_…`. Server-side only.

````