---
updatedAt: 2026-04-29T17:40:49.000Z
agentTools:
  projectIndex: https://docs.itispay.com/llms.txt
---

# Update invoice status

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Cryptocurrency Invoice API",
    "version": "1.1.0",
    "description": "REST API for generating and managing cryptocurrency invoices with support for multiple transactions per invoice",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    },
    "contact": {
      "name": "API Support",
      "email": "api@itispay.com",
      "url": "https://itispay.com/support"
    }
  },
  "servers": [
    {
      "url": "https://api.itispay.com",
      "description": "Production server"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Api-key",
        "description": "To obtain an API key, you must register on https://itispay.com. After successful registration, you can access your API key through your account dashboard. Provide your API key in the Api-key header as: Api-key: YOUR_API_KEY"
      }
    },
    "schemas": {
      "Invoice": {
        "type": "object",
        "properties": {
          "invoice_id": {
            "type": "string",
            "format": "uuid"
          },
          "order_id": {
            "type": "string"
          },
          "fiat_amount": {
            "type": "number",
            "format": "double"
          },
          "fiat_currency": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "currency_paid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Currency that was actually used for payment if different from the expected currency (e.g., USDT instead of USDC)"
          },
          "crypto_amount": {
            "type": "number",
            "format": "double"
          },
          "crypto_amount_in_units": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "actual_crypto_amount_paid": {
            "type": "number",
            "format": "double"
          },
          "actual_crypto_amount_paid_in_units": {
            "type": "integer",
            "format": "int64"
          },
          "allowed_error_percent": {
            "type": "integer"
          },
          "order_name": {
            "type": "string"
          },
          "expire_min": {
            "type": "integer"
          },
          "callback_url": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "pending",
              "completed",
              "expired",
              "cancelled",
              "paid_partial",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "blockchain_details": {
            "$ref": "#/components/schemas/BlockchainDetails"
          },
          "transactions": {
            "type": "array",
            "description": "Array of transactions associated with this invoice",
            "items": {
              "$ref": "#/components/schemas/InvoiceTransaction"
            }
          }
        }
      },
      "BlockchainDetails": {
        "type": "object",
        "properties": {
          "walletId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "blockchainAddress": {
            "type": "string"
          },
          "blockchainNetwork": {
            "$ref": "#/components/schemas/BlockchainNetwork"
          },
          "qrcode": {
            "type": "string"
          }
        }
      },
      "BlockchainNetwork": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "InvoiceTransaction": {
        "type": "object",
        "description": "Represents a transaction associated with an invoice",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier for the transaction record"
          },
          "invoice_id": {
            "type": "string",
            "format": "uuid",
            "description": "Reference to the parent invoice"
          },
          "transaction_id": {
            "type": "string",
            "format": "uuid",
            "description": "Internal transaction ID from balance service"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "description": "Transaction amount in the specified currency"
          },
          "tx_hash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Blockchain transaction hash (optional)"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (e.g., BTC, ETH, USDT)"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "failed",
              "cancelled"
            ],
            "description": "Transaction status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the transaction record was created"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the transaction record was last updated"
          }
        }
      },
      "UpdateInvoiceStatusRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "new",
              "pending",
              "completed",
              "expired",
              "cancelled",
              "paid_partial",
              "archived"
            ]
          },
          "comment": {
            "type": "string",
            "description": "Optional comment explaining the status change"
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "Name of the field that has the error"
          },
          "message": {
            "type": "string",
            "description": "Specific error message for the field"
          }
        }
      },
      "ErrorContent": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "HTTP status code"
          },
          "message": {
            "type": "string",
            "description": "Main error message"
          },
          "details": {
            "type": "array",
            "description": "Array of field-specific error details (optional, empty for non-validation errors)",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorContent"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Invoices",
      "description": "Invoice management operations"
    }
  ],
  "paths": {
    "/api/v1/invoices/{invoice_id}": {
      "patch": {
        "summary": "Update invoice status",
        "operationId": "updateInvoiceStatus",
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": 403,
                    "message": "Access denied",
                    "details": []
                  }
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": 404,
                    "message": "Invoice not found",
                    "details": []
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": 422,
                    "message": "Validation failed",
                    "details": [
                      {
                        "field": "status",
                        "message": "must be one of the allowed values"
                      }
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
```