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

# Update Payin

> Update a payin without confirming

You can update a payin only when a payin is in requires\_payment\_method state.


## OpenAPI

````yaml put /v3/payin/{id}
openapi: 3.1.0
info:
  title: sandbox
  version: '3'
servers:
  - url: https://service-sandbox.tazapay.com
security:
  - sec0: []
paths:
  /v3/payin/{id}:
    put:
      summary: Updating a payin
      description: Update a payin without confirming
      operationId: update-a-payin
      parameters:
        - name: id
          in: path
          description: ID of the already created payin
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_details:
                  $ref: '#/components/schemas/CustomerDetails'
                customer:
                  type: string
                  description: ID of the customer for the checkout session
                success_url:
                  type: string
                  description: >-
                    URL where the customer is directed to after a successful
                    payment
                cancel_url:
                  type: string
                  description: >-
                    The URL the customer will be directed to if they decide to
                    cancel payment and return to your website.
                shipping_details:
                  $ref: '#/components/schemas/ShippingDetails'
                billing_details:
                  $ref: '#/components/schemas/BillingDetails'
                transaction_documents:
                  type: string
                  description: Supporting documents for the transaction
                  format: json
                metadata:
                  $ref: '#/components/schemas/MetadataInput'
                reference_id:
                  type: string
                  description: Your unique identifier for the session
                statement_descriptor:
                  type: string
                  description: >-
                    Configure the description of the payment on your customer's
                    statements. It must contain at least one letter and be 1-22
                    characters long
                payment_method_details:
                  type: string
                  description: >-
                    Pass the data specific to a payment method to confirm a
                    payin and create a payment attempt
                  format: json
            examples:
              Request Example:
                value:
                  metadata:
                    key1: value1
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: success
                    message: ''
                    data:
                      amount: 100
                      amount_paid: 0
                      billing_details:
                        address:
                          city: Singapore
                          country: SG
                          line1: 1st Street
                          line2: 2nd Avenue
                          postal_code: '43004'
                          state: Singapore
                        label: Home
                        name: Andrea Lark
                        phone:
                          calling_code: '65'
                          number: '87654321'
                      cancel_url: https://mystore.com/try_again
                      cancelled_at: null
                      client_token: ZRjM4ROfY6SPjTaQkz00OszWUcVvMA8KhStkPAoamPQ=
                      confirm: false
                      created_at: '2024-10-01T10:08:30.666381739Z'
                      customer: cus_crtqrhth90j0121gpt50
                      customer_details:
                        country: SG
                        email: andrea@example.com
                        name: Andrea Lark
                        phone:
                          calling_code: '65'
                          number: '87654321'
                      holding_currency: INR
                      id: pay_crtsk7i6avg0t9ndc7l0
                      invoice_currency: INR
                      items: []
                      latest_payment_attempt: ''
                      latest_payment_attempt_data: null
                      metadata:
                        product_reference: REF_12353
                      object: payin
                      paid_in_excess: false
                      partially_paid: false
                      payment_attempts: []
                      payment_method_details:
                        key: value
                      reference_id: string
                      shipping_details:
                        address:
                          city: Singapore
                          country: SG
                          line1: 1st Street
                          line2: 2nd Avenue
                          postal_code: '43004'
                          state: Singapore
                        label: Home
                        name: Andrea Lark
                        phone:
                          calling_code: '65'
                          number: '87654321'
                      statement_descriptor: tzp*string
                      status: requires_payment_method
                      status_description: ''
                      success_url: https://mystore.com/success_page
                      transaction_data: []
                      transaction_description: test
                      transaction_documents: []
                      webhook_url: https://mystore.com/internal/webhook
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Indicates whether the payin creation request succeeded.
                  message:
                    type: string
                    description: >-
                      Response message or additional context regarding the payin
                      request.
                  data:
                    $ref: '#/components/schemas/PayinData'
      deprecated: false
components:
  schemas:
    CustomerDetails:
      type: object
      description: Details about the customer
      required:
        - name
        - email
        - country
      properties:
        name:
          type: string
          description: Name of the customer
        email:
          type: string
          description: Email address of the customer
        country:
          type: string
          description: 'ISO 3166 standard alpha-2 code. eg: SG, IN, US, etc.'
        phone:
          $ref: '#/components/schemas/Phone'
    ShippingDetails:
      type: object
      description: Shipping details including recipient name, address and phone
      properties:
        name:
          type: string
          description: Name of the recipient
        address:
          $ref: '#/components/schemas/Address'
        phone:
          $ref: '#/components/schemas/Phone'
        label:
          type: string
          description: Denotes the type of address (Example - home, work)
    BillingDetails:
      type: object
      description: Billing details including name, address and phone
      properties:
        name:
          type: string
          description: Name of the billing contact
        address:
          $ref: '#/components/schemas/Address'
        phone:
          $ref: '#/components/schemas/Phone'
        label:
          type: string
          description: Denotes the type of address (Example - home, work)
    MetadataInput:
      type: string
      description: >-
        Set of key-value pairs that can be attached to the object (JSON string
        format)
      format: json
      example: '{"key1": "value1", "key2": "value2"}'
    PayinData:
      type: object
      description: Contains detailed information about a payin object.
      properties:
        amount:
          type: integer
          description: Total amount of the payin in cents.
        amount_paid:
          type: integer
          description: Amount already paid by the customer toward this payin.
        billing_details:
          $ref: '#/components/schemas/BillingDetails'
        cancel_url:
          type: string
          description: >-
            URL to which the customer is redirected if they cancel the payment
            process.
        cancelled_at:
          type: string
          description: Timestamp when the payin was cancelled, if applicable.
        client_token:
          type: string
          description: >-
            Client authentication token used to confirm or validate this payin
            session.
        confirm:
          type: boolean
          description: >-
            Indicates whether this payin requires explicit confirmation from the
            client before processing.
        created_at:
          type: string
          description: ISO 8601 timestamp marking when the payin was created.
        customer:
          type: string
          description: Unique identifier of the customer associated with the payin.
        customer_details:
          $ref: '#/components/schemas/CustomerDetails'
        form:
          type: string
          description: Form data associated with the payin session.
        holding_currency:
          type: string
          description: Currency used to hold the funds before conversion or settlement.
        id:
          type: string
          description: Unique identifier assigned to this payin object.
        invoice_currency:
          type: string
          description: Currency of the associated invoice.
        items:
          type: array
          description: >-
            List of items or line-items associated with this payin (if
            applicable).
        latest_payment_attempt:
          type: string
          description: Identifier of the most recent payment attempt related to this payin.
        latest_payment_attempt_data:
          type: object
          description: Detailed data of the latest payment attempt if available.
        metadata:
          $ref: '#/components/schemas/Metadata'
        object:
          type: string
          description: Object type identifier; always 'payin' for this endpoint.
        paid_in_excess:
          type: boolean
          description: >-
            Indicates whether an amount greater than the invoiced total was
            received.
        partially_paid:
          type: boolean
          description: Indicates whether the payin amount has been partially received.
        payment_attempts:
          type: array
          description: List of all payment attempts made for this payin.
        payment_method_details:
          type: object
          description: >-
            Information related to the selected payment method used by the
            payer.
        reference_id:
          type: string
          description: >-
            External reference ID provided by the merchant for tracking
            purposes.
        shipping_details:
          $ref: '#/components/schemas/ShippingDetails'
        statement_descriptor:
          type: string
          description: Text that appears on the customer's payment statement.
        status:
          type: string
          description: Current status of the payin.
        status_description:
          type: string
          description: Additional descriptive text regarding the status.
        success_url:
          type: string
          description: >-
            URL where the customer is redirected after successful payment
            completion.
        transaction_data:
          type: array
          description: List of transaction data entries associated with the payin.
        transaction_description:
          type: string
          description: Description or label for the transaction purpose.
        transaction_documents:
          type: array
          description: List of documents linked to the payin transaction.
        webhook_url:
          type: string
          description: Merchant webhook endpoint for asynchronous payin updates.
        on_behalf_of:
          type: string
          description: >-
            ID of the entity on whose behalf the payin was created.
            Automatically inherited from the associated checkout session when
            applicable. The entity must belong to the merchant account.
    Phone:
      type: object
      description: Phone contact details
      properties:
        calling_code:
          type: string
          description: >-
            Calling country code (for example, '1' for United States, '91' for
            India)
        number:
          type: string
          description: Phone Number
    Address:
      type: object
      description: Address details
      properties:
        line1:
          type: string
          description: Address Line 1
        line2:
          type: string
          description: Address Line 2
        city:
          type: string
          description: Address city
        state:
          type: string
          description: Address state
        country:
          type: string
          description: Address country (ISO 3166-1 alpha-2 country code)
        postal_code:
          type: string
          description: Postal Code
    Metadata:
      type: object
      description: Custom metadata key-value pairs attached to the object
      additionalProperties:
        type: string
      nullable: true
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````