---
title: "Create an invoice for an order"
method: POST
path: "/orders/{orderId}/invoices"
tags: ["Admin Sales: Orders"]
---

# Create an invoice for an order

`POST /orders/{orderId}/invoices`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/orders/{orderId}/invoices`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/orders/:orderId/invoices/post.ts> (a function with typed inputs; its response is checked against the schema)

Create an invoice for an order

## Path parameters

- `orderId` integer, required

## Request body

- object

## Response `201`

AdminInvoice resource created

- AdminInvoiceAdminInvoiceRestDto
  - `id` integer, nullable
  - `incrementId` string, nullable
  - `orderId` integer, nullable
  - `orderIncrementId` string, nullable
  - `state` string, nullable
  - `emailSent` boolean, nullable
  - `totalQty` integer, nullable
  - `orderCurrencyCode` string, nullable
  - `baseCurrencyCode` string, nullable
  - `channelCurrencyCode` string, nullable
  - `subTotal` number, nullable
  - `formattedSubTotal` string, nullable
  - `baseSubTotal` number, nullable
  - `formattedBaseSubTotal` string, nullable
  - `subTotalInclTax` number, nullable
  - `formattedSubTotalInclTax` string, nullable
  - `baseSubTotalInclTax` number, nullable
  - `formattedBaseSubTotalInclTax` string, nullable
  - `grandTotal` number, nullable
  - `formattedGrandTotal` string, nullable
  - `baseGrandTotal` number, nullable
  - `formattedBaseGrandTotal` string, nullable
  - `taxAmount` number, nullable
  - `formattedTaxAmount` string, nullable
  - `baseTaxAmount` number, nullable
  - `formattedBaseTaxAmount` string, nullable
  - `discountAmount` number, nullable
  - `formattedDiscountAmount` string, nullable
  - `baseDiscountAmount` number, nullable
  - `formattedBaseDiscountAmount` string, nullable
  - `shippingAmount` number, nullable
  - `formattedShippingAmount` string, nullable
  - `baseShippingAmount` number, nullable
  - `formattedBaseShippingAmount` string, nullable
  - `shippingAmountInclTax` number, nullable
  - `formattedShippingAmountInclTax` string, nullable
  - `baseShippingAmountInclTax` number, nullable
  - `formattedBaseShippingAmountInclTax` string, nullable
  - `shippingTaxAmount` number, nullable
  - `formattedShippingTaxAmount` string, nullable
  - `baseShippingTaxAmount` number, nullable
  - `formattedBaseShippingTaxAmount` string, nullable
  - `transactionId` string, nullable
  - `reminders` integer, nullable
  - `nextReminderAt` string, nullable
  - `createdAt` string, nullable
  - `updatedAt` string, nullable
  - `orderStatus` string, nullable
  - `orderStatusLabel` string, nullable
  - `orderDate` string, nullable
  - `channelName` string, nullable
  - `customerName` string, nullable
  - `customerEmail` string, nullable
  - `order` unknown[], nullable
    - unknown
  - `items` object[]

## Other responses

- `400`: Invalid input
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
