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

# Update Payment User

> Update (PATCH) an existing Payment User, identified by the user's Finverse `user_id`.

**Access:** This flow is available on demand for Finverse customers who want to directly manage Payment Users and Payment Accounts. Contact [support@finverse.com](mailto:support@finverse.com) to request access.

**Authorization**: `customer_token`

## Implementation guidance

**Autopay consent handling:** be careful when updating the value of a user's `autopay_consent` field. Key considerations:

1. **The** **`autopay_consent`** **field should only be set to** **`true`** **if the user has specifically agreed to autopay future bills.** We recommend preserving auditable evidence that users have provided this consent (e.g. in your logs or database records), which may be later requested by payment gateways or banks in the event of user billing disputes.
    
2. **User notifications of change to** **`autopay_consent`****:** Finverse will send an email notification to the user's `email` each time the `autopay_consent` value is changed (e.g. from `true` to `false`, or `false` to `true`), to ensure that users are aware about whether their bills will be autopaid.
    
3. **Autopay downstream handling:** the way `autopay_consent` impacts future bill collections depends on your specific integration with Finverse.
    
    1. If you have enabled a pre-built Finverse autopay integration (e.g. via Xero invoices, Sitelink/Rapidstor tenant ledgers, Storeganise invoices), Finverse will automatically handle autopayments on each bill due date for any users where (i) `autopay_consent` = `true`, and (ii) the user has at least 1 valid payment method.
        
    2. If you are using a custom Finverse autopay integration, you need to initiate your own collection payment on your desired due date using the Finverse API, via `POST /payments`. Depending on your Customer App's configuration, Finverse may verify that the user's `autopay_consent` = `true` before processing each payment.
        

## Request body

Only the selected fields below can currently be updated. Any omitted fields will remain unchanged.

The following fields are non-editable. Attempting to edit these will return an API error:

`created_at`, `external_user_id`, `integration_metadata`, `updated_at`, `user_details`, `user_id`

### Response fields

The response is the updated Payment User object.

Refer to Payment User object data model in `GET /payment_users/{user_id}`.



## OpenAPI

````yaml /api-reference/openapi.json post /payment_users/{paymentUserId}
openapi: 3.0.0
info:
  description: Documentation of the early finverse services
  title: Finverse Public
  termsOfService: https://example.com
  contact:
    name: Maintainers
    email: info@finverse.com
  license:
    name: unknown license
  version: 0.0.1
servers:
  - url: https://api.prod.finverse.net
security:
  - Oauth2:
      - test
tags:
  - name: public
    description: Publicly accessible endpoints
    x-group: Public
  - name: customer
    description: Customer app and institution endpoints
    x-group: Customer
  - name: link
    description: Finverse Link flows
    x-group: Link
  - name: login_identity
    description: Login identity lifecycle and metadata
    x-group: Login identity
  - name: accounts
    description: Accounts, balances, and account numbers
    x-group: Accounts
  - name: statements
    description: Statements and composite statements
    x-group: Statements
  - name: transactions
    description: Transaction history
    x-group: Transactions
  - name: identity_income
    description: Identity and income insights
    x-group: Identity & income
  - name: payment_links
    description: Payment link creation and checkout
    x-group: Payment links
  - name: mandates
    description: Direct debit mandates
    x-group: Mandates
  - name: payments
    description: Payment initiation and status
    x-group: Payment operations
  - name: payouts
    description: Payouts and scheduled payouts
    x-group: Payouts
  - name: payment_users
    description: Payment user profiles
    x-group: Payment users
  - name: payment_accounts
    description: Payment accounts for users
    x-group: Payment accounts
  - name: payment_methods
    description: Stored payment methods
    x-group: Payment methods
  - name: bills
    description: Bill presentment
    x-group: Bills
  - name: disputes
    description: Payment disputes
    x-group: Disputes
  - name: ledger
    description: Ledger and statements
    x-group: Ledger
paths:
  /payment_users/{paymentUserId}:
    post:
      tags:
        - payment_users
      summary: Update Payment User
      description: >-
        Update (PATCH) an existing Payment User, identified by the user's
        Finverse `user_id`.


        **Access:** This flow is available on demand for Finverse customers who
        want to directly manage Payment Users and Payment Accounts. Contact
        [support@finverse.com](mailto:support@finverse.com) to request access.


        **Authorization**: `customer_token`


        ## Implementation guidance


        **Autopay consent handling:** be careful when updating the value of a
        user's `autopay_consent` field. Key considerations:


        1. **The** **`autopay_consent`** **field should only be set to**
        **`true`** **if the user has specifically agreed to autopay future
        bills.** We recommend preserving auditable evidence that users have
        provided this consent (e.g. in your logs or database records), which may
        be later requested by payment gateways or banks in the event of user
        billing disputes.
            
        2. **User notifications of change to** **`autopay_consent`****:**
        Finverse will send an email notification to the user's `email` each time
        the `autopay_consent` value is changed (e.g. from `true` to `false`, or
        `false` to `true`), to ensure that users are aware about whether their
        bills will be autopaid.
            
        3. **Autopay downstream handling:** the way `autopay_consent` impacts
        future bill collections depends on your specific integration with
        Finverse.
            
            1. If you have enabled a pre-built Finverse autopay integration (e.g. via Xero invoices, Sitelink/Rapidstor tenant ledgers, Storeganise invoices), Finverse will automatically handle autopayments on each bill due date for any users where (i) `autopay_consent` = `true`, and (ii) the user has at least 1 valid payment method.
                
            2. If you are using a custom Finverse autopay integration, you need to initiate your own collection payment on your desired due date using the Finverse API, via `POST /payments`. Depending on your Customer App's configuration, Finverse may verify that the user's `autopay_consent` = `true` before processing each payment.
                

        ## Request body


        Only the selected fields below can currently be updated. Any omitted
        fields will remain unchanged.


        The following fields are non-editable. Attempting to edit these will
        return an API error:


        `created_at`, `external_user_id`, `integration_metadata`, `updated_at`,
        `user_details`, `user_id`


        ### Response fields


        The response is the updated Payment User object.


        Refer to Payment User object data model in `GET
        /payment_users/{user_id}`.
      operationId: updatePaymentUser
      parameters:
        - name: paymentUserId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentUserRequest'
        description: request body for updating payment user
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentUser'
              examples:
                success:
                  summary: Success
                  value:
                    autopay_consent: true
                    created_at: '2024-10-16T08:57:06.155Z'
                    email: info+test-new-email@finverse.com
                    external_user_id: unique_user_id_1729069025
                    metadata:
                      employer_name: Apple Inc
                      key: value
                    name: John Doe
                    next_bill_update: '2024-12-02T00:06:00.000Z'
                    updated_at: '2024-10-16T08:57:59.092Z'
                    user_details:
                      - details_type: HK_ID
                        values:
                          - 01JAA8Q2TW1S7K84D8YCHXM0KP
                    user_id: 01JAA8Q2PATMCX4V8M0KKMYW1C
                    user_type: INDIVIDUAL
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
              examples:
                attempted_to_update_non_updatable_field:
                  summary: Error (attempted to update non-updatable field)
                  value:
                    error:
                      details: unsupported field external_user_id supplied for update
                      error_code: INVALID_INPUT
                      message: >-
                        Invalid parameter value(s). Please review parameter
                        inputs.
                      request_id: '1729069151'
                      type: API_ERROR
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
      security:
        - Oauth2:
            - paymentUser:update
components:
  schemas:
    UpdatePaymentUserRequest:
      properties:
        autopay_consent:
          type: boolean
          nullable: true
        email:
          type: string
          maxLength: 256
          nullable: true
        metadata:
          type: object
          additionalProperties:
            type: string
          nullable: true
        name:
          type: string
          nullable: true
        next_bill_update:
          type: string
          format: date-time
          nullable: true
        user_type:
          type: string
          enum:
            - INDIVIDUAL
            - BUSINESS
          nullable: true
      additionalProperties: true
    PaymentUser:
      required:
        - autopay_consent
      properties:
        autopay_consent:
          description: >-
            Flag indicating whether the user has agreed to future (on-demand)
            payments of bills/invoices owed by the user. This consent is usually
            collected in the Payment Link flow. Value is `false` by default,
            unless: (i) the user enrolled into Autopay in the Payment Link UI,
            (ii) a Payment LInk was created with the configuration
            `payment_setup_options.future_payments` = `AUTOPAY`, (iii) the
            Payment User was created with `autopay_consent` = `true` using the
            Create Payment User API (`POST /payment_users`).
          type: boolean
          example: false
        created_at:
          type: string
          format: date-time
          description: Timestamp when the Payment User object was first created
        email:
          type: string
          description: >-
            Payment User's contact email, used for Finverse notifications. To
            ensure a smooth payment experience for end-users and to avoid
            support tickets or disputes, we strongly recommend enabling Finverse
            notifications by providing the end-user's email. Finverse sends
            email notifications for: \- Changes to stored payment methods (e.g.
            direct debit mandate or card) \- Changes to user autopay consent \-
            Executed payments (except card payments via Stripe, since Stripe
            sends its own notifications). Contact
            [support@finverse.com](mailto:support@finverse.com) for the full
            list of email notifications sent by Finverse.
        external_user_id:
          type: string
          description: >-
            Customer App's unique ID for the user. This ID is used to identify
            returning users across user sessions and load the user's previously
            stored Payment Method and settings. For example, a returning user
            can: \- Directly pay a Payment Link (in `mode`\= `payment`) using
            their stored Payment Method, without re-entering payment details. -
            Use a Payment Link to edit their stored Payment Method. \- Use a
            Payment Link to turn Autopay on/off (by editing their Autopay
            consent), if allowed by the Customer App.
        integration_metadata:
          $ref: '#/components/schemas/IntegrationMetadataResponse'
        metadata:
          description: >-
            Customer-supplied attributes in key:value format. E.g.
            `employer_name`: `Apple Inc`
          type: object
          additionalProperties:
            type: string
        name:
          type: string
          description: >-
            User's name or nickname (note: this does not need to exactly match
            the accountholder name of the user's account; however accountholder
            name inputs may be verified against this value).
        next_bill_update:
          type: string
          format: date-time
          nullable: true
          description: >-
            Timestamp when Finverse is scheduled to attempt to fetch the next
            bill/invoice for this user. Bill/invoice ingestion is one of the
            available methods for Finverse to initiate Autopay bill collections
            on each bill due date, using the user's saved payment method(s).
            Note: bills will only be fetched if the Customer App has configured
            a 3rd party ERP/CRM or Accounting integration, enabling Finverse to
            fetch bill/invoice data from the 3rd party source (e.g. Xero,
            RapidStor). Contact
            [support@finverse.com](mailto:support@finverse.com) to discuss 3rd
            party bill/invoice integrations and Autopay flows.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the Payment User object was last updated
        user_details:
          type: array
          items:
            $ref: '#/components/schemas/SenderDetail'
          description: Additional information about the user's identity
        user_id:
          type: string
          description: Finverse unique ID for the user.
        user_type:
          type: string
          enum:
            - INDIVIDUAL
            - BUSINESS
          description: >-
            Type of user (used to determine what user authentication inputs are
            required, e.g. individual ID vs. company registration details).
            Possible values: `INDIVIDUAL`, `BUSINESS`
    ErrBodyModelV2:
      properties:
        error:
          $ref: '#/components/schemas/FvErrorModelV2'
    IntegrationMetadataResponse:
      properties:
        integration_id:
          type: string
          enum:
            - RAPIDSTOR
        rapidstor_metadata:
          $ref: '#/components/schemas/RapidstorMetadataResponse'
    SenderDetail:
      properties:
        details_type:
          description: >-
            Type of the user identity information submitted. Possible values:
            `HK_ID`, `PASSPORT`, `HK_BUSINESS_REGISTRATION`,
            `HK_CERTIFICATE_OF_INCORPORATION`, `ACCOUNTHOLDER_NAME`
          type: string
          enum:
            - HK_ID
            - PASSPORT
            - HK_BUSINESS_REGISTRATION
            - HK_CERTIFICATE_OF_INCORPORATION
        values:
          description: >-
            Value(s) of the user identity information submitted. Min 1 value
            required, max 10 values. Values in responses are tokenized by
            Finverse.
          type: array
          maxItems: 10
          items:
            type: string
    FvErrorModelV2:
      required:
        - type
        - error_code
        - message
        - details
        - request_id
      properties:
        details:
          type: string
        error_code:
          type: string
          example: CREDENTIALS_INVALID
        message:
          type: string
        request_id:
          description: The request_id provided in the request header
          type: string
        type:
          description: The error type
          type: string
          enum:
            - LINK_ERROR
            - API_ERROR
          example: LINKING_ERROR
    RapidstorMetadataResponse:
      properties:
        account_token:
          type: string
        corp_code:
          type: string
        i_anniv_days:
          type: number
          format: int32
        s_location_code:
          type: string
        tenant_default_currency:
          type: string
        tenant_id:
          type: string
        unit_type_id:
          type: string
  securitySchemes:
    Oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://finverse-dev.us.auth0.com/oauth/token
          scopes:
            account: Account
            balance: Balance
            credit: Credit
            institution: Institution
            investment: Investment
            link: Link
            test: Test
            transaction: Transaction

````