# Add a number series (gapless, optionally restarting each year)

`POST /invoices/series` · Rivier · shop

Add a number series (gapless, optionally restarting each year).

- Scope: shop:admin
- Sdk: shop.invoiceSeries.create
- Cli: shop invoice series create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,30}$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "invoice",
        "credit_note",
        "quote",
        "proposal"
      ],
      "default": "invoice"
    },
    "prefix": {
      "type": "string",
      "maxLength": 20,
      "default": ""
    },
    "padding": {
      "type": "integer",
      "minimum": 1,
      "maximum": 12,
      "default": 5
    },
    "resetRule": {
      "type": "string",
      "enum": [
        "never",
        "yearly"
      ],
      "default": "never"
    },
    "startAt": {
      "type": "integer",
      "minimum": 1,
      "maximum": 999999999,
      "default": 1
    },
    "jurisdiction": {
      "type": "string",
      "maxLength": 10,
      "default": ""
    }
  },
  "required": [
    "key"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/invoices/series' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "key": "string"
}'
```
