> For the complete documentation index, see [llms.txt](https://developers.gormic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gormic.com/api-reference/order-management/invoices.md).

# Invoices

## POST /v1/om/invoices

> Creates a new invoice associated with specified order.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Order Management & POS API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"CreateInvoiceApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/CreateInvoice_Params"}},"required":["params"]},"CreateInvoice_Params":{"type":"object","properties":{"orderId":{"type":"string"},"type":{"type":"string","enum":["credit-note","debit-note","prepayment","standard"]},"referenceInvoiceId":{"type":"string"},"applyExpiresAt":{"type":"string"}},"required":["orderId"]},"CreateInvoiceApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/CreateInvoice_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"CreateInvoice_Data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"CreateInvoiceApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateInvoice_Error"}},"required":["error"]},"CreateInvoice_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/CreateInvoice_ErrorCodes_enum"}]}},"required":["code"]},"CreateInvoice_ErrorCodes_enum":{"type":"string","enum":["NON_STANDARD_REF_INVOICE","ORDER_CANCELED","ORDER_CLOSED","REF_INVOICE_NOT_FOUND","REF_INVOICE_STILL_OPEN","TYPE_NOT_SUPPORTED"]}}},"paths":{"/v1/om/invoices":{"post":{"description":"","operationId":"Invoices_create","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceApiError"}}}}},"summary":"Creates a new invoice associated with specified order.","tags":["Invoices"]}}}}
```

## DELETE /v1/om/invoices/{uid}

> Delates an invoice.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Order Management & POS API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"DeleteInvoiceApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/DeleteInvoice_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"DeleteInvoice_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]},"DeleteInvoiceApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/DeleteInvoice_Error"}},"required":["error"]},"DeleteInvoice_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/DeleteInvoice_ErrorCodes_enum"}]}},"required":["code"]},"DeleteInvoice_ErrorCodes_enum":{"type":"string","enum":["INVOICE_CLOSED","INVOICE_CONTAIN_LINES","INVOICE_NOT_FOUND","NOT_ALLOWED","NotFound","ORDER_CANCELED","ORDER_CLOSED"]}}},"paths":{"/v1/om/invoices/{uid}":{"delete":{"description":"","operationId":"Invoices_delete","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteInvoiceApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteInvoiceApiError"}}}}},"summary":"Delates an invoice.","tags":["Invoices"]}}}}
```

## PATCH /v1/om/invoices/{uid}

> Updates an invoice.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Order Management & POS API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"UpdateInvoiceApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/UpdateInvoice_Params"}},"required":["params"]},"UpdateInvoice_Params":{"type":"object","properties":{"orderId":{"type":"string"},"id":{"type":"string"},"referenceInvoiceId":{"type":"string"},"applyExpiresAt":{"type":"string"}},"required":["orderId","id"]},"UpdateInvoiceApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/UpdateInvoice_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"UpdateInvoice_Data":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"UpdateInvoiceApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateInvoice_Error"}},"required":["error"]},"UpdateInvoice_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/UpdateInvoice_ErrorCodes_enum"}]}},"required":["code"]},"UpdateInvoice_ErrorCodes_enum":{"type":"string","enum":["NoChanges","NotFound"]}}},"paths":{"/v1/om/invoices/{uid}":{"patch":{"description":"","operationId":"Invoices_001_update","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceApiError"}}}}},"summary":"Updates an invoice.","tags":["Invoices"]}}}}
```

## PATCH /v1/om/invoices/{uid}/close

> Finalizes and closes an invoice.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Order Management & POS API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"CloseInvoiceApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/CloseInvoice_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"CloseInvoice_Data":{"type":"object","properties":{"invoiceNumber":{"type":"number"},"invoiceSource":{"type":"string"},"invoicedAt":{"type":"string"}},"required":["invoiceNumber","invoiceSource","invoicedAt"]},"CloseInvoiceApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CloseInvoice_Error"}},"required":["error"]},"CloseInvoice_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/CloseInvoice_ErrorCodes_enum"}]}},"required":["code"]},"CloseInvoice_ErrorCodes_enum":{"type":"string","enum":["ALREADY_CLOSED","CUSTOMER_REQUIRED","DRAFT_LINES_EXISTS","GIFT_CARD_RECIPIENT_NOT_EXIST","INVALID_GIFT_CARD_RECIPIENT_PHONE","INVOICE_EMPTY","MISSING_GIFT_CARD_RECIPIENT","ORDER_CANCELED","ORDER_CLOSED","ORDER_NOT_CLOSED","PAYMENT_NOT_COMPLETE"]}}},"paths":{"/v1/om/invoices/{uid}/close":{"patch":{"operationId":"Invoices_close","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseInvoiceApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseInvoiceApiError"}}}}},"summary":"Finalizes and closes an invoice.","tags":["Invoices"]}}}}
```

## POST /v1/om/invoices/{uid}/send

> Sends invoice via email to customer.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Order Management & POS API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"EmailInvoiceApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/EmailInvoice_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"EmailInvoice_Data":{"type":"object","properties":{"success":{"type":"boolean"},"messageId":{"type":"string"}},"required":["success"]},"EmailInvoiceApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/EmailInvoice_Error"}},"required":["error"]},"EmailInvoice_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/EmailInvoice_ErrorCodes_enum"}]}},"required":["code"]},"EmailInvoice_ErrorCodes_enum":{"type":"string","enum":["EMAIL_NOT_DEFINED","INVOICE_NOT_CLOSED","INVOICE_NOT_FOUND","INVOICE_NOT_GENERATED"]}}},"paths":{"/v1/om/invoices/{uid}/send":{"post":{"operationId":"Invoices_updateModifier","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailInvoiceApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailInvoiceApiError"}}}}},"summary":"Sends invoice via email to customer.","tags":["Invoices"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.gormic.com/api-reference/order-management/invoices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
