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

# Refresh Transactions

> Initiate an on-demand refresh of transaction data for a user's merchant account.



## OpenAPI

````yaml POST /transactions/refresh
openapi: 3.1.0
info:
  title: Knot API
  description: An API to interact with the Knot merchant connectivity platform.
  version: 1.0.0
servers:
  - url: https://development.knotapi.com
    description: Development server
security:
  - basicAuth: []
paths:
  /transactions/refresh:
    post:
      description: >-
        Initiate an on-demand refresh of transaction data for a user's merchant
        account.
      operationId: transaction_refresh
      requestBody:
        description: The input parameters required for refreshing transactions.
        content:
          application/json:
            schema:
              type: object
              properties:
                merchant_id:
                  type: integer
                  description: Unique identifier for the merchant.
                  example: 45
                external_user_id:
                  type: string
                  description: Your unique identifier for the user.
                  example: abc
              required:
                - merchant_id
                - external_user_id
      responses:
        '202':
          description: Refresh request accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Success
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                ExternalUserIdRequired:
                  summary: external_user_id field is required
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The external_user_id field is required.
                MerchantIdRequired:
                  summary: merchant_id field is required
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The merchant_id field is required.
                UserNotFound:
                  summary: User not found
                  value:
                    error_type: USER_ERROR
                    error_code: USER_NOT_FOUND
                    error_message: >-
                      The user was not found. Please check the external_user_id
                      provided.
                MerchantAccountNotFound:
                  summary: Merchant account not found
                  value:
                    error_type: MERCHANT_ACCOUNT_ERROR
                    error_code: MERCHANT_ACCOUNT_NOT_FOUND
                    error_message: >-
                      The merchant account was not found. Please check the
                      merchant_id provided.
                MerchantAccountDisconnected:
                  summary: Merchant account is disconnected
                  value:
                    error_type: MERCHANT_ACCOUNT_ERROR
                    error_code: MERCHANT_ACCOUNT_DISCONNECTED
                    error_message: >-
                      The merchant account is disconnected. Please check the
                      merchant_id provided.
                MerchantUnavailable:
                  summary: Merchant is unavailable
                  value:
                    error_type: MERCHANT_ERROR
                    error_code: MERCHANT_UNAVAILABLE
                    error_message: >-
                      The merchant is unavailable. Please check the merchant_id
                      provided.
                OngoingOperation:
                  summary: An existing operation is in progress
                  value:
                    error_type: MERCHANT_ACCOUNT_ERROR
                    error_code: ONGOING_OPERATION
                    error_message: An existing operation is in progress.
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AuthFailed:
                  summary: Auth failed
                  value:
                    error_type: INVALID_INPUT
                    error_code: INVALID_API_KEYS
                    error_message: Invalid client_id or secret provided.
        '403':
          description: Forbidden request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NoAccess:
                  summary: No access
                  value:
                    error_type: INVALID_REQUEST
                    error_code: NO_ACCESS
                    error_message: Please contact Knot for access to this endpoint.
        '429':
          description: Rate limit exceeded.
          headers:
            Retry-After:
              description: >-
                Seconds until the rate limit resets. The limit is 1 request per
                hour per linked merchant account.
              schema:
                type: integer
                example: 3600
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                RateLimitExceeded:
                  summary: Rate limit exceeded
                  value:
                    error_type: RATE_LIMIT_ERROR
                    error_code: TOO_MANY_REQUESTS
                    error_message: >-
                      Rate limit exceeded. Please retry after the time indicated
                      in the Retry-After header.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: Server Error
components:
  schemas:
    Error:
      type: object
      properties:
        error_type:
          type: string
          description: Type of error.
          enum:
            - INVALID_INPUT
            - INVALID_REQUEST
            - USER_ERROR
            - SESSION_ERROR
            - MERCHANT_ACCOUNT_ERROR
            - MERCHANT_ERROR
            - SUBSCRIPTION_ERROR
            - TRANSACTION_ERROR
            - CART_ERROR
          example: INVALID_REQUEST
        error_code:
          type: string
          description: Error code.
          enum:
            - INVALID_API_KEYS
            - INVALID_FIELD
            - INVALID_JWE
            - INVALID_CURSOR_FORMAT
            - USER_NOT_FOUND
            - MERCHANT_ACCOUNT_NOT_FOUND
            - MERCHANT_ACCOUNT_DISCONNECTED
            - SESSION_NOT_FOUND
            - EXTEND_NOT_SUPPORTED
            - MERCHANT_UNAVAILABLE
            - NO_ACCESS
            - TRANSACTION_NOT_FOUND
            - NO_TRANSACTIONS
            - SUBSCRIPTION_NOT_FOUND
            - ONGOING_OPERATION
            - CART_NOT_FOUND
            - FULFILLMENT_NOT_FOUND
          example: INVALID_FIELD
        error_message:
          type: string
          description: Detailed error message.
          example: The limit may not be greater than 10.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication header of the form `Basic <encoded-value>`, where
        `<encoded-value>` is the base64-encoded string `username:password`. Use
        your `client_id` as the `username` and your `secret` as the `password`
        value.

````