---
title: "Get the next invoice number · Invoices · COUNT Partner API"
description: "Returns the number COUNT would assign to the next invoice, estimate, or credit memo. GET /partners/invoices/generate/number"
canonical: "https://developers.getcount.com/reference/invoices/get-next-invoice-number"
source: "https://developers.getcount.com/reference/invoices/get-next-invoice-number"
---
[Invoices](https://developers.getcount.com/reference/invoices) / Get the next invoice number

# Get the next invoice number

GET `/partners/invoices/generate/number`

Returns the number COUNT would assign to the next invoice, estimate, or credit memo.

Numbering is tracked per document type, so pass `invoiceType` to number an estimate or credit memo rather than an invoice. The response carries `number` when the workspace numbers sequentially, or `lastNumber` when the most recent document used a non-numeric reference the API cannot increment — in that case pick the next reference yourself. The number is not reserved, so two calls before either invoice is created return the same value.

HMAC signature + Bearer access token

[Try this request](https://developers.getcount.com/tools/try-it?method=GET&path=%2Fpartners%2Finvoices%2Fgenerate%2Fnumber)

[Credit Memos API](https://developers.getcount.com/reference/credit-memo) [Customers API](https://developers.getcount.com/reference/customers) [Products & Services API](https://developers.getcount.com/reference/products-and-services) [Transactions API](https://developers.getcount.com/reference/transactions)

#### Query parameters

`invoiceType` enum optional

Which numbering sequence to read. Defaults to invoice.

One of: `invoice`, `estimate`, `memo`

#### Responses

`200` The next sequential number. `lastNumber` is returned instead when the latest number is non-numeric.

`401` Missing or invalid HMAC signature, expired timestamp, or invalid Bearer token. [Troubleshoot](https://developers.getcount.com/getting-started/errors#error-401)

`403` The credential does not have access to this workspace or resource. [Troubleshoot](https://developers.getcount.com/getting-started/errors#error-403)

`429` Rate limit exceeded (100 requests per minute per clientId). Retry after the Retry-After header. [Troubleshoot](https://developers.getcount.com/getting-started/errors#error-429)

[Previous GET Get an invoice](https://developers.getcount.com/reference/invoices/get-invoice) [Next POST Create an invoice](https://developers.getcount.com/reference/invoices/create-invoice)

GET `https://api.getcount.com/partners/invoices/generate/number`

Request

```javascript
import crypto from 'node:crypto';

const BASE_URL = 'https://api.getcount.com';
const CLIENT_ID = process.env.COUNT_CLIENT_ID;
const CLIENT_SECRET = process.env.COUNT_CLIENT_SECRET;
const ACCESS_TOKEN = process.env.COUNT_ACCESS_TOKEN;

const method = 'GET';
const signingPath = '/invoices/generate/number';
const timestamp = Math.floor(Date.now() / 1000).toString();
const bodyString = '';

const bodyHash = '';
const baseString = `${method}:${signingPath}:${timestamp}:${bodyHash}`;
const signature = crypto.createHmac('sha256', CLIENT_SECRET).update(baseString).digest('hex');

const response = await fetch(`${BASE_URL}/partners/invoices/generate/number`, {
  method,
  headers: {
    'x-client-id': CLIENT_ID,
    'x-timestamp': timestamp,
    'x-signature': signature,
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
});

console.log(await response.json());
```

Response · 200

```json
{
  "status": "Success",
  "message": "Success on generating invoice number",
  "data": {
    "result": {
      "number": 1043
    }
  }
}
```
