{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nmi/json-schema/nmi-query-invoicing-response-schema.json",
  "title": "Response - Invoicing Report Type",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nmi-data-and-transaction-reporting-api-openapi.yml#/components/schemas/QueryInvoicingResponse",
  "type": "object",
  "properties": {
    "nm_response": {
      "type": "object",
      "properties": {
        "invoice_report": {
          "type": "object",
          "properties": {
            "invoice": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "invoice_id": {
                    "type": "string",
                    "description": "Unique identifier for the invoice"
                  },
                  "amount": {
                    "type": "string",
                    "description": "Total amount of the invoice"
                  },
                  "status": {
                    "type": "string",
                    "description": "Status of the invoice"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency code for the invoice amount"
                  },
                  "order_description": {
                    "type": "string",
                    "description": "Description of the order"
                  },
                  "customer_id": {
                    "type": "string",
                    "description": "Unique identifier for the customer"
                  },
                  "customer_tax_id": {
                    "type": "string",
                    "description": "Tax ID associated with the customer"
                  },
                  "order_id": {
                    "type": "string",
                    "description": "Unique identifier for the order"
                  },
                  "po_number": {
                    "type": "string",
                    "description": "Purchase order number"
                  },
                  "tax_amount": {
                    "type": "string",
                    "description": "Total tax amount for the invoice"
                  },
                  "shipping_amount": {
                    "type": "string",
                    "description": "Total shipping amount for the invoice"
                  },
                  "discount_amount": {
                    "type": "string",
                    "description": "Total discount amount for the invoice"
                  },
                  "created": {
                    "type": "string",
                    "description": "Creation date of the invoice"
                  },
                  "terms": {
                    "type": "string",
                    "description": "Payment terms for the invoice"
                  },
                  "payments_applied": {
                    "type": "string",
                    "description": "Total payments applied to the invoice"
                  },
                  "billing": {
                    "type": "object",
                    "properties": {
                      "first_name": {
                        "type": "string",
                        "description": "First name for billing contact"
                      },
                      "last_name": {
                        "type": "string",
                        "description": "Last name for billing contact"
                      },
                      "address1": {
                        "type": "string",
                        "description": "Primary address line for billing"
                      },
                      "address2": {
                        "type": "string",
                        "description": "Secondary address line for billing"
                      },
                      "company": {
                        "type": "string",
                        "description": "Company name for billing"
                      },
                      "city": {
                        "type": "string",
                        "description": "City for billing"
                      },
                      "state": {
                        "type": "string",
                        "description": "State for billing"
                      },
                      "postal": {
                        "type": "string",
                        "description": "Postal code for billing"
                      },
                      "country": {
                        "type": "string",
                        "description": "Country for billing"
                      },
                      "email": {
                        "type": "string",
                        "description": "Email address for billing"
                      },
                      "phone": {
                        "type": "string",
                        "description": "Phone number for billing"
                      },
                      "fax": {
                        "type": "string",
                        "description": "Fax number for billing"
                      }
                    }
                  },
                  "shipping": {
                    "type": "object",
                    "properties": {
                      "first_name": {
                        "type": "string",
                        "description": "First name for shipping contact"
                      },
                      "last_name": {
                        "type": "string",
                        "description": "Last name for shipping contact"
                      },
                      "address1": {
                        "type": "string",
                        "description": "Primary address line for shipping"
                      },
                      "address2": {
                        "type": "string",
                        "description": "Secondary address line for shipping"
                      },
                      "company": {
                        "type": "string",
                        "description": "Company name for shipping"
                      },
                      "city": {
                        "type": "string",
                        "description": "City for shipping"
                      },
                      "state": {
                        "type": "string",
                        "description": "State for shipping"
                      },
                      "postal": {
                        "type": "string",
                        "description": "Postal code for shipping"
                      },
                      "country": {
                        "type": "string",
                        "description": "Country for shipping"
                      },
                      "email": {
                        "type": "string",
                        "description": "Email address for shipping"
                      },
                      "phone": {
                        "type": "string",
                        "description": "Phone number for shipping"
                      },
                      "fax": {
                        "type": "string",
                        "description": "Fax number for shipping"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}