# Accounting subscription detect

`POST /accounting/subscriptions/detect` · Rivier · accounting

Ask Skerry to find subscriptions in charges from the customer's activity, a statement or mail receipts.

- Scope: accounting:write
- Graphql: Mutation.accountingDetectSubscriptions
- Sdk: accounting.subscription.detect
- Cli: accounting subscription detect

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "charges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "The day of the charge, YYYY-MM-DD."
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 0,
            "description": "The charge in minor units."
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "The currency, three letters."
          },
          "merchant": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Who was paid."
          }
        },
        "required": [
          "date",
          "amountMinor",
          "currency",
          "merchant"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 500,
      "description": "Charges from the customer's activity, a statement or mail receipts."
    }
  },
  "required": [
    "charges"
  ],
  "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/subscriptions/detect' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "charges": [
    {
      "date": "string",
      "amountMinor": 0,
      "currency": "string",
      "merchant": "string"
    }
  ]
}'
```
