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

# Record a refund paid by bank transfer

> Links a money-out bank line, imported from a statement and still in the reconciliation inbox, to the payments it refunds, and takes the line out of the inbox. Each allocation names a payment (`paymentId`) or a payment request paid by hand (`paymentRequestId`). The allocations may not add up to more than the bank line, nor refund a payment beyond what it collected less what is already refunded: either answers 409 `over_refund`. A line that is money in, not from a bank statement, already reconciled, or another group’s, and a payment from another group, answer 400. No money moves: this records a refund the group has already paid by bank transfer, as the reconcile step in Scoutworks does. The API never issues a Direct Debit refund. Needs `accounting:write` and `payments:read` (403 without the second). Made as the admin who created the key, and the bank line’s history names the key. Writes count towards the key’s usual limit and a second one of 30 changes a minute. A group whose subscription has lapsed answers 402. A bank line dated in a closed accounting year answers 409 `period_closed`.

Send an `Idempotency-Key` header (unique per refund) so a retry after a timeout cannot make it twice; without one the request answers 400. For 24 hours, the same key with the same body answers 200 with the first refund and an `Idempotent-Replayed: true` header; with a different body it answers 400; while the first request is still running it answers 409 `conflict`.



## OpenAPI

````yaml /api-reference/openapi/payments.json post /refunds/manual
openapi: 3.1.0
info:
  title: Scoutworks public API
  version: 1.32.0
  description: >-
    Read your Scout group’s data from your own tools: spreadsheets, scripts,
    Zapier or n8n, add members, waiting-list applications and draft events, keep
    its task boards up to date, and keep its books in step with your accounting
    tools. Every request is scoped to the group that owns the key.


    **Authentication.** Send a group API key as a Bearer token. Keys are created
    by a group admin and shown once.


    **Scopes.** Each operation names the scope it needs. Area scopes
    (`members:read`, `events:read`, `badges:read`, `waiting-list:read`,
    `tasks:read`, `accounting:read`, `expenses:read`, `suppliers:read`,
    `payments:read`, `gift-aid:read`, `adults:read`, `users:read`,
    `access:read`, `compliance:read`, `communications:read`, `hire:read`,
    `fundraising:read`, `moving-on:read`, `files:read`) open an area; a
    `.contacts`, `.people` or `.compliance` scope adds detail to that area’s
    responses. The `:write` scopes change data, as the admin who created the
    key: `members:write`, `waiting-list:write` and `events:write` add and update
    members, waiting-list applications and draft events, `tasks:write` adds and
    updates tasks, `accounting:write` changes the books and attaches receipts,
    and `files:write` uploads to the Knowledge Base, and `users:write` invites,
    changes, suspends and removes users, never a group admin, and `access:write`
    manages access policies and overrides, never an admin’s access. Uploads are
    virus scanned and count towards the group’s storage. A write never emails or
    notifies a family unless it sends `notify: true`. No scope moves money:
    nothing takes, changes, cancels or refunds a payment. Fields a key may not
    see are left out, not sent as null. Health, bank details and free-text notes
    are never available.


    **Pagination.** Lists return `{ data, nextCursor }`. Pass `nextCursor` back
    as `?cursor=`, with the same filters, until it is null. `limit` is 1 to 200.


    **Writing.** Send an `Idempotency-Key` with every `POST`, so a retry answers
    with the first record instead of making a second. Every record a write or a
    single-record `GET` returns carries an `ETag`: send it as `If-Match` on a
    `PATCH`, `PUT` or `DELETE` and a change made since answers 412
    `stale_write`. See https://developers.scoutworks.app/guides/writing-data.


    **Errors.** Every error is `{ error: { code, message } }`. Branch on `code`;
    `message` is for people and may change.


    **Compatibility.** We aim to change v1 only by addition: new endpoints, new
    optional parameters, new response fields and new enum values. Ignore fields
    you do not know and treat an unknown enum value as “other”. We will try to
    warn you before a breaking change, but one can still happen without notice,
    so check responses and fail loudly on an error. Changes are listed in the
    changelog at https://developers.scoutworks.app/changelog.


    **Rate limits.** 120 requests a minute per key. `RateLimit-*` headers report
    what is left. Writes and uploads have smaller limits of their own: see
    https://developers.scoutworks.app/guides/rate-limits.
servers:
  - url: https://api.scoutworks.app/api/v1
    description: Live
  - url: https://api-demo.scoutworks.app/api/v1
    description: Demo (sample data, reset weekly)
security:
  - bearerAuth: []
tags:
  - name: Payments
    description: Parent payments, read only. Nothing here takes money.
paths:
  /refunds/manual:
    post:
      tags:
        - Payments
      summary: Record a refund paid by bank transfer
      description: >-
        Links a money-out bank line, imported from a statement and still in the
        reconciliation inbox, to the payments it refunds, and takes the line out
        of the inbox. Each allocation names a payment (`paymentId`) or a payment
        request paid by hand (`paymentRequestId`). The allocations may not add
        up to more than the bank line, nor refund a payment beyond what it
        collected less what is already refunded: either answers 409
        `over_refund`. A line that is money in, not from a bank statement,
        already reconciled, or another group’s, and a payment from another
        group, answer 400. No money moves: this records a refund the group has
        already paid by bank transfer, as the reconcile step in Scoutworks does.
        The API never issues a Direct Debit refund. Needs `accounting:write` and
        `payments:read` (403 without the second). Made as the admin who created
        the key, and the bank line’s history names the key. Writes count towards
        the key’s usual limit and a second one of 30 changes a minute. A group
        whose subscription has lapsed answers 402. A bank line dated in a closed
        accounting year answers 409 `period_closed`.


        Send an `Idempotency-Key` header (unique per refund) so a retry after a
        timeout cannot make it twice; without one the request answers 400. For
        24 hours, the same key with the same body answers 200 with the first
        refund and an `Idempotent-Replayed: true` header; with a different body
        it answers 400; while the first request is still running it answers 409
        `conflict`.
      operationId: recordManualRefund
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Unique per refund: any printable text up to 255 characters. A retry
            with the same key and body within 24 hours answers with the first
            refund instead of making another. Required.
          schema:
            type: string
            minLength: 1
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1ManualRefundCreate'
      responses:
        '200':
          description: The refund an earlier request with the same `Idempotency-Key` made.
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
            ETag:
              description: >-
                The record’s version as this key reads it, totals included (a
                budget’s `spent` moves it). Send it as `If-Match` on your next
                change.
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                `true` when this answers an earlier request with the same
                `Idempotency-Key`.
              schema:
                type: string
                enum:
                  - 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1ManualRefundRecordingResponse'
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/V1ManualRefundRecording'
                required:
                  - data
                additionalProperties: {}
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
            ETag:
              description: >-
                The record’s version as this key reads it, totals included (a
                budget’s `spent` moves it). Send it as `If-Match` on your next
                change.
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                `true` when this answers an earlier request with the same
                `Idempotency-Key`.
              schema:
                type: string
                enum:
                  - 'true'
        '400':
          description: >-
            A query parameter, cursor or request body is not acceptable
            (`invalid_request`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '401':
          description: >-
            No API key, or one that is unknown, revoked or expired
            (`invalid_api_key`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '402':
          description: >-
            The group’s subscription has lapsed, so the API cannot change data;
            reads still work (`subscription_required`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '403':
          description: The key lacks the scope this operation needs (`insufficient_scope`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '409':
          description: >-
            A request with the same `Idempotency-Key` is still being processed,
            or the change clashes with a record (`conflict`); the date is in a
            closed accounting year (`period_closed`); or the transaction cannot
            change that way (`source_locked`); or a manual refund would refund
            more than its bank line or its payment has left (`over_refund`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '429':
          description: Too many requests; wait `retryAfter` seconds (`rate_limited`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
            Retry-After:
              description: Seconds to wait before trying again.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
        '500':
          description: Our fault; quote `errorRef` to support (`internal_error`).
          headers:
            RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Error'
      security:
        - bearerAuth:
            - accounting:write
components:
  schemas:
    V1ManualRefundCreate:
      type: object
      properties:
        transactionId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: >-
            The money-out bank line the refund was paid by: a line imported from
            a bank statement, still in the reconciliation inbox. Find one in
            Scoutworks’ Bank Inbox.
        allocations:
          minItems: 1
          maxItems: 20
          type: array
          items:
            $ref: '#/components/schemas/V1ManualRefundAllocation'
          description: >-
            The payments the bank line refunds, and how much of it each.
            Together at most the bank line’s amount; each at most what is still
            refundable on that payment. Each payment at most once.
        notes:
          description: Why it was refunded. Shown in Scoutworks; never returned by the API.
          type: string
          minLength: 1
          maxLength: 500
      required:
        - transactionId
        - allocations
      additionalProperties: {}
      description: A field not listed here is refused with a 400.
    V1ManualRefundRecordingResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/V1ManualRefundRecording'
      required:
        - data
    V1ManualRefundRecording:
      type: object
      properties:
        transactionId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: The bank line.
        refunds:
          type: array
          items:
            $ref: '#/components/schemas/V1Refund'
          description: >-
            The manual refunds recorded against the bank line, one per payment,
            each as `GET /refunds` reads it.
      required:
        - transactionId
        - refunds
    V1Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - insufficient_scope
                - invalid_request
                - subscription_required
                - not_found
                - conflict
                - period_closed
                - source_locked
                - over_refund
                - possible_duplicate
                - invalid_transition
                - admin_protected
                - stale_write
                - insufficient_stock
                - not_available
                - not_downloadable
                - file_too_large
                - storage_full
                - unsupported_file_type
                - file_infected
                - scan_unavailable
                - service_unavailable
                - rate_limited
                - internal_error
            message:
              type: string
          required:
            - code
            - message
        errorRef:
          description: 'On a 500: a reference to quote to Scoutworks support.'
          type: string
        retryAfter:
          description: 'On a 429: seconds to wait before trying again.'
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        matchingIds:
          description: >-
            On a 409 `possible_duplicate`: the ids of the records this one looks
            like, which `GET /members/{memberId}` or `GET
            /waiting-list/{entryId}` reads.
          type: array
          items:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      required:
        - error
    V1ManualRefundAllocation:
      type: object
      properties:
        paymentId:
          description: >-
            A payment from `GET /payments`: a Direct Debit collection, or a
            subscription cycle marked paid by hand.
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        paymentRequestId:
          description: >-
            A payment request paid by hand (status `paid_manually`), which has
            no payment of its own.
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        amount:
          $ref: '#/components/schemas/V1MoneyInput'
          description: Pounds of the bank line refunded against this payment.
      required:
        - amount
      additionalProperties: {}
      description: >-
        Exactly one of `paymentId` and `paymentRequestId`. A field not listed
        here is refused with a 400.
    V1Refund:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        kind:
          type: string
          enum:
            - direct_debit
            - manual
          description: >-
            `direct_debit` was refunded through GoCardless; `manual` was paid
            back by bank transfer and matched to a bank line.
        amount:
          $ref: '#/components/schemas/V1Money'
          description: Paid back, as a positive amount.
        date:
          type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
          description: >-
            When the money left: the bank line’s date for a manual refund, the
            day it was raised for a Direct Debit refund.
        status:
          anyOf:
            - type: string
              enum:
                - pending_submission
                - submitted
                - refund_settled
                - failed
                - funds_returned
            - type: 'null'
          description: A Direct Debit refund’s status. Null for a manual refund.
        paymentId:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
          description: The payment refunded, when it was a payment.
        paymentRequestId:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
          description: >-
            The payment request refunded, for a request paid by hand, which has
            no payment.
        transactionId:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
          description: A manual refund’s bank line in the books.
        createdAt:
          type: string
          format: date-time
          description: A UTC timestamp, ISO 8601.
        updatedAt:
          type: string
          format: date-time
          description: A UTC timestamp, ISO 8601.
      required:
        - id
        - kind
        - amount
        - date
        - status
        - paymentId
        - paymentRequestId
        - transactionId
        - createdAt
        - updatedAt
    V1MoneyInput:
      type: string
      pattern: ^\d+(\.\d{1,2})?$
      description: >-
        Pounds, as a string with at most two decimal places: `"12.50"`. Always
        positive: the `type` gives the direction.
    V1Money:
      type: string
      pattern: ^-?\d+\.\d{2}$
      description: >-
        Pounds, as a decimal string with two places: `"12.50"`. Never a float. A
        refund or contra entry is negative.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A group API key, sent as `Authorization: Bearer sw_live_…`. Keys from
        staging and the demo start `sw_test_` instead. A group admin creates
        keys in Settings → Integrations → API keys.

````

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