# Shop invoice client

`PUT /invoices/{id}/client` · Rivier · shop

Set which client of the organisation an invoice is for (null clears it) and who receives it; without recipients they come from the client's primary and default-copied contacts.

- Scope: shop:write
- Mcp: rivier_invoices_client
- Graphql: Mutation.shopInvoiceClient
- Sdk: shop.invoice.client
- Cli: invoices client

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "clientId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "recipients": {
      "type": "object",
      "properties": {
        "to": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 200,
                "default": ""
              },
              "email": {
                "type": "string",
                "format": "email",
                "maxLength": 254
              },
              "contactId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": false
          },
          "maxItems": 5,
          "default": []
        },
        "cc": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 200,
                "default": ""
              },
              "email": {
                "type": "string",
                "format": "email",
                "maxLength": 254
              },
              "contactId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": false
          },
          "maxItems": 10,
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "clientId"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: 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 PUT 'https://api.rivier.ai/invoices/{id}/client' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "clientId": "string"
}'
```
