# Record money received from a customer, spread over invoices

`POST /accounting/receipts-in` · Rivier · accounting

Record money received from a customer, spread over invoices; the rest stays their credit.

- Scope: accounting:write
- Sdk: accounting.customer.receive
- Cli: accounting customer receive

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "contactKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 254
    },
    "amountMinor": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 99999999999
    },
    "currency": {
      "type": "string",
      "pattern": "^[a-z]{3}$"
    },
    "method": {
      "type": "string",
      "enum": [
        "manual",
        "provider"
      ],
      "default": "manual"
    },
    "receivedAt": {
      "type": "string",
      "format": "date-time"
    },
    "ref": {
      "type": "string",
      "maxLength": 120,
      "default": ""
    },
    "note": {
      "type": "string",
      "maxLength": 300,
      "default": ""
    },
    "allocations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid"
          },
          "amountMinor": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 99999999999
          }
        },
        "required": [
          "invoiceId",
          "amountMinor"
        ],
        "additionalProperties": false
      },
      "maxItems": 100,
      "default": []
    },
    "keepRemainder": {
      "type": "boolean",
      "default": true
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "contactKey",
    "amountMinor",
    "currency",
    "idempotencyKey"
  ],
  "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 POST 'https://api.rivier.ai/accounting/receipts-in' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "contactKey": "string",
  "amountMinor": 0,
  "currency": "string",
  "idempotencyKey": "string"
}'
```
