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

# Change a Borrower's Charge Order

> Set one borrower's own charge order and fallback rules

# Change a Borrower's Charge Order

Set the order one borrower is collected in, overriding your [collection policy](https://docs.rightfoot.com/api-reference/payments/update-payment-policy.md) for them.

This is how you change a borrower's order after they are enrolled. Re-sending the borrower to [Enroll and Update Borrowers](https://docs.rightfoot.com/api-reference/payments/create-payment-enrollments.md) leaves their order as it is.

| Field | Left out | `null` |
| - | - | - |
| `charge_order` | Unchanged | Follows your collection policy again |
| `fallback_on` | Unchanged | Follows your collection policy again |

The change applies from the borrower's next payment. A payment already submitted finishes on its own rail.

## When `card` is refused

A `charge_order` naming `card` is rejected with `400`, and `error.details.reason` says why:

| Reason | Meaning |
| - | - |
| `card_rail_disabled` | Debit-card collection is not yet enabled for your account |
| `no_connection_for_rail` | None of your [processor keys](https://docs.rightfoot.com/api-reference/payments/list-payment-connections.md) can charge a debit card |
| `card_instrument_missing` | The borrower has no active debit-card token. Send them again with a `charge_instrument` token and `token_type: card` |

Changing only `fallback_on` never re-checks a card order saved earlier.


## OpenAPI

````yaml PATCH /v1/payment_enrollments/{authorizer_unique_id}/charge_settings
openapi: 3.1.0
info:
  title: Rightfoot API
  description: >-
    Submit a batch of authorizers for balance checks, retrieve processed
    balances, and check the status of a batch.
  version: 0.3.0-alpha
servers:
  - url: https://api.rightfoot.com
security:
  - BearerAuth: []
tags:
  - name: General Availability
    description: |
      **General Availability** indicates that the endpoint is production-ready.
  - name: In Development
    description: >
      **In Development** indicates that the endpoint is currently being built
      and will be available in an upcoming release.
paths:
  /v1/payment_enrollments/{authorizer_unique_id}/charge_settings:
    parameters:
      - in: path
        name: authorizer_unique_id
        required: true
        schema:
          type: string
        description: The borrower, as the identifier you enrolled them with.
    patch:
      tags:
        - In Development
      summary: Change a borrower's charge order
      description: >
        Set one borrower's own charge order and fallback rules, overriding your

        collection policy for them. This is how you change a borrower's order
        after

        their first enrollment: re-sending them to

        [Enroll and Update
        Borrowers](/api-reference/payments/create-payment-enrollments)

        leaves it as it is.


        A field left out is unchanged. A field sent as `null` goes back to

        following your collection policy. The change applies from the borrower's

        next payment; a payment already submitted finishes on its own rail.


        A `charge_order` naming `card` is refused with `400` and

        `error.details.reason` set to `card_rail_disabled`,

        `no_connection_for_rail` or `card_instrument_missing` (see

        [Charge
        order](/api-reference/payments/create-payment-enrollments#charge-order-debit-card-and-ach)).
      operationId: update_charge_settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChargeSettingsUpdate'
            examples:
              card_first:
                summary: Debit card first, then ACH
                value:
                  charge_order:
                    - card
                    - ach
              no_fallback_on_nsf:
                summary: Stay on the card after insufficient funds
                value:
                  fallback_on:
                    - instrument_invalid
                    - authorization_revoked
                    - declined_by_processor
              back_to_policy:
                summary: Follow your collection policy again
                value:
                  charge_order: null
                  fallback_on: null
      responses:
        '200':
          description: The charge settings now in effect.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeSettingsResponse'
        '400':
          description: >
            The body failed validation, or `charge_order` names `card` and the
            card

            rail cannot be used for this borrower.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                status: error
                status_code: 400
                error:
                  code: BAD_REQUEST
                  message: >-
                    charge_order names the card rail, which cannot be used for
                    this borrower
                  details:
                    reason: card_instrument_missing
                  timestamp: '2026-11-13T12:00:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: You have not enrolled this borrower.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    ChargeSettingsUpdate:
      type: object
      additionalProperties: false
      description: >
        A change to one borrower's charge settings. A field left out is
        unchanged;

        `null` follows your collection policy again.
      properties:
        charge_order:
          $ref: '#/components/schemas/ChargeOrder'
        fallback_on:
          $ref: '#/components/schemas/FallbackOn'
    ChargeSettingsResponse:
      type: object
      description: The charge settings in effect for one borrower.
      properties:
        authorizer_unique_id:
          type: string
        charge_order:
          type: array
          items:
            $ref: '#/components/schemas/ChargeRail'
          description: The order in effect.
        charge_order_source:
          type: string
          enum:
            - borrower
            - lender
            - default
          description: |
            `borrower` — the borrower's own order. `lender` — your collection
            policy's. `default` — neither is set: ACH alone.
        fallback_on:
          type: array
          items:
            $ref: '#/components/schemas/FailureCategory'
          description: The failures that move a payment to the next rail, in effect.
        borrower_settings:
          type: object
          description: What the borrower has set. A `null` field follows your policy.
          properties:
            charge_order:
              type:
                - array
                - 'null'
              items:
                $ref: '#/components/schemas/ChargeRail'
            fallback_on:
              type:
                - array
                - 'null'
              items:
                $ref: '#/components/schemas/FailureCategory'
        instruments:
          type: array
          description: >
            The bank account Rightfoot would debit, and the borrower's debit
            card if

            you sent one.
          items:
            type: object
            properties:
              rail:
                $ref: '#/components/schemas/ChargeRail'
              last4:
                type:
                  - string
                  - 'null'
                description: Last four of the card or bank account, if known.
              status:
                type: string
                enum:
                  - active
                  - stopped
                description: >
                  `stopped` after a failure that rules the instrument out (an

                  expired card, a closed account, a revoked authorization). A
                  stopped

                  rail is skipped.
              stop_reason:
                type:
                  - string
                  - 'null'
                enum:
                  - null
                  - instrument_invalid
                  - authorization_revoked
                description: Why it stopped. `null` while active.
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of the error, either "error" or "success"
        status_code:
          type: integer
          description: HTTP status code of the error
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code (e.g., "RESOURCE_NOT_FOUND")
            message:
              type: string
              description: Detailed error message.
            details:
              type: string
              description: Additional details about the error
            timestamp:
              type: string
              format: date-time
              description: Time the error occurred
            suggestion:
              type: string
              description: Suggested action to resolve the error
        documentation_url:
          type: string
          format: uri
          description: URL to the documentation for the error
    ChargeOrder:
      type:
        - array
        - 'null'
      minItems: 1
      maxItems: 2
      uniqueItems: true
      items:
        $ref: '#/components/schemas/ChargeRail'
      description: |
        The rails to collect on, in order: `["card", "ach"]` charges the debit
        card first and falls back to ACH, `["ach", "card"]` the other way round.
        `ach` is required; a card-only order is not offered. Unset is ACH alone.
    FallbackOn:
      type:
        - array
        - 'null'
      uniqueItems: true
      items:
        $ref: '#/components/schemas/FailureCategory'
      description: >
        Which failures move a payment to the next rail in the charge order. A
        rail

        with another after it gets one payment per collection attempt. If that

        payment fails for a reason in this list, the next rail is tried;
        otherwise

        the attempt ends. Unset is every category listed here. Has no effect on
        an

        ACH-only order.
    ChargeRail:
      type: string
      enum:
        - ach
        - card
      description: |
        `ach` — the bank account in `account_number` / `routing_number`.

        `card` — the debit card in `charge_instrument`.
    FailureCategory:
      type: string
      enum:
        - insufficient_funds
        - instrument_invalid
        - authorization_revoked
        - declined_by_processor
      description: >
        `insufficient_funds` — not enough money on the rail tried.


        `instrument_invalid` — the instrument cannot take a payment: a closed or

        frozen account, an expired card.


        `authorization_revoked` — the borrower or their bank refused the
        payment,

        such as an unauthorized ACH return or a card dispute.


        `declined_by_processor` — the payment processor refused it for its own

        reasons.


        A processor outage (`processor_error`) never moves a payment to another

        rail: the same rail is tried again later. It cannot be listed.
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: error
            status_code: 401
            error:
              code: UNAUTHORIZED
              message: Invalid API key provided.
              timestamp: '2024-09-16T12:01:00Z'
              suggestion: Please check your API key.
            documentation_url: https://api.rightfoot.com/docs
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Authentication to the API is performed via Bearer Token Authentication.
        Provide your API key as the bearer token in the Authorization header.


        All API requests must be made over HTTPS. Calls made over plain HTTP
        will fail. API requests without authentication will also fail.

````

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