# Consumer_Account_Cancel

Endpoint to cancel a consumer account using external_application_id.
**Requirements:**
- Authentication is required; the sponsor/partner must provide valid credentials.
- `external_application_id`: The external application ID must be provided in the request path to identify
the consumer account to cancel.
- `request_user_id`: The user ID in the Momnt system must be included in the request payload. The user
must be active and previously established (e.g., via pre-onboarding or create_user).
- Only users with appropriate permissions (Admin, Salesmanager, or the original Salesrep who sent
the invitation) may cancel the account.
- If the consumer account has any activity (e.g., amount spent > 0), cancellation will be forbidden.
- On success, the consumer account will be deactivated and the application status updated to "Cancelled".

Endpoint: POST /api/v1/sponsor/consumers/accounts/cancel/
Version: 1.0.0 (sponsor_consumer_v1)
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Request fields (application/json):

  - `request_user_id` (string, required)
    The ID of the user in the partner system making the application soft pull request.

  - `external_application_id` (string, required)
    The unique identifier in the partner system for this loan application.

## Response 200:

  - `200` (unknown)
    Success response

## Response 200 fields (application/json):

  - `detail` (string, required)

## Response 400:

  - `400` (unknown)
    Bad Request - Invalid request data

## Response 400 fields (application/json):

  - `detail` (string, required)

## Response 403:

  - `403` (unknown)
    Forbidden - Consumer account has activity and cannot be cancelled

## Response 403 fields (application/json):

  - `detail` (string, required)

## Response 404:

  - `404` (unknown)
    Not Found - Consumer account or invitation not found

## Response 404 fields (application/json):

  - `detail` (string, required)

## Response 200 examples:

  - `Success` (unknown)

## Response 400 examples:

  - `Bad Request` (unknown)

## Response 403 examples:

  - `Forbidden` (unknown)

## Response 404 examples:

  - `Not Found` (unknown)

## Callback:

  - `Consumer Account Cancel Callback` (unknown)
    **Consumer Account Cancel Callback (POST)**
**Overview**
After the loan cancellation is processed, Momnt will send a
callback to the sponsor_callback_url with details about the consumer's application.
**Requirements**
- A successful POST request must have been made to cancel the consumer account.
- Basic authentication (username/password) is supported and pre-shared between Momnt and the sponsor.

## Callback response 200:

  - `200` (unknown)
    No response body

