# Создать счёт покупателю в МойСклад

export default function Layout(props) {
  const { OpenAPIPage } = props.components ?? {};
  return (
    <>
      {props.children}
      ## Создать счёт покупателю в МойСклад

`POST /api/v1/integrations/moysklad/documents/invoiceout`

**Авторизация:** dpop или oauth2: `integration:write`

**Тело запроса** (`application/json`, обязательное): MoySkladCreateInvoiceRequest
- `contractId`: string
- `counterpartyId`: string, обязательное
- `description`: string
- `moment`: string
- `name`: string
- `organizationId`: string, обязательное
- `paymentPlannedMoment`: string
- `positions`: массив object, обязательное
  - `assortmentId`: string, обязательное
  - `assortmentType`: "product" | "service" | "bundle" | "variant", обязательное
  - `discount`: number
  - `priceKopecks`: integer, обязательное
  - `quantity`: number, обязательное
  - `vat`: integer
- `projectId`: string

**Ответы**

- `200` — Создано (`application/json`, MoySkladGenericResponse)
- `400` — Некорректный запрос: не прошла валидация параметров или тела (`application/problem+json`, ProblemDetails)
- `401` — Токен отсутствует, недействителен или истёк (`application/problem+json`, ProblemDetails)
- `403` — Недостаточно прав или scope (`application/problem+json`, ProblemDetails)

    </>
  );
}
