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

# Record transaction

> Records a payment you received outside Streamlined (a check, a bank transfer, cash, or a card
taken elsewhere), a credit note, or a debit note. Nothing is charged or collected.

A payment is applied to the invoices you list in the same request. The amounts have to come to
the whole payment, and none can be more than its invoice owes. If they don't, nothing is
recorded. A credit note can't be more than its invoice owes. A debit note adds to what the
invoice owes.

**This changes what your customer owes, and it's final.** The invoices' balances change at
once, and the transaction goes to QuickBooks, NetSuite, Shopify, or HubSpot if you've
connected them. It can't be undone from the API or the Streamlined app.

**Send an `Idempotency-Key`.** A retry with the same key within 24 hours returns the first
transaction with `200` instead of recording it twice. If the first request ended in `409`
with `payment_not_applied`, the retry gets that `409` again. See
[Record and apply payments](/guides/record-and-apply-payments) for every error `code`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /transactions
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, deposit links, and the reports behind your dashboard
    programmatically through this API, and receive webhooks when deposit links
    change. All requests must be authenticated with an API key, except [Create
    signup intent](/api-reference/signup/create-signup-intent), which an AI
    agent can call for a business that wants an account.
  version: 1.18.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: >-
      Record payments you received elsewhere and credit or debit notes, apply
      payments to invoices, and look up where each one went. See [Record and
      apply payments](/guides/record-and-apply-payments).
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
  - name: Signup
    description: >-
      Get a signup link, or an email from our team, for a business you're
      helping start with Streamlined. For AI agents, with no API key. See [Sign
      up a business](/guides/sign-up-a-business).
  - name: Reports
    description: >-
      Read the aging, sales, collections, and customer figures your dashboard
      and customer pages show. Amounts are in cents, in the currency each
      response names. See [Reports](/guides/reports) for how each figure is
      worked out.
paths:
  /transactions:
    post:
      tags:
        - Transactions
      summary: Record transaction
      description: >
        Records a payment you received outside Streamlined (a check, a bank
        transfer, cash, or a card

        taken elsewhere), a credit note, or a debit note. Nothing is charged or
        collected.


        A payment is applied to the invoices you list in the same request. The
        amounts have to come to

        the whole payment, and none can be more than its invoice owes. If they
        don't, nothing is

        recorded. A credit note can't be more than its invoice owes. A debit
        note adds to what the

        invoice owes.


        **This changes what your customer owes, and it's final.** The invoices'
        balances change at

        once, and the transaction goes to QuickBooks, NetSuite, Shopify, or
        HubSpot if you've

        connected them. It can't be undone from the API or the Streamlined app.


        **Send an `Idempotency-Key`.** A retry with the same key within 24 hours
        returns the first

        transaction with `200` instead of recording it twice. If the first
        request ended in `409`

        with `payment_not_applied`, the retry gets that `409` again. See

        [Record and apply payments](/guides/record-and-apply-payments) for every
        error `code`.
      operationId: recordTransaction
      parameters:
        - $ref: '#/components/parameters/TransactionIdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordTransactionRequest'
            examples:
              payment:
                summary: A check that pays two invoices
                value:
                  type: payment
                  customer_uuid: c1f0a92b-4d63-4e88-b0a7-2f9e4c6d1b35
                  amount: 480000
                  currency: USD
                  payment_source: check
                  memo: Check 1042
                  invoices:
                    - invoice_uuid: 8d2c4a17-6b3e-4f95-a1d0-7e9c5b2f4a63
                      amount: 300000
                    - invoice_uuid: 2b7e9d41-0c5a-4f3e-8a6b-1d9c7e5f3a20
                      amount: 180000
              credit_note:
                summary: A credit note for damaged goods
                value:
                  type: credit_note
                  invoice_uuid: 8d2c4a17-6b3e-4f95-a1d0-7e9c5b2f4a63
                  amount: 12500
                  currency: USD
                  memo: One case arrived damaged
      responses:
        '200':
          description: >-
            A retry with an `Idempotency-Key` already used. Returns the
            transaction the first request recorded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetail'
        '201':
          description: >-
            Recorded. Returns the transaction, with `allocations` for where its
            money went.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            The customer or an invoice isn't on your account. `code` is
            `customer_not_found` or `invoice_not_found`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                error: Customer not found
                code: customer_not_found
        '409':
          description: >
            `request_in_flight`, `payment_not_applied`, or
            `allocation_in_progress`. See

            [Retries](/guides/record-and-apply-payments#retries) for what each
            means and whether to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                error: A request with this Idempotency-Key is still being processed.
                code: request_in_flight
        '422':
          description: Refused, and nothing was recorded. `code` says why.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                error: >-
                  The invoices add up to $3,000.00, not the payment of
                  $4,800.00. Apply the whole payment.
                code: entry_refused
components:
  parameters:
    TransactionIdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >
        Your own unique value for this transaction, up to 255 characters.
        Retrying with the same key

        within 24 hours returns the transaction the first request recorded,
        rather than recording

        another. If the first request ended in `409` with `payment_not_applied`,
        the retry gets that

        `409` again.
      required: false
      schema:
        type: string
        maxLength: 255
  schemas:
    RecordTransactionRequest:
      type: object
      required:
        - type
        - amount
        - currency
      properties:
        type:
          type: string
          enum:
            - payment
            - credit_note
            - debit_note
        amount:
          type: integer
          minimum: 1
          description: In cents.
        currency:
          type: string
          description: >-
            The currency of the amounts, which has to be each invoice's
            currency.
          example: USD
        customer_uuid:
          type: string
          format: uuid
          description: For a payment, the customer who paid. Required for a payment.
        payment_source:
          type: string
          enum:
            - ach_credit
            - check
            - cash
            - card
          description: >-
            For a payment, how it was paid. `ach_credit` is a bank transfer.
            Required for a payment.
        invoices:
          allOf:
            - $ref: '#/components/schemas/TransactionInvoiceLines'
          description: >-
            For a payment, the invoices it pays and how much goes on each.
            Required for a payment: one without `invoices` is refused with
            `invalid_invoices`, and nothing is recorded.
        invoice_uuid:
          type: string
          format: uuid
          description: >-
            For a credit or debit note, the invoice it's on. Required for a
            note. The note is for that invoice's customer.
        memo:
          type: string
          maxLength: 5000
          description: A note on the transaction. Your customer can see it.
        notify_customer:
          type: boolean
          default: false
          description: Email the customer that their invoice balance changed.
    TransactionDetail:
      description: >
        Returned by GET /transactions/:id, Record transaction, and Apply payment
        to invoices. Note:

        this returns the transaction object directly, not wrapped in a
        `transaction` key. This

        differs from /orders, /invoices, /customers etc, which wrap their
        resource. Kept this way

        for v1 backwards compatibility.
      allOf:
        - $ref: '#/components/schemas/Transaction'
        - type: object
          properties:
            allocations:
              type: array
              description: >
                Where the transaction's money went, one entry per invoice, the
                invoice it's recorded on

                first. Empty while a payment is unapplied. A payment bigger than
                its invoice shows the

                whole amount on that invoice; the rest is credit there.
              items:
                type: object
                properties:
                  invoice_uuid:
                    type: string
                    format: uuid
                  invoice_identifier:
                    type: string
                    nullable: true
                    description: The invoice number, such as `W51846`.
                  amount:
                    type: integer
                    description: In cents, in the transaction's currency.
            unapplied_amount:
              type: integer
              description: >-
                How much of the transaction isn't on an invoice yet, in cents.
                The whole amount while a payment is unapplied, else 0.
    CodedError:
      type: object
      description: >-
        An error with a sentence to show people and a stable `code` to branch
        on.
      properties:
        error:
          type: string
          description: >-
            What went wrong, as a sentence to show people. Don't parse it. The
            wording can change.
        code:
          type: string
          description: A stable value to branch on. The endpoint's guide lists each one.
    TransactionInvoiceLines:
      type: array
      minItems: 1
      maxItems: 50
      description: >-
        The invoices and how much of the payment goes on each, in cents.
        Together they have to come to the whole payment, and none can be more
        than its invoice owes.
      items:
        type: object
        required:
          - invoice_uuid
          - amount
        properties:
          invoice_uuid:
            type: string
            format: uuid
          amount:
            type: integer
            minimum: 1
            description: In cents.
    Transaction:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        currency:
          $ref: '#/components/schemas/Currency'
        amount:
          type: integer
          description: >-
            The amount, in cents. For a payment applied to invoices in another
            currency, this is what it paid in the invoices' currency, and
            `received` holds what arrived.
        fee:
          type: integer
          nullable: true
          description: >-
            The processing fee, in cents. Null when there's none, as for a
            payment you recorded.
        payment_source:
          type: string
        memo:
          type: string
          nullable: true
        payout_date:
          type: string
          format: date
          nullable: true
          description: Null if the transaction has not been paid out yet.
        net_amount:
          type: integer
        self_recorded:
          type: boolean
        display_type:
          type: string
        txn_files:
          type: array
          items:
            $ref: '#/components/schemas/TransactionFile'
        invoice:
          type: object
          nullable: true
          description: >-
            The invoice the transaction is recorded on, the first of
            `allocations`. Null if it isn't on an invoice, such as a payment
            that hasn't been applied.
          properties:
            invoice_token:
              type: string
              description: >-
                The token in the invoice's payment link. It isn't the invoice's
                `uuid`: to match this invoice to `allocations`, use the first
                entry's `invoice_uuid`.
            amount:
              type: integer
              description: The invoice's total, in cents.
            currency:
              $ref: '#/components/schemas/Currency'
            due_date:
              type: string
              format: date-time
              nullable: true
              description: >-
                When the invoice is due, as an ISO 8601 timestamp in UTC. The
                due day is its UTC date part (`2027-01-20T12:00:00.000Z` is due
                January 20). Invoices issued before v1.16.0, and due dates
                picked in the Streamlined app, can carry a time whose UTC date
                is a day off. Read those in your account's time zone.
        recipient:
          $ref: '#/components/schemas/InvoiceRecipient'
        received:
          allOf:
            - $ref: '#/components/schemas/ReceivedAmount'
          nullable: true
          description: >-
            What arrived, when a payment was applied to invoices in another
            currency in the Streamlined app. The transaction's `amount`,
            `currency`, and `fee` are then what it paid in the invoices'
            currency, and payouts use the `received` figures. Null for every
            other transaction.
        conversion:
          allOf:
            - $ref: '#/components/schemas/CurrencyConversion'
          nullable: true
          description: >-
            The rate a payment was applied at, when it was applied to invoices
            in another currency. Null for every other transaction.
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    Currency:
      type: string
      description: >-
        ISO currency code. Most resources support these. Products are limited to
        USD, CAD, EUR, GBP, AUD.
      enum:
        - USD
        - CAD
        - GBP
        - EUR
        - AUD
        - JPY
        - INR
    TransactionFile:
      type: object
      properties:
        id:
          type: integer
        filename:
          type: string
        thumbnail_url:
          type: string
        url:
          type: string
    InvoiceRecipient:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        company_name:
          type: string
          nullable: true
        display_name:
          type: string
          nullable: true
          description: >-
            Company name if present, otherwise first/last name. Null if neither
            is set.
    ReceivedAmount:
      type: object
      description: What arrived for a payment applied to invoices in another currency.
      properties:
        amount:
          type: integer
          description: The amount that arrived, in cents.
        currency:
          $ref: '#/components/schemas/Currency'
        fee:
          type: integer
          nullable: true
          description: >-
            The processing fee on what arrived, in cents. Null when there's
            none, as for a payment you recorded.
      example:
        amount: 72000
        currency: USD
        fee: 217
    CurrencyConversion:
      type: object
      description: >-
        The rate a payment was applied at, when it was applied to invoices in
        another currency.
      properties:
        rate:
          type: string
          description: >-
            Units of the currency that arrived per one unit of the invoices'
            currency, as a decimal string. 72,000 cents in USD paying 100,000
            cents in CAD is `0.72`.
          example: '0.72'
        market_rate:
          type: string
          nullable: true
          description: >-
            The market rate for the same pair when the payment arrived, for
            comparison. Null when there was no rate for that pair.
          example: '0.731'
        market_rate_as_of:
          type: string
          format: date
          nullable: true
          description: The date of that market rate.
          example: '2026-11-18'
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

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