# Shop credit note request

`POST /invoices/{id}/credit-notes` · Rivier · shop

Ask for a credit note against a numbered invoice (the whole invoice or chosen lines). A person issues it.

- Scope: shop:write
- Mcp: rivier_invoices_credit_note_request
- Graphql: Mutation.requestCreditNote
- Sdk: shop.creditNote.request
- Cli: shop credit note request

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "full": {
      "type": "boolean",
      "default": false
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "default": 1
          },
          "unit": {
            "type": "string",
            "maxLength": 10,
            "default": "C62"
          },
          "unitAmountMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99999999999
          },
          "discountMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99999999999,
            "default": 0
          },
          "taxRateBp": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "taxCategory": {
            "type": "string",
            "enum": [
              "S",
              "Z",
              "E",
              "AE",
              "K",
              "G",
              "O",
              "L",
              "M"
            ],
            "default": "S"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "maxLength": 40
              },
              "id": {
                "type": "string",
                "maxLength": 120
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "description",
          "unitAmountMinor"
        ],
        "additionalProperties": false
      },
      "maxItems": 200,
      "default": []
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "reason",
    "idempotencyKey"
  ],
  "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/{id}/credit-notes' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "reason": "string",
  "idempotencyKey": "string"
}'
```
