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

# Update payment

> Update an existing payment



## OpenAPI

````yaml /openAPI/openapi-20240301.json patch /payments/{payment_id}
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /payments/{payment_id}:
    patch:
      tags:
        - Payments
      summary: Update payment
      description: Update an existing payment
      operationId: Update-payment
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Payment Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdatePaymentRequestSchema:
      properties:
        payment_parts:
          anyOf:
            - items:
                $ref: '#/components/schemas/PaymentPart'
              type: array
            - type: 'null'
          title: Payment Parts
          description: Payment Parts
      type: object
      title: UpdatePaymentRequestSchema
      description: Update Payment Request Schema
    PaymentResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Payment Id
        customer_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Customer Id
          description: ' '
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
          description: ' '
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
          description: ' '
        customer_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer External Id
          description: ' '
        connector_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Connector Id
          description: ' '
        connector_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Name
          description: ' '
        organisation_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Organisation Id
          description: ' '
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: ' '
        payment_method:
          anyOf:
            - $ref: '#/components/schemas/PaymentMethodTypes'
            - type: 'null'
          description: ' '
        payment_method_details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payment Method Details
          description: ''
        type:
          anyOf:
            - $ref: '#/components/schemas/PaymentTypes'
            - type: 'null'
          description: ' '
        amount:
          type: string
          title: Amount
          description: ''
        amount_refunded:
          type: string
          title: Amount Refunded
          description: ''
        currency_code:
          type: string
          title: Currency Code
          description: ''
        status:
          anyOf:
            - $ref: '#/components/schemas/PaymentStatusTypes'
            - type: 'null'
          description: Payment Status
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
          description: ' '
        invoices:
          anyOf:
            - items:
                $ref: '#/components/schemas/InvoiceAmounts'
              type: array
            - type: 'null'
          title: Invoices
          description: ' '
        timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Timestamp
          description: ' '
        transactions:
          anyOf:
            - items:
                $ref: '#/components/schemas/TransactionResponseSchema'
              type: array
            - type: 'null'
          title: Transactions
          description: ' '
        error_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Text
          description: Error Message
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: created_at
        receipt_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Receipt Number
          description: receipt_number
        balance_transactions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Balance Transactions
          description: balance_transactions
      type: object
      required:
        - id
        - amount
        - amount_refunded
        - currency_code
        - status
      title: PaymentResponseSchema
      description: Payment Response Schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaymentPart:
      properties:
        invoice_id:
          type: string
          format: uuid
          title: Invoice Id
          description: Invoice ID
        amount:
          type: integer
          title: Amount
          description: Amount
      type: object
      required:
        - invoice_id
        - amount
      title: PaymentPart
      description: Payment Part Object
    PaymentMethodTypes:
      type: string
      enum:
        - card
        - cash
        - check
        - charge_back
        - bank_transfer
        - direct_debit
        - amazon_payments
        - paypal_express_checkout
        - upi
        - netbanking_emandates
        - other
        - credits
        - ach_credit_transfer
      title: PaymentMethodTypes
    PaymentTypes:
      type: string
      enum:
        - payment
        - refund
        - payment_reversal
        - authorization
        - tax_withheld
      title: PaymentTypes
    PaymentStatusTypes:
      type: string
      enum:
        - in_progress
        - requires_action
        - pending_charge
        - authorized
        - created
        - success
        - voided
        - failed
        - canceled
        - refunded
        - partially_refunded
        - other
      title: PaymentStatusTypes
    InvoiceAmounts:
      properties:
        invoice_id:
          type: string
          format: uuid
          title: Invoice Id
          description: Invoice ID
        payment_id:
          type: string
          format: uuid
          title: Payment Id
          description: Payment ID
        amount:
          type: string
          title: Amount
          description: Amount
        amount_refunded:
          type: string
          title: Amount Refunded
          description: Amount Refunded
        currency_code:
          type: string
          title: Currency Code
          description: Currency Code
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: Invoice Number
        status:
          anyOf:
            - $ref: '#/components/schemas/InvoiceStatus'
            - type: 'null'
          description: Invoice Status
        invoice_total:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Total
          description: Invoice Total
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Created At
      type: object
      required:
        - invoice_id
        - payment_id
        - amount
        - amount_refunded
        - currency_code
      title: InvoiceAmounts
      description: Payment part
    TransactionResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: ' '
        customer_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Customer Id
          description: ' '
        connector_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Connector Id
          description: ' '
        organisation_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Organisation Id
          description: ' '
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: ' '
        payment_method:
          anyOf:
            - $ref: '#/components/schemas/PaymentMethodTypes'
            - type: 'null'
          description: ' '
        payment_method_details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payment Method Details
          description: ''
        reference_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Number
          description: ' '
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: ' '
        amount:
          type: string
          title: Amount
          description: ''
        currency_code:
          type: string
          title: Currency Code
          description: ''
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: ' '
        error_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Text
          description: ' '
        payment:
          type: string
          format: uuid
          title: Payment
          description: ' '
        settled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Settled At
          description: ' '
        voided_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Voided At
          description: ' '
        status:
          anyOf:
            - $ref: '#/components/schemas/PaymentStatusTypes'
            - type: 'null'
          description: ' '
        timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Timestamp
          description: ' '
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: ' '
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: ' '
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: ' '
        payment_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Type
          description: ' '
      type: object
      required:
        - id
        - amount
        - currency_code
        - payment
        - status
      title: TransactionResponseSchema
      description: Transaction Response Schema
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    InvoiceStatus:
      type: string
      enum:
        - draft
        - approved
        - edited
        - discarded
        - paid
        - void
        - partially_paid
        - upcoming
      title: InvoiceStatus
      description: >-
        When adding a new status make sure the following files are also modified
        appropriately
            * serverless-backend/zenskar_shared/models/invoices.py
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````