# Error Codes

## Seller CRUD Errors

<div className="code-nowrap-table dense-table">

| HTTP Status | Error Code |
| :---- | :---- |
| `400 Bad Request` | `DUPLICATE_PROVIDER_MAPPING`<br />Duplicate `(provider.id, payment_method_type)` combination found. |
| `400 Bad Request` | `VALIDATION_ERROR`<br />Request body fails validation. |
| `400 Bad Request` | `INVALID_PROVIDER`<br />The provider `id` is not valid. |
| `401 Unauthorized` | —<br />Invalid or missing API keys. |
| `403 Forbidden` | `FORBIDDEN`<br />Account not found or unauthorized. |
| `404 Not Found` | `FRANCHISE_MAPPING_NOT_FOUND`<br />No seller mapping exists for the given ID. |
| `409 Conflict` | `FRANCHISE_MAPPING_ALREADY_EXISTS`<br />mapping with this `merchant_seller_id` already exists. |

</div>

## Payment Request Errors

<div className="code-nowrap-table dense-table">

| HTTP Status | Error Code |
| :---- | :---- |
| `400 Bad Request` | `MUTUALLY_EXCLUSIVE_SELLER_REFERENCE`<br />Both `seller_id` and `merchant_seller_id` were sent together. |

</div>

## Franchise Resolution (Non-Blocking)

These scenarios do **not** return errors to the merchant. The payment always proceeds:

| Scenario | Behavior |
| :---- | :---- |
| Mapping found for routed provider | Payment uses the resolved `merchant_id` and type-specific detail. |
| No mapping for routed provider / `payment_method_type` | Warning logged, original `merchant_id` from connection used. |
| No `payment_method` data for this seller | Warning logged, original `merchant_id` from connection used. |
| Franchise resolution service unavailable | Error logged, original `merchant_id` from connection used. |
| Neither `seller_id` nor `merchant_seller_id` present | Franchise resolution skipped entirely — no impact. |