# Change Invoice Status

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v0/invoice/req-status-change-invoice:
    post:
      summary: Change Invoice Status
      deprecated: false
      description: >-

        :::highlight purple 📌

        Use this API to update the status of an existing invoice in your EnKash
        account.

        This allows you to mark an invoice as paid, cancelled, or set it to any
        other supported status. Keeping invoice statuses up to date helps you
        maintain accurate financial records and automate your billing workflows.

        Additionally, the updated status is synchronized with the Bharat Connect
        platform, ensuring that both suppliers and buyers have access to the
        latest status of the invoice.

        :::
      tags:
        - Bharat Connect (BBPS)/APIs - BBPS/Vendor Payment/Invoice
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceStatusChangeRequest'
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  payload:
                    type: string
                  response_code:
                    type: integer
                  response_message:
                    type: string
                required:
                  - payload
                  - response_code
                  - response_message
                x-apidog-orders:
                  - payload
                  - response_code
                  - response_message
                x-apidog-ignore-properties: []
              example:
                payload: SUCCESS
                response_code: 0
                response_message: SUCCESS
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Bharat Connect (BBPS)/APIs - BBPS/Vendor Payment/Invoice
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/616243/apis/api-10664765-run
components:
  schemas:
    InvoiceStatusChangeRequest:
      type: object
      properties:
        device:
          type: object
          properties:
            tag:
              type: object
              properties:
                name:
                  type: string
                  enum:
                    - GEOCODE
                    - IP
                    - AGENTID
                  x-apidog-enum:
                    - value: GEOCODE
                      name: ''
                      description: ''
                    - value: IP
                      name: ''
                      description: ''
                    - value: AGENTID
                      name: ''
                      description: ''
                value:
                  type: string
                  pattern: ^([^\\\"]){1,100}$
              required:
                - name
                - value
              x-apidog-orders:
                - name
                - value
              x-apidog-ignore-properties: []
          required:
            - tag
          x-apidog-orders:
            - tag
          x-apidog-ignore-properties: []
        b2bIds:
          type: object
          properties:
            buyerB2BId:
              type: string
              pattern: '^([^\\\"]){1,100}$ '
            supplierB2BId:
              type: string
              pattern: '^([^\\\"]){1,100}$ '
          required:
            - buyerB2BId
            - supplierB2BId
          x-apidog-orders:
            - buyerB2BId
            - supplierB2BId
          x-apidog-ignore-properties: []
        invoiceStatus:
          type: object
          properties:
            objectId:
              type: string
              pattern: ^[INV]{3}[A-Za-z0-9]{32,32}$
              description: |-
                Unique Identifier of the
                invoice across all entities,
                created by the originator.
                Format:
                INV<Timestamp><MachineI
                D><ThreadID><RandomNum
                ber>
            supplierInvoiceNumber:
              type: string
              pattern: ^([^\\\"]){1,50}$
            objectVersion:
              type: object
              properties:
                currentVersion:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 1
                newVersion:
                  type: integer
                  default: 1
                  minimum: 1
                  maximum: 100
              required:
                - currentVersion
                - newVersion
              x-apidog-orders:
                - currentVersion
                - newVersion
              x-apidog-ignore-properties: []
            supplierAction:
              type: string
              enum:
                - CANCEL
                - CLOSE
                - ABANDON
              x-apidog-enum:
                - value: CANCEL
                  name: ''
                  description: ''
                - value: CLOSE
                  name: ''
                  description: ''
                - value: ABANDON
                  name: ''
                  description: ''
            supplierRemarks:
              type: string
              pattern: '^([^\\\"]){1,100}$ '
            statusTransition:
              type: object
              properties:
                currentStatus:
                  type: string
                  enum:
                    - CREATED
                    - SENT TO BUYER
                    - ACCEPTED
                    - REJECTED
                    - UNDER REVIEW
                    - CANCELLED
                    - DELETED
                    - PARTIALLY PAID
                    - FULLY PAID
                    - CLOSED
                    - ABANDONED
                    - PAYMENT INITIATED
                    - PARTIALLY PAID AND PAYMENT INITIATED
                  x-apidog-enum:
                    - value: CREATED
                      name: ''
                      description: ''
                    - value: SENT TO BUYER
                      name: ''
                      description: ''
                    - value: ACCEPTED
                      name: ''
                      description: ''
                    - value: REJECTED
                      name: ''
                      description: ''
                    - value: UNDER REVIEW
                      name: ''
                      description: ''
                    - value: CANCELLED
                      name: ''
                      description: ''
                    - value: DELETED
                      name: ''
                      description: ''
                    - value: PARTIALLY PAID
                      name: ''
                      description: ''
                    - value: FULLY PAID
                      name: ''
                      description: ''
                    - value: CLOSED
                      name: ''
                      description: ''
                    - value: ABANDONED
                      name: ''
                      description: ''
                    - value: PAYMENT INITIATED
                      name: ''
                      description: ''
                    - value: PARTIALLY PAID AND PAYMENT INITIATED
                      name: ''
                      description: ''
                  description: |-
                    Current Status
                    Rule for this API -
                    If "supplierAction" is
                    "CANCEL" - SENT TO BUYER,
                    UNDER REVIEW, REJECTED
                    If "supplierAction" is
                    "CLOSE" - SENT TO BUYER,
                    UNDER REVIEW, ACCEPTED,
                    PARTIALLY PAID
                    If "supplierAction" is
                    "ABANDON" - SENT TO
                    BUYER, UNDER REVIEW,
                    ACCEPTED, PARTIALLY PAID
                newStatus:
                  type: string
                  enum:
                    - CREATED
                    - SENT TO BUYER
                    - ACCEPTED
                    - REJECTED
                    - UNDER REVIEW
                    - CANCELLED
                    - DELETED
                    - PARTIALLY PAID
                    - FULLY PAID
                    - CLOSED
                    - ABANDONED
                    - PAYMENT INITIATED
                    - PARTIALLY PAID AND PAYMENT INITIATED
                  x-apidog-enum:
                    - value: CREATED
                      name: ''
                      description: ''
                    - value: SENT TO BUYER
                      name: ''
                      description: ''
                    - value: ACCEPTED
                      name: ''
                      description: ''
                    - value: REJECTED
                      name: ''
                      description: ''
                    - value: UNDER REVIEW
                      name: ''
                      description: ''
                    - value: CANCELLED
                      name: ''
                      description: ''
                    - value: DELETED
                      name: ''
                      description: ''
                    - value: PARTIALLY PAID
                      name: ''
                      description: ''
                    - value: FULLY PAID
                      name: ''
                      description: ''
                    - value: CLOSED
                      name: ''
                      description: ''
                    - value: ABANDONED
                      name: ''
                      description: ''
                    - value: PAYMENT INITIATED
                      name: ''
                      description: ''
                    - value: PARTIALLY PAID AND PAYMENT INITIATED
                      name: ''
                      description: ''
                  description: |-
                    new Status
                    Rule - based on the status in
                    "supplierAction" it should be
                    - CANCELLED, CLOSED,
                    ABANDONED
              required:
                - currentStatus
                - newStatus
              x-apidog-orders:
                - currentStatus
                - newStatus
              x-apidog-ignore-properties: []
          required:
            - objectId
            - supplierInvoiceNumber
            - objectVersion
            - supplierAction
            - supplierRemarks
            - statusTransition
          x-apidog-orders:
            - objectId
            - supplierInvoiceNumber
            - objectVersion
            - supplierAction
            - supplierRemarks
            - statusTransition
          x-apidog-ignore-properties: []
      required:
        - device
        - b2bIds
        - invoiceStatus
      x-apidog-orders:
        - device
        - b2bIds
        - invoiceStatus
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://ekpayout-uat.enkash.in
    description: Testing Env
security: []

```
