> ## 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.

# Get a file upload URL

> First step to attach a file to the product. Returns a signed `uploadUrl` (valid for 15 minutes) to send the bytes with `PUT`, and the `objectKey` to register with `PUT /products/{productID}/deliverable`. If the environment has no file storage, the response is `503 storage_unconfigured`; use `kind: "link"` instead.




## OpenAPI

````yaml /api-reference/openapi.en.json post /products/{productID}/deliverable/presign
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:
  /products/{productID}/deliverable/presign:
    parameters:
      - $ref: '#/components/parameters/ProductID'
    post:
      tags:
        - Catalog
      summary: Get a file upload URL
      description: >
        First step to attach a file to the product. Returns a signed `uploadUrl`
        (valid for 15 minutes) to send the bytes with `PUT`, and the `objectKey`
        to register with `PUT /products/{productID}/deliverable`. If the
        environment has no file storage, the response is `503
        storage_unconfigured`; use `kind: "link"` instead.
      operationId: presignDeliverable
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresignDeliverableRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignDeliverableResponse'
          description: Upload URL and `objectKey`.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    ProductID:
      name: productID
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Product ID.
  schemas:
    PresignDeliverableRequest:
      type: object
      required:
        - fileName
        - contentType
        - sizeBytes
      properties:
        fileName:
          type: string
          description: File name, as the buyer will see it.
        contentType:
          type: string
          description: >-
            The file's MIME type (for example, `application/pdf`). Use the same
            one on the upload `PUT`.
        sizeBytes:
          type: integer
          format: int64
          description: File size in bytes.
    PresignDeliverableResponse:
      type: object
      properties:
        uploadUrl:
          type: string
          description: >-
            Signed URL to send the bytes with `PUT`, without your key. Valid for
            this file only.
        objectKey:
          type: string
          description: >-
            Identifier of the uploaded file. Pass it to `PUT
            /products/{productID}/deliverable`.
        expiresAt:
          type: string
          format: date-time
          description: When the `uploadUrl` expires (15 minutes).
    Error:
      type: object
      required:
        - message
        - error_code
        - tracer_id
      properties:
        message:
          type: string
          description: Human-readable sentence.
        error_code:
          $ref: '#/components/schemas/ErrorCode'
          description: Stable error code. Branch on it.
        tracer_id:
          type: string
          description: Request id. Include it when contacting support.
      description: >-
        The standard error body. It is flat (no `error` wrapper) and the trace
        id is `tracer_id`.
    NotFoundError:
      type: object
      required:
        - message
        - error_code
        - tracer_id
        - resource
      properties:
        message:
          type: string
        error_code:
          $ref: '#/components/schemas/ErrorCode'
        tracer_id:
          type: string
        resource:
          type: string
    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:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid API key.
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundError'
      description: Resource not found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your account's secret key: `Authorization: Bearer sk_test_…` or
        `sk_live_…`. Server-side only.

````