# Map a person's main account to a savings account

Maps a person's savings account to their main (checking) account and then
triggers the remaining steps for savings account onboarding. The person
may only transfer money to and from their savings account using the main
account mapped by this request.

Endpoint: POST /v1/persons/{person_id}/deposit_accounts/{account_id}/mappings
Version: 1.0

## Path parameters:

  - `person_id` (string, required)
    Unique ID of a person.
    Example: "111110faed3c03261a08e2660c0c08bdcper"

  - `account_id` (string, required)
    Unique ID of a Solaris account.
    Example: "e48c29b85992b8772eb7ddd518490920cacc"

## Request fields (application/json):

  - `main_account_id` (string, required)
    ID of the main account.
    Example: "148c29b85992b8772eb7ddd518490110cacc"

  - `deposit_type` (string, required)
    The account type.
    Enum: "SAVINGS_ACCOUNT"

  - `reference` (string, required)
    UUID to use as an idempotency reference for the transaction.
    Example: "162ddd7e-790c-5963-908f-4cedfd30f9a1"

## Response 202 fields (application/json):

  - `id` (string, required)
    ID of the mapping between the main account and the savings account.
    Example: "d222a0b8-07ea-49be-83c1-68719be286e8"

  - `main_account_id` (string, required)
    ID of the main account.
    Example: "148c29b85992b8772eb7ddd518490110cacc"

  - `deposit_type` (string, required)
    The account type.
    Enum: "SAVINGS_ACCOUNT"

  - `reference` (string, required)
    UUID to use as an idempotency reference for the transaction.
    Example: "162ddd7e-790c-5963-908f-4cedfd30f9a1"

  - `status` (string)
    The current status of the savings account.
    Enum: "OPENED", "TAX_REGISTERED", "ACTIVE", "INACTIVE", "FAILED"

## Response 400 fields (application/json):

  - `errors` (array)
    Example: [{"id":"ab9bc911-d5bb-481e-bdf5-ce006d96fa0c","status":400,"code":"validation_error","title":"Validation Error","detail":"The request could not be processed due to invalid input.","error_code":"invalid_request","source":{"field":"key","message":"One or more request parameters are missing or malformed."}}]

  - `errors.id` (string)
    Unique identifier for this error occurrence. Include it when contacting support.

  - `errors.status` (integer)
    The HTTP status code.

  - `errors.code` (string)
    The error category.

  - `errors.title` (string)
    Human-readable summary of the error category.

  - `errors.detail` (string)
    Human-readable explanation of this specific error.

  - `errors.error_code` (string)
    Machine-readable code identifying the specific failure. Use this rather than parsing detail. Not returned on every error.

  - `errors.source` (object)
    The request field that caused the error. Returned for validation errors; omitted where no specific field applies.

  - `errors.source.field` (string)
    Name of the request field that failed the validation.

  - `errors.source.message` (string)
    Human-readable explanation of why this specific field was rejected.

## Response 403 fields (application/json):

  - `errors` (array)
    Example: [{"id":"c47d8b21-6e3f-4a82-b715-2d9e4f8a1c56","status":403,"code":"unauthorized_action","title":"Unauthorized Action","detail":"The authenticated client is not permitted to perform this action."}]

  - `errors.id` (string)
    Unique identifier for this error occurrence. Include it when contacting support.

  - `errors.status` (integer)
    The HTTP status code.

  - `errors.code` (string)
    The error category.

  - `errors.title` (string)
    Human-readable summary of the error category.

  - `errors.detail` (string)
    Human-readable explanation of this specific error.

  - `errors.error_code` (string)
    Machine-readable code identifying the specific failure. Not returned on every error.

## Response 404 fields (application/json):

  - `errors` (array)
    Example: [{"id":"1365d465-71e9-44a0-a2da-b02f090ff760","status":404,"code":"not_found","title":"Not Found","detail":"No resource exists at the given identifier.","error_code":"not_found"}]

  - `errors.id` (string)
    Unique identifier for this error occurrence. Include it when contacting support.

  - `errors.status` (integer)
    The HTTP status code.

  - `errors.code` (string)
    The error category.

  - `errors.title` (string)
    Human-readable summary of the error category.

  - `errors.detail` (string)
    Human-readable explanation of this specific error.

  - `errors.error_code` (string)
    Machine-readable code identifying the specific failure. Not returned on every error.

## Response 500 fields (application/json):

  - `errors` (array)
    Example: [{"id":"1365d465-71e9-44a0-a2da-b02f090ff760","status":500,"code":"generic_error","title":"Generic Error","detail":"An unexpected error occurred while processing the request.","error_code":"generic_error"}]

  - `errors.id` (string)
    Unique identifier for this error occurrence. Include it when contacting support so the failure can be traced.

  - `errors.status` (integer)
    The HTTP status code.

  - `errors.code` (string)
    The error category.

  - `errors.title` (string)
    Human-readable summary of the error category.

  - `errors.detail` (string)
    Human-readable explanation of this specific error.

  - `errors.error_code` (string)
    Machine-readable code identifying the specific failure. Not returned on every error.


