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

# Update order payment

> Correct or void a manually recorded payment. The order's `payment_status` is recalculated from the new balance. Payments taken through a payment gateway can't be changed.



## OpenAPI

````yaml openapi-v2 PATCH /api/v2/orders/{order_id}/payments/{payment_id}
openapi: 3.1.0
info:
  title: Take App Merchant API V2
  version: 2.0.0
  description: >-
    Authenticated Merchant API for stores. All money values are integers in the
    smallest currency unit (e.g. cents).
servers:
  - url: https://take.app
security:
  - bearerAuth: []
paths:
  /api/v2/orders/{order_id}/payments/{payment_id}:
    patch:
      tags:
        - Orders
      description: >-
        Correct or void a manually recorded payment. The order's
        `payment_status` is recalculated from the new balance. Payments taken
        through a payment gateway can't be changed.
      operationId: updateOrderPayment
      parameters:
        - schema:
            type: string
          required: true
          name: order_id
          in: path
        - schema:
            type: string
          required: true
          name: payment_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderPaymentUpdate'
      responses:
        '200':
          description: Payment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPayment'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    OrderPaymentUpdate:
      type: object
      properties:
        amount:
          type: integer
          exclusiveMinimum: 0
        payment_method:
          type: string
          minLength: 1
        paid_at:
          anyOf:
            - type: string
              format: date-time
            - type: string
              format: date
          description: >-
            When the payment was received. ISO 8601 date-time, or a date (read
            as midnight UTC). Defaults to now.
        status:
          type: string
          enum:
            - paid
            - voided
          description: Pass `voided` to cancel a payment recorded by mistake.
    OrderPayment:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - order_payment
        order_id:
          type: string
        amount:
          type: integer
          description: >-
            Integer amount in the smallest unit of the store currency (e.g.
            cents).
        fee:
          type: integer
          description: >-
            Integer amount in the smallest unit of the store currency (e.g.
            cents).
        status:
          type: string
          enum:
            - pending
            - confirming
            - partial
            - paid
            - refunded
            - voided
          description: Only `paid` payments count towards `amount_paid`.
        payment_method:
          type: string
          description: Name of the payment method, e.g. "Bank Transfer".
        payment_method_type:
          type: string
        paid_at:
          type: string
          format: date-time
      required:
        - id
        - object
        - order_id
        - amount
        - fee
        - status
        - payment_method
        - payment_method_type
        - paid_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - rate_limit_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - request_id
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Merchant API V2 token. Pass as `Authorization: Bearer <token>`.'

````

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