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

# Mark one payable as exported

> Marks a payable as exported to the target accounting system, so it stops being returned by get_payables when filtered on export_status=to_export.



## OpenAPI

````yaml patch /consumers/{consumer_id}/spend_management/payables/{payable_id}/mark-as-exported
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/spend_management/payables/{payable_id}/mark-as-exported:
    patch:
      tags:
        - Spend Management
        - Payables
      summary: Mark one payable as exported
      description: >-
        Marks a payable as exported to the target accounting system, so it stops
        being returned by get_payables when filtered on export_status=to_export.
      operationId: spend_management_mark_payable_as_exported
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
        - name: payable_id
          in: path
          required: true
          schema:
            type: string
            title: Payable Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayableItem'
        '400':
          content:
            application/json:
              example:
                message: Error while trying to perform your request
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              examples:
                ERROR_PAYABLE_NOT_FOUND:
                  value:
                    message: The payable doesn't exist.
                    status: error
                    error_code: ERROR_PAYABLE_NOT_FOUND
                ERROR_PAYABLE_NOT_FOUND_2:
                  value:
                    message: The payable '${payable_id}' doesn't exist.
                    status: error
                    error_code: ERROR_PAYABLE_NOT_FOUND
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '409':
          content:
            application/json:
              examples:
                ERROR_WRONG_EXPORT_STATUS:
                  value:
                    message: >-
                      Only ${entity} with status 'to_export' can be marked as
                      exported.
                    status: error
                    error_code: ERROR_WRONG_EXPORT_STATUS
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - mcp_auth:
            - spend_management
            - spend_management.payables
            - '900'
            - 900.payables
components:
  schemas:
    PayableItem:
      properties:
        id:
          type: string
          title: Id
          description: Id of the payable.
        payable_type:
          $ref: '#/components/schemas/PayableType'
          description: Normalized classification of this payable.
        original_payable_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Original Payable Type
          description: >-
            The connector's own provider-specific type/subtype for this payable,
            passed through as-is (e.g. Spendesk's subType: invoice, creditNote,
            singlePurchase, multiUseCard, physical, subscription).
        reversed:
          type: boolean
          title: Reversed
          description: >-
            Whether this record is a reversal (a credit note against a
            previously issued invoice, or a refund against a previous card
            purchase) rather than the original document/purchase. Its amounts
            stay positive, as an accounting refund's: this flag carries the
            direction.
          default: false
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: Supplier's own invoice number, when available.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >-
            Free text description (e.g. merchant/vendor name for a card
            purchase).
        supplier_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplier Id
          description: >-
            Id of the supplier/merchant, when known. Filled in based on
            payable_type: always relevant for supplier_invoice/supplier_refund,
            and also present on a card_purchase when the merchant is a known
            supplier.
        employee_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Employee Id
          description: >-
            Id of the employee who submitted/owns the payable (the cardholder
            for a card_purchase), when known, regardless of payable_type.
        currency:
          type: string
          title: Currency
        untaxed_amount:
          type: number
          title: Untaxed Amount
        tax_amount:
          type: number
          title: Tax Amount
        total:
          type: number
          title: Total
        payable_date:
          type: string
          format: date
          title: Payable Date
          description: Invoice date, purchase date, or equivalent.
        accounting_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Accounting Date
          description: Accounting date
          examples:
            - '2026-01-15'
        due_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Due Date
          description: Payment due date, when relevant (supplier_invoice/supplier_refund).
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
          description: >-
            Start date of the period covered by the payable. Set when it relates
            to prepaid income or expenses (accruals and deferrals), indicating
            when the covered period begins.
          examples:
            - '2026-01-01'
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
          description: >-
            End date of the period covered by the payable. Set when it relates
            to prepaid income or expenses (accruals and deferrals), indicating
            when the covered period ends.
          examples:
            - '2026-01-31'
        last_updated_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Updated On
        lines:
          items:
            $ref: '#/components/schemas/PayableLineItem'
          type: array
          title: Lines
        attachments:
          anyOf:
            - items:
                $ref: '#/components/schemas/PayableAttachmentItem'
              type: array
            - type: 'null'
          title: Attachments
          description: >-
            Attachments (e.g. the invoice PDF, a receipt). Only populated on
            get_payable when include_attachments=true was requested.
        export_status:
          $ref: '#/components/schemas/PayableExportStatus'
          description: >-
            Whether this payable still needs to be synced to the target
            accounting system: 'not_ready' (not yet validated), 'to_export'
            (ready, not yet exported), 'exported', or 'unknown' when the
            connector cannot determine it.
          default: unknown
        allocations:
          items:
            $ref: '#/components/schemas/PayableAllocationItem'
          type: array
          title: Allocations
          description: How this payable's amount has been settled so far.
      type: object
      required:
        - id
        - payable_type
        - currency
        - untaxed_amount
        - tax_amount
        - total
        - payable_date
      title: PayableItem
      description: >-
        A single entity covering supplier invoices, supplier refunds (credit
        notes) and card purchases

        (including card refunds) -- these all come from the same underlying
        provider concept on Spendesk

        (a payable) and most connectors of this vertical are expected to share
        that shape, so this unifies

        what used to be two separate entities (SupplierInvoiceItem,
        CardPurchaseItem).
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - message
      title: ChiftError
    HTTPValidationError:
      title: Validation Error
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          default: Validation error
        status:
          title: Status
          type: string
          default: error
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    PayableType:
      type: string
      enum:
        - supplier_invoice
        - supplier_refund
        - card_purchase
      title: PayableType
      description: >-
        What kind of payable a record is. Distinct from `original_payable_type`,
        which is whatever

        label the connector's own provider uses (e.g. Spendesk's subType) --
        this is the normalized,

        cross-connector classification.
    PayableLineItem:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Free text description of the line.
          default: ''
        quantity:
          type: number
          title: Quantity
        unit_price:
          type: number
          title: Unit Price
        untaxed_amount:
          type: number
          title: Untaxed Amount
        tax_rate:
          type: number
          title: Tax Rate
          description: Tax rate applied to the line (e.g., 21.0 for 21%).
          examples:
            - 21
        tax_amount:
          type: number
          title: Tax Amount
        total:
          type: number
          title: Total
        account_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Number
          description: >-
            Ledger account number (of type general) used for the line (e.g.,
            701000), matching the `account_number` field on `InvoiceLineItemOut`
            in accounting, if the connector exposes coding at line level.
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
          description: >-
            Id of the ledger account used for the line, when the connector's
            underlying provider identifies accounts by id rather than (or in
            addition to) number.
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
          description: >-
            Id of the tax code applied to the line, when the connector exposes
            one.
        analytic_distribution:
          anyOf:
            - items:
                $ref: '#/components/schemas/AnalyticDistribution'
              type: array
            - type: 'null'
          title: Analytic Distribution
          description: >-
            List of analytic distributions for the line, reusing the accounting
            vertical's multi-plan shape as-is: each entry specifies an analytic
            plan and the analytic accounts (with percentages) it's split across.
            Both Spendesk and Airwallex can code a line against more than one
            dimension at once (e.g. cost center + project), so this follows the
            same pattern as
            `InvoiceLineItemOutMultiAnalyticPlans.analytic_distribution` in
            accounting rather than a flat single id.
          default: []
      type: object
      required:
        - quantity
        - unit_price
        - untaxed_amount
        - tax_rate
        - tax_amount
        - total
      title: PayableLineItem
    PayableAttachmentItem:
      properties:
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
          description: MIME type of the attachment (e.g. application/pdf).
          examples:
            - application/pdf
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
          description: Base64-encoded content of the attachment (e.g. a PDF, PNG or JPEG).
        attached_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Attached At
          description: Date the attachment was added to the payable.
      type: object
      title: PayableAttachmentItem
    PayableExportStatus:
      type: string
      enum:
        - unknown
        - not_ready
        - to_export
        - exported
      title: PayableExportStatus
      description: >-
        Shared across every payable-like entity of this vertical (payables,
        financial movements, ...):

        whether it still needs to be synced to the target accounting system.
    PayableAllocationItem:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: >-
            Id of the financial_movement or payable this allocation points to,
            per its type.
        amount:
          type: number
          title: Amount
          description: Amount of this allocation, in the payable's own currency.
        currency:
          type: string
          title: Currency
        type:
          $ref: '#/components/schemas/PayableAllocationType'
          description: >-
            What this allocation settles the payable against: a
            financial_movement (a cash payment) or another payable (e.g. a
            credit note or card refund applied document-to-document).
      type: object
      required:
        - amount
        - currency
        - type
      title: PayableAllocationItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnalyticDistribution:
      properties:
        analytic_plan:
          type: string
          title: Analytic Plan
          description: Technical ID of the analytic plan to which the distribution applies.
          examples:
            - <accounting-analytic-plan-id>
        analytic_accounts:
          items:
            $ref: '#/components/schemas/AnalyticDistributionDetail'
          type: array
          title: Analytic Accounts
          description: >-
            List of analytic accounts and their respective percentages for the
            distribution.
      type: object
      required:
        - analytic_plan
        - analytic_accounts
      title: AnalyticDistribution
    PayableAllocationType:
      type: string
      enum:
        - financial_movement
        - payable
      title: PayableAllocationType
    AnalyticDistributionDetail:
      properties:
        analytic_account:
          type: string
          title: Analytic Account
          description: Technical ID of the analytic account.
          examples:
            - <accounting-analytic-account-id>
        percentage:
          type: number
          title: Percentage
          description: >-
            Percentage of the untaxed amount attributed to this analytic
            account. Only whole numbers (no decimals) are allowed. The total
            across the analytic distribution (all accounts in a given analytic
            plan) must equal 100%.
          examples:
            - 100
      type: object
      required:
        - analytic_account
        - percentage
      title: AnalyticDistributionDetail
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````

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