---
title: "Generate invoice number"
method: POST
path: "/v2/invoicing/generate-next-invoice-number"
tags: ["invoices"]
---

# Generate invoice number

`POST /v2/invoicing/generate-next-invoice-number`

Generates the next invoice number that is available to the merchant. The next invoice number uses the prefix and suffix from the last invoice number and increments the number by one. For example, the next invoice number after `INVOICE-1234` is `INVOICE-1235`.

## Request body

- Fetchtype — Is the fetch type invoice number or id.
  - `fetch_id` boolean — Optional to decide the number or ID.

## Response `200`

A successful request returns the HTTP `200 OK` status code and a JSON response body that shows the next invoice number.

- InvoiceNumber — The invoice number.
  - `invoice_number` string — The invoice number. If you omit this value, the default is the auto-incremented number from the last number.
  - `invoice_id` string — Resource Id.

## Other responses

- `400` — Invalid request.
- `403` — Authorization Error.
- `500` — An internal server error has occurred.
- `default` — The default response.

---

[API](https://skmtc.net/paypal/apis/payments.md) · [All operations](https://skmtc.net/paypal/apis/payments/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/paypal/payments/revisions/672aceee1190/schema)
