# Cancel subscriptions by customer

By using this method, the merchant can cancel all subscriptions for the specific customer.

Endpoint: POST /subscription/cancel-by-customer
Version: 1.0.0
Security: merchant, signature

## Security:

  - `merchant` (unknown)
    apiKey in header merchant

  - `signature` (unknown)
    apiKey in header signature

## Header parameters:

  - `merchant` (string, required)

  - `signature` (string, required)

## Request fields (application/json):

  - `customer_account_id` (string, required)
    Unique customer identifier defined by the merchant.
    Example: 93a1c659-288d-4d62-929d-10e241078faa

  - `force` (boolean)
    Sets the timing of subscription cancellation.
- `true` - cancels the subscription immediately
- `false` - cancels at the end of the billing period

  - `cancel_code` (string)
    Reason code that is used to cancel the subscription.
    Enum: "8.01", "8.02", "8.03", "8.04", "8.05", "8.06", "8.07", "8.08", "8.09", "8.10", "8.11", "8.12", "8.13", "8.14", "8.15"

## Response 200:

  - `200` (unknown)
    Request received

## Response 200 fields (application/json):

  - `status` (string)
    Subscription has been cancelled for the customer.
    Example: ok

  - `error` (object)
    Error object.

  - `error.code` (string, required)
    Error code that identifies the validation failure.
This code is returned when the input data does not meet the expected criteria.
    Enum: "2.01"

  - `error.messages` (object, required)
    Contains field-specific error messages.
Each key is a field name. Each value is an array of strings that describe validation issues.
    Example: {"subscription":["Validation error"]}

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code.
    Example: 2.01

  - `error.message` (string, required)
    Error message.
    Example: Validation error

  - `error.constraints` (object)
    Map of constraints.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code indicating the specific authorization failure.
    Example: 1.01

  - `error.message` (string, required)
    Descriptive message providing more details about the authorization failure.
    Example: Authorization failed

## Response 403:

  - `403` (unknown)
    Access denied

## Response 403 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code indicating that access to the service is denied.
    Example: 1.02

  - `error.message` (string, required)
    Message informing that the service is not allowed for the account.
    Example: Access denied

## Response 404:

  - `404` (unknown)
    Entity not found

## Response 404 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code.
    Example: 2.01

  - `error.message` (string, required)
    Error message.
    Example: {entityName} not found with id: {entityId}

