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

# Create a bill

> Create a bill as a `draft`. Only the line items are required.



## OpenAPI

````yaml /openapi-v2.json post /v2/bills
openapi: 3.1.0
info:
  title: Slash Public API V2
  description: >-
    Send money for a Slash legal entity. Every request uses an API key. Transfer
    creation returns a Transfer that links its resulting transactions.
  version: 0.0.1
servers:
  - url: https://api.slash.com
    description: production
security:
  - api_key: []
paths:
  /v2/bills:
    parameters:
      - name: x-legal-entity
        in: header
        required: true
        description: >-
          The legal entity to act on. Required on every request; a user API key
          can act on any legal entity its user has access to.
        schema:
          type: string
          pattern: ^le_[a-zA-Z0-9]+$
    post:
      summary: Create a bill
      description: Create a bill as a `draft`. Only the line items are required.
      parameters:
        - name: X-Idempotency-Key
          in: header
          required: true
          description: >-
            Unique caller-generated key for one create request. Once an
            authenticated, schema-valid request reaches the operation, the key
            is permanently consumed for that operation and legal entity whether
            the operation succeeds or fails. Reusing it in that scope returns
            `409` and never replays a response, unlike API v1, which replays the
            original response for a matching key.
          schema:
            type: string
            minLength: 1
            maxLength: 255
          example: invoice-1042-attempt-1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bill-create'
            example:
              vendorContactId: le_c_2rj4l7hmrrrcv
              destinationId: le_contact_destination_2rj4l7hmrrrcv
              invoiceNumber: INV-4471
              invoiceDate: '2026-09-01'
              dueDate: '2026-10-01'
              lineItems:
                - name: Hosting
                  quantity: 1
                  unitAmount:
                    amount: 120000
                    currency: USD
                - name: Support hours
                  quantity: 2.5
                  unitAmount:
                    amount: 15000
                    currency: USD
              tax:
                amount: 9800
                currency: USD
              documentIds:
                - st_2rj4l7hmrrrcv
              notes: September hosting
      responses:
        '200':
          description: The created bill.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bill'
              example:
                id: bill_2rj4l7hmrrrcv
                status: draft
                source: api
                vendorContactId: le_c_2rj4l7hmrrrcv
                destinationId: le_contact_destination_2rj4l7hmrrrcv
                ownerUserId: u_2rj4l7hmrrrcv
                invoiceNumber: INV-4471
                invoiceDate: '2026-09-01'
                dueDate: '2026-10-01'
                currency: USD
                amounts:
                  total:
                    amount: 167300
                    currency: USD
                  tax:
                    amount: 9800
                    currency: USD
                  discount:
                    amount: 0
                    currency: USD
                  outstanding:
                    amount: 167300
                    currency: USD
                lineItems:
                  - id: bill_line_item_2rj4l7hmrrrcv
                    name: Hosting
                    quantity: 1
                    unitAmount:
                      amount: 120000
                      currency: USD
                    total:
                      amount: 120000
                      currency: USD
                  - id: bill_line_item_3sk5m8inssscw
                    name: Support hours
                    quantity: 2.5
                    unitAmount:
                      amount: 15000
                      currency: USD
                    total:
                      amount: 37500
                      currency: USD
                documentIds:
                  - st_2rj4l7hmrrrcv
                payments: []
                notes: September hosting
                createdAt: '2026-09-19T14:05:22.000Z'
        '400':
          $ref: '#/components/responses/PublicApiV2Error400BillsCreate'
        '401':
          $ref: '#/components/responses/PublicApiV2Error401Unauthorized'
        '403':
          $ref: '#/components/responses/PublicApiV2Error403BillsCreate'
        '404':
          $ref: '#/components/responses/PublicApiV2Error404BillsCreate'
        '409':
          $ref: >-
            #/components/responses/PublicApiV2Error409ConflictIdempotencyKeyReused
        '429':
          $ref: '#/components/responses/PublicApiV2RateLimited'
        '500':
          $ref: '#/components/responses/PublicApiV2Error500Internal'
      security:
        - api_key: []
components:
  schemas:
    bill-create:
      title: BillCreate
      description: A new bill in `draft`. Every money field must use the same currency.
      type: object
      properties:
        vendorContactId:
          type: string
          description: >-
            The vendor: any contact on the legal entity that isn't archived,
            usually one with `recipientType: vendor`. Create one with `POST
            /v2/contacts`.
          example: le_c_2rj4l7hmrrrcv
        destinationId:
          type: string
          description: >-
            The destination the bill should be paid to. Must belong to
            `vendorContactId` when both are given.
          example: le_contact_destination_2rj4l7hmrrrcv
        ownerUserId:
          type: string
          description: >-
            The user responsible for the bill. Defaults to the user behind the
            API key.
          example: u_2rj4l7hmrrrcv
        invoiceNumber:
          type: string
          maxLength: 255
          description: The vendor's invoice number.
          example: INV-4471
        invoiceDate:
          type: string
          format: date
          description: Invoice date as `YYYY-MM-DD`.
          example: '2026-09-01'
        dueDate:
          type: string
          format: date
          description: Due date as `YYYY-MM-DD`.
          example: '2026-10-01'
        lineItems:
          type: array
          minItems: 1
          description: >-
            At least one line. The bill's currency is the lines' currency, and
            the total is the sum of line totals plus `tax` minus `discount`.
          items:
            $ref: '#/components/schemas/bill-line-item-create'
        tax:
          type: object
          description: Tax added to the line totals, in the bill's currency.
          properties:
            amount:
              type: integer
              minimum: 0
              description: Amount in the currency's minor units.
              example: 800
            currency:
              type: string
              pattern: ^[A-Z]{3}$
              description: Uppercase ISO 4217 currency code.
              example: USD
          required:
            - amount
            - currency
          additionalProperties: false
        discount:
          type: object
          description: Discount taken off the line totals, in the bill's currency.
          properties:
            amount:
              type: integer
              minimum: 0
              description: Amount in the currency's minor units.
              example: 500
            currency:
              type: string
              pattern: ^[A-Z]{3}$
              description: Uppercase ISO 4217 currency code.
              example: USD
          required:
            - amount
            - currency
          additionalProperties: false
        documentIds:
          type: array
          maxItems: 20
          description: Documents uploaded with purpose `bill_invoice`.
          items:
            type: string
            example: st_2rj4l7hmrrrcv
        notes:
          type: string
          maxLength: 5000
          description: Free-text notes visible to your organization.
      required:
        - lineItems
      additionalProperties: false
    bill:
      title: Bill
      description: >-
        Money your legal entity owes a vendor. `status` and
        `amounts.outstanding` are derived from the bill's payments and cannot be
        set directly.
      type: object
      properties:
        id:
          type: string
          description: Bill id with the `bill_` prefix.
          example: bill_2rj4l7hmrrrcv
        status:
          type: string
          description: >-
            Derived from the bill's payments. `draft` until a payment exists;
            `pending_approval` while a payment awaits approval; `rejected` when
            the latest approval was rejected; `scheduled` when a payment is
            scheduled; `payment_pending` while a payment is in flight;
            `partially_paid` when settled payments cover part of the total;
            `paid` when they cover all of it; `payment_failed` when the latest
            payment failed or was returned.
          enum:
            - draft
            - pending_approval
            - rejected
            - scheduled
            - payment_pending
            - paid
            - payment_failed
            - partially_paid
        source:
          type: string
          description: >-
            How the bill entered Slash. `api` for bills created through this
            API, `manual` for the dashboard, `email` for the accounts-payable
            inbox, `carrier_account` for bills pulled from a connected carrier
            portal. Carrier bills are read-only over the API.
          enum:
            - manual
            - email
            - carrier_account
            - api
        vendorContactId:
          type: string
          description: The vendor contact, readable at `GET /v2/contacts/{contactId}`.
          example: le_c_2rj4l7hmrrrcv
        destinationId:
          type: string
          description: >-
            The destination the bill is expected to be paid to, readable at `GET
            /v2/destinations/{destinationId}`.
          example: le_contact_destination_2rj4l7hmrrrcv
        ownerUserId:
          type: string
          description: >-
            The user responsible for the bill. Absent for bills that arrived by
            email and have not been assigned.
          example: u_2rj4l7hmrrrcv
        invoiceNumber:
          type: string
          description: The vendor's invoice number.
          example: INV-4471
        invoiceDate:
          type: string
          format: date
          description: Invoice date as `YYYY-MM-DD`.
          example: '2026-09-01'
        dueDate:
          type: string
          format: date
          description: Due date as `YYYY-MM-DD`.
          example: '2026-10-01'
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: Uppercase ISO 4217 currency code shared by every amount on the bill.
          example: USD
        amounts:
          type: object
          description: Every amount is in `currency`, in minor units.
          properties:
            total:
              $ref: '#/components/schemas/Money'
            tax:
              $ref: '#/components/schemas/Money'
            discount:
              $ref: '#/components/schemas/Money'
            outstanding:
              $ref: '#/components/schemas/Money'
          required:
            - total
            - tax
            - discount
            - outstanding
          additionalProperties: false
        lineItems:
          type: array
          description: Line items in display order.
          items:
            $ref: '#/components/schemas/bill-line-item'
        documentIds:
          type: array
          description: >-
            Documents attached to the bill, readable at `GET
            /v2/documents/{documentId}`.
          items:
            type: string
            example: st_2rj4l7hmrrrcv
        payments:
          type: array
          description: Payments linked to the bill, oldest first.
          items:
            $ref: '#/components/schemas/bill-payment'
        notes:
          type: string
          description: Free-text notes visible to your organization.
        createdAt:
          type: string
          format: date-time
          description: When the bill was created.
      required:
        - id
        - status
        - source
        - currency
        - amounts
        - lineItems
        - documentIds
        - payments
        - createdAt
      additionalProperties: false
    bill-line-item-create:
      title: BillLineItemCreate
      description: One line of a new bill.
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: What the line is for.
          example: Hosting
        quantity:
          type: number
          exclusiveMinimum: 0
          description: >-
            Number of units greater than zero. Fractional quantities are
            allowed.
          example: 1
        unitAmount:
          $ref: '#/components/schemas/Money'
      required:
        - name
        - quantity
        - unitAmount
      additionalProperties: false
    Money:
      type: object
      description: A signed monetary amount expressed in minor units.
      properties:
        amount:
          type: integer
          description: Amount in the currency's minor units.
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: Uppercase ISO 4217 currency code.
      required:
        - amount
        - currency
      additionalProperties: false
      title: Money
    bill-line-item:
      title: BillLineItem
      description: >-
        One line of a bill. `total` is `unitAmount` × `quantity`, rounded to
        minor units.
      type: object
      properties:
        id:
          type: string
          description: Line item id with the `bill_line_item_` prefix.
          example: bill_line_item_2rj4l7hmrrrcv
        name:
          type: string
          description: What the line is for, as printed on the invoice.
          example: Hosting
        quantity:
          type: number
          description: Number of units. Fractional quantities are allowed.
          example: 1
        unitAmount:
          $ref: '#/components/schemas/Money'
        total:
          $ref: '#/components/schemas/Money'
      required:
        - id
        - name
        - quantity
        - unitAmount
        - total
      additionalProperties: false
    bill-payment:
      title: BillPayment
      description: >-
        A payment linked to a bill. State lives on the underlying transfer and
        transaction; this is the bill's view of it. A payment is listed once its
        transfer or card purchase has produced a transaction (including an
        approval request or a scheduled payment). `status` and `detailedStatus`
        are that transaction's, as `GET /v2/transactions/{transactionId}`
        reports them.
      type: object
      properties:
        id:
          type: string
          description: >-
            Payment link id with the `bill_payment_` prefix. Unlink the payment
            with `DELETE /v2/bills/{billId}/payments/{paymentId}`.
          example: bill_payment_2rj4l7hmrrrcv
        transferId:
          type: string
          description: >-
            Id of the transfer that pays the bill, with the `transfer_intent_`
            prefix, readable at `GET /v2/transfers/{transferId}`. Absent for
            payments that are not yet a transfer (a scheduled payment whose
            transfer has not been constructed) or that were made outside the
            transfer rails.
          example: transfer_intent_2rj4l7hmrrrcv
        transactionId:
          type: string
          description: >-
            Id of the transaction that moved the money, with the `agg_tx_`
            prefix, readable at `GET /v2/transactions/{transactionId}`. For a
            card purchase it's the card transaction. Absent when the payment's
            only transactions are ones the transactions API doesn't return, such
            as a rejected or canceled approval request.
          example: agg_tx_2rj4l7hmrrrcv
        status:
          $ref: >-
            #/components/schemas/slashfi.models.entity.PublicApiV2.Transaction.Status.yaml
        detailedStatus:
          $ref: >-
            #/components/schemas/slashfi.models.entity.PublicApiV2.Transaction.DetailedStatus.yaml
        amount:
          $ref: '#/components/schemas/Money'
        createdAt:
          type: string
          format: date-time
          description: When the payment was linked to the bill.
      required:
        - id
        - status
        - detailedStatus
        - amount
        - createdAt
      additionalProperties: false
    PublicApiV2ErrorBillCurrencyMismatch:
      title: PublicApiV2ErrorBillCurrencyMismatch
      description: Every amount on a bill must be in the bill’s `currency`.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - bill_currency_mismatch
            details:
              type: object
              properties:
                currency:
                  type: string
                  description: The bill’s currency.
                  example: USD
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - currency
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorDestinationNotVendors:
      title: PublicApiV2ErrorDestinationNotVendors
      description: The destination belongs to a different contact than the bill’s vendor.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - destination_not_vendors
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorDocumentPurposeMismatch:
      title: PublicApiV2ErrorDocumentPurposeMismatch
      description: The document was uploaded with a different `purpose`.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - document_purpose_mismatch
            details:
              type: object
              properties:
                expected:
                  type: string
                  description: The `purpose` this field takes.
                  example: bill_invoice
                purpose:
                  type: string
                  description: The document’s `purpose`.
                  example: accounting_receipt
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - expected
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorInvalidRequestShape:
      title: PublicApiV2ErrorInvalidRequestShape
      description: >-
        The body, query, or headers failed validation, or a required header is
        missing. `details` has one entry per failing location, keyed by JSON
        pointer or header name.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - invalid_request
            details:
              type: object
              properties: {}
              additionalProperties:
                type: string
          required:
            - code
            - details
    PublicApiV2ErrorUnauthorized:
      title: PublicApiV2ErrorUnauthorized
      description: API key authentication is missing or invalid.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorBillOwnerNotAllowed:
      title: PublicApiV2ErrorBillOwnerNotAllowed
      description: This API key can only create and keep bills owned by its own user.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - bill_owner_not_allowed
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbidden:
      title: PublicApiV2ErrorForbidden
      description: >-
        The credential is not permitted to perform this action on the resource.
        When the resource is a field of the request, `details` names that
        `field` and the `id` it received.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbiddenLegalEntity:
      title: PublicApiV2ErrorForbiddenLegalEntity
      description: The credential is not permitted to act for the selected legal entity.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotAvailable:
      title: PublicApiV2ErrorNotAvailable
      description: >-
        Public API v2 is not yet available. Use [Public API
        v1](https://docs.slash.com/introduction) in the meantime.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_available
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorUserApiKeyRequired:
      title: PublicApiV2ErrorUserApiKeyRequired
      description: >-
        The API key is scoped to a legal entity rather than a user. Every v2
        request needs a user API key, created under Settings → API keys in the
        Slash dashboard, together with the `x-legal-entity` header.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - user_api_key_required
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotFound:
      title: PublicApiV2ErrorNotFound
      description: >-
        No resource matches the identifier. When the identifier is a field of
        the request, `details` names that `field` and the `id` it received.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorConflictIdempotencyKeyReused:
      title: PublicApiV2ErrorConflictIdempotencyKeyReused
      description: >-
        A consumed `X-Idempotency-Key` was reused; the original response is not
        replayed.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - conflict
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorInternal:
      title: PublicApiV2ErrorInternal
      description: >-
        Slash could not complete the request. Quote `referenceId` when
        contacting Slash support.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - internal
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    slashfi.models.entity.PublicApiV2.Transaction.Status.yaml:
      type: string
      description: Coarse transaction state.
      enum:
        - pending
        - posted
        - failed
      title: Status
    slashfi.models.entity.PublicApiV2.Transaction.DetailedStatus.yaml:
      type: string
      description: Exact transaction lifecycle state across every category.
      enum:
        - pending
        - pending_destination
        - pending_approval
        - in_review
        - scheduled
        - canceled
        - failed
        - settled
        - declined
        - refund
        - reversed
        - returned
        - dispute
      title: DetailedStatus
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            Machine-readable reason; branch on this, not on `message`. Every
            code an endpoint can return is listed on its reference page; the
            ones shared by all endpoints are explained in the Errors guide.
          example: invalid_request
        message:
          type: string
          description: >-
            Human-readable explanation, safe to show to an operator. Wording may
            change; use `code` and `details` programmatically.
        details:
          type: object
          description: >-
            The values behind `message`, keyed per `code`. For example
            `insufficient_funds` carries `available` and `requested`;
            `invalid_request` from contract validation carries one entry per
            failing field, keyed by JSON pointer. Empty when the code has no
            variable data.
          additionalProperties:
            type: string
          example:
            available: $120.00
            requested: $500.00
        referenceId:
          type: string
          description: Unique id of this failure. Quote it when contacting Slash support.
          example: 4001-2alj5if
      required:
        - code
        - message
        - details
        - referenceId
      additionalProperties: false
      title: Error
  responses:
    PublicApiV2Error400BillsCreate:
      description: >-
        - `bill_currency_mismatch` — Every amount on a bill must be in the
        bill’s `currency`.

        - `destination_not_vendors` — The destination belongs to a different
        contact than the bill’s vendor.

        - `document_purpose_mismatch` — The document was uploaded with a
        different `purpose`.

        - `invalid_request (request shape)` — The body, query, or headers failed
        validation, or a required header is missing. `details` has one entry per
        failing location, keyed by JSON pointer or header name.
      content:
        application/json:
          schema:
            anyOf:
              - title: bill_currency_mismatch
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorBillCurrencyMismatch'
              - title: destination_not_vendors
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorDestinationNotVendors'
              - title: document_purpose_mismatch
                allOf:
                  - $ref: >-
                      #/components/schemas/PublicApiV2ErrorDocumentPurposeMismatch
              - title: invalid_request (request shape)
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorInvalidRequestShape'
          examples:
            bill_currency_mismatch_line_items:
              summary: bill_currency_mismatch (lineItems)
              value:
                code: bill_currency_mismatch
                message: Every amount must be in the bill’s currency, USD.
                details:
                  currency: USD
                  field: lineItems
                referenceId: 4001-2alj5if
            bill_currency_mismatch_tax_currency:
              summary: bill_currency_mismatch (tax.currency)
              value:
                code: bill_currency_mismatch
                message: Every amount must be in the bill’s currency, USD.
                details:
                  currency: USD
                  field: tax.currency
                referenceId: 4001-2alj5if
            bill_currency_mismatch_discount_currency:
              summary: bill_currency_mismatch (discount.currency)
              value:
                code: bill_currency_mismatch
                message: Every amount must be in the bill’s currency, USD.
                details:
                  currency: USD
                  field: discount.currency
                referenceId: 4001-2alj5if
            destination_not_vendors_destination_id:
              summary: destination_not_vendors (destinationId)
              value:
                code: destination_not_vendors
                message: The destination does not belong to the vendor.
                details:
                  field: destinationId
                  id: le_contact_destination_2rj4l7hmrrrcv
                referenceId: 4001-2alj5if
            document_purpose_mismatch_document_ids:
              summary: document_purpose_mismatch (documentIds)
              value:
                code: document_purpose_mismatch
                message: >-
                  Only documents uploaded with purpose bill_invoice can be used
                  here.
                details:
                  expected: bill_invoice
                  purpose: accounting_receipt
                  field: documentIds
                referenceId: 4001-2alj5if
            invalid_request_request_shape:
              summary: invalid_request (request shape)
              value:
                code: invalid_request
                message: >-
                  Invalid `vendorContactId`: Expected a valid ID beginning with
                  "le_c_".
                details:
                  /vendorContactId: Expected a valid ID beginning with "le_c_".
                referenceId: 4001-2alj5if
    PublicApiV2Error401Unauthorized:
      description: '- `unauthorized` — API key authentication is missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorUnauthorized'
          examples:
            unauthorized:
              summary: unauthorized
              value:
                code: unauthorized
                message: API key authentication is missing or invalid.
                details: {}
                referenceId: 4011-2alj5if
    PublicApiV2Error403BillsCreate:
      description: >-
        - `bill_owner_not_allowed` — This API key can only create and keep bills
        owned by its own user.

        - `forbidden` — The credential is not permitted to perform this action
        on the resource. When the resource is a field of the request, `details`
        names that `field` and the `id` it received.

        - `forbidden (legal entity)` — The credential is not permitted to act
        for the selected legal entity.

        - `not_available` — Public API v2 is not yet available. Use [Public API
        v1](https://docs.slash.com/introduction) in the meantime.

        - `user_api_key_required` — The API key is scoped to a legal entity
        rather than a user. Every v2 request needs a user API key, created under
        Settings → API keys in the Slash dashboard, together with the
        `x-legal-entity` header.
      content:
        application/json:
          schema:
            anyOf:
              - title: bill_owner_not_allowed
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorBillOwnerNotAllowed'
              - title: forbidden
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbidden'
              - title: forbidden (legal entity)
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbiddenLegalEntity'
              - title: not_available
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorNotAvailable'
              - title: user_api_key_required
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorUserApiKeyRequired'
          examples:
            bill_owner_not_allowed_owner_user_id:
              summary: bill_owner_not_allowed (ownerUserId)
              value:
                code: bill_owner_not_allowed
                message: This API key can only assign bills to its own user.
                details:
                  field: ownerUserId
                  id: u_2rj4l7hmrrrcv
                referenceId: 4031-2alj5if
            forbidden:
              summary: forbidden
              value:
                code: forbidden
                message: This credential is not permitted to do that.
                details: {}
                referenceId: 4031-2alj5if
            forbidden_legal_entity:
              summary: forbidden (legal entity)
              value:
                code: forbidden
                message: This credential is not permitted to do that.
                details: {}
                referenceId: 4031-2alj5if
            not_available:
              summary: not_available
              value:
                code: not_available
                message: >-
                  Public API v2 is not yet available. Use Public API v1
                  (https://docs.slash.com/introduction) in the meantime.
                details: {}
                referenceId: 4031-2alj5if
            user_api_key_required:
              summary: user_api_key_required
              value:
                code: user_api_key_required
                message: >-
                  Public API v2 requires a user API key. Create one under
                  Settings → API keys in the Slash dashboard.
                details: {}
                referenceId: 4031-2alj5if
    PublicApiV2Error404BillsCreate:
      description: >-
        - `not_found` — No resource matches the identifier. When the identifier
        is a field of the request, `details` names that `field` and the `id` it
        received.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorNotFound'
          examples:
            not_found_vendor_contact_id:
              summary: not_found (vendorContactId)
              value:
                code: not_found
                message: '`vendorContactId` le_c_2rj4l7hmrrrcv was not found.'
                details:
                  field: vendorContactId
                  id: le_c_2rj4l7hmrrrcv
                referenceId: 4041-2alj5if
            not_found_destination_id:
              summary: not_found (destinationId)
              value:
                code: not_found
                message: >-
                  `destinationId` le_contact_destination_2rj4l7hmrrrcv was not
                  found.
                details:
                  field: destinationId
                  id: le_contact_destination_2rj4l7hmrrrcv
                referenceId: 4041-2alj5if
            not_found_owner_user_id:
              summary: not_found (ownerUserId)
              value:
                code: not_found
                message: '`ownerUserId` u_2rj4l7hmrrrcv was not found.'
                details:
                  field: ownerUserId
                  id: u_2rj4l7hmrrrcv
                referenceId: 4041-2alj5if
            not_found_document_ids:
              summary: not_found (documentIds)
              value:
                code: not_found
                message: '`documentIds` was not found.'
                details:
                  field: documentIds
                referenceId: 4041-2alj5if
    PublicApiV2Error409ConflictIdempotencyKeyReused:
      description: >-
        - `conflict (idempotency key reused)` — A consumed `X-Idempotency-Key`
        was reused; the original response is not replayed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorConflictIdempotencyKeyReused'
          examples:
            conflict_idempotency_key_reused:
              summary: conflict (idempotency key reused)
              value:
                code: conflict
                message: >-
                  This request has already been submitted (duplicate idempotency
                  key).
                details: {}
                referenceId: 4091-2alj5if
    PublicApiV2RateLimited:
      description: >-
        The request exceeded the applicable rate limit. The response body is
        plain text, not the error object; clients must not depend on its
        wording.
      content:
        text/plain:
          schema:
            type: string
          example: You are rate limited
    PublicApiV2Error500Internal:
      description: >-
        - `internal` — Slash could not complete the request. Quote `referenceId`
        when contacting Slash support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorInternal'
          examples:
            internal:
              summary: internal
              value:
                code: internal
                message: >-
                  An unexpected error occurred. If this keeps happening, contact
                  Slash support with the reference id below.
                details: {}
                referenceId: 5001-2alj5if
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        User API key authentication. Create a key under Settings → API keys in
        the Slash dashboard (https://app.slash.com/global-settings/api-keys) and
        send the `x-legal-entity` header naming the legal entity to act on with
        every request. Keys scoped to a legal entity are rejected with `403
        user_api_key_required`.

````

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