# RevCent MCP Operation: `EditBinProfile`

This document explains the `EditBinProfile` MCP operation and how an MCP should safely edit an existing BIN Profile.

A BIN Profile stores a list of credit card BINs. A BIN is the first 6 digits of a credit card number. BIN Profiles may be used for organization, review, reporting, or advanced Payment Profile filtering/routing.

This file is specifically about editing an existing BIN Profile.

Source:
- RevCent API/MCP schema for `EditBinProfile`

---

## Operation Summary

`EditBinProfile` edits a previously created BIN Profile using the required `bin_profile_id`.

The operation can update:

- `name`
- `description`
- `enabled`
- `bin_6`

Important schema behavior:

```text
Only include the properties you wish to modify.
```

For example, if only the name should change, only include `name`.

If only the enabled state should change, only include `enabled`.

Do not include fields unnecessarily.

---

# Critical Rule: `bin_6` Replaces the Full BIN Array

When editing a BIN Profile, `bin_6` is an overwrite field.

If the `bin_6` array is present in the request, it replaces the existing BIN array.

It does **not** append.

It does **not** insert one new BIN.

It does **not** merge with the existing BIN list.

It replaces the entire list.

This is the most important rule for MCP to understand when editing BIN Profiles.

---

## What This Means

If the existing BIN Profile contains:

```json
[
  "411111",
  "422222",
  "433333"
]
```

and MCP submits:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "444444"
  ]
}
```

the resulting BIN Profile will contain only:

```json
[
  "444444"
]
```

The previous values are removed:

```text
411111 removed
422222 removed
433333 removed
```

To add `444444` while keeping the existing values, the MCP must submit the complete desired final array:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111",
    "422222",
    "433333",
    "444444"
  ]
}
```

---

## Required MCP Behavior When Editing `bin_6`

Before including `bin_6` in an `EditBinProfile` request, MCP must ensure the array contains every BIN that should remain after the edit.

MCP should treat `bin_6` as:

```text
set the full BIN list to this exact array
```

not:

```text
add this BIN
```

not:

```text
remove this BIN
```

not:

```text
patch this list
```

Recommended workflow:

1. Determine the existing BIN list.
2. Determine the requested change.
3. Build the complete desired final `bin_6` array.
4. Confirm that all existing BINs that should remain are included.
5. Validate every BIN format.
6. Submit `EditBinProfile` with the full desired array.
7. If interacting with a human user, show the final array before submitting.

---

# Required Input

| Field | Type | Required | Description |
|---|---:|---:|---|
| `bin_profile_id` | string | Yes | 20-character BIN Profile ID to edit. |

Optional fields:

| Field | Type | Description |
|---|---:|---|
| `name` | string | New BIN Profile name. Must be unique from other BIN Profile names. |
| `description` | string | New BIN Profile description. |
| `enabled` | boolean | Whether the BIN Profile is enabled. |
| `bin_6` | array<string> | Full replacement array of 6-digit BIN strings. If provided, it overwrites the existing BIN list. |

---

## `bin_profile_id`

The `bin_profile_id` is required.

Example:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX"
}
```

The ID must refer to the existing BIN Profile being edited.

---

## `name`

Use `name` to rename the BIN Profile.

Example:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "name": "Business A - Updated BIN List"
}
```

Rules:

- Must be unique.
- Should clearly explain the purpose of the BIN Profile.
- Should not be vague.

Good names:

```text
Business A - BIN Review List
Known Prepaid BINs
High Decline BIN List
Gateway Review BINs
International BIN Watchlist
```

Avoid:

```text
BINs
Profile 1
Test
List
```

---

## `description`

Use `description` to update the explanation of the BIN Profile.

A good description should explain:

- Why the BIN Profile exists.
- Whether it is for review, reporting, filtering, or advanced Payment Profile use.
- Whether it is intended for routing or blocking.
- Whether the BIN list was provided by the user.
- Whether it should be reviewed before production use.

Example:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "description": "User-provided 6-digit BIN list for review and possible future advanced Payment Profile filtering. This BIN Profile does not block or route payments by itself."
}
```

---

## `enabled`

Use `enabled` to enable or disable the BIN Profile.

Enable:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "enabled": true
}
```

Disable:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "enabled": false
}
```

Important:

Even if a BIN Profile is enabled, it does not affect payment behavior unless another workflow references it, such as a Payment Profile using `filter_bin_profile`.

---

# Editing `bin_6`

`bin_6` is the array of 6-digit BIN strings associated with the BIN Profile.

Example:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111",
    "422222",
    "433333"
  ]
}
```

This request sets the BIN Profile’s BIN list to exactly those three BINs.

---

## Adding a BIN

To add a BIN, MCP must submit the complete final list.

Existing list:

```json
[
  "411111",
  "422222"
]
```

User wants to add:

```text
433333
```

Correct request:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111",
    "422222",
    "433333"
  ]
}
```

Incorrect request:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "433333"
  ]
}
```

The incorrect request would remove `411111` and `422222`.

---

## Removing a BIN

To remove a BIN, MCP must submit the complete final list without the removed BIN.

Existing list:

```json
[
  "411111",
  "422222",
  "433333"
]
```

User wants to remove:

```text
422222
```

Correct request:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111",
    "433333"
  ]
}
```

This sets the list to `411111` and `433333`.

---

## Replacing the Entire BIN List

If the user wants to replace the full BIN list, submit the new full list.

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "555555",
    "566666",
    "577777"
  ]
}
```

This intentionally removes all previous BIN values.

MCP should only do this when the user clearly wants a full replacement.

---

## Clearing the BIN List

If the API accepts an empty array, then submitting:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": []
}
```

should be treated as an intentional request to clear the list.

MCP should never clear a BIN list accidentally.

If a human user is interacting, MCP should ask for explicit confirmation before submitting an empty `bin_6` array.

Recommended confirmation:

```text
You are about to replace the BIN Profile's BIN list with an empty array. This will remove all BINs from the profile. Please confirm that you want to clear the BIN list.
```

---

# BIN Format Validation

Every `bin_6` value must be a 6-digit string.

Valid:

```json
"411111"
```

Invalid:

```json
411111
```

Invalid:

```json
"41111"
```

Invalid:

```json
"4111111"
```

Invalid:

```json
"411-111"
```

Invalid:

```json
"4111111111111111"
```

MCP should validate every BIN before calling `EditBinProfile`.

Each BIN must:

- Be exactly 6 characters.
- Contain digits only.
- Be represented as a string.
- Not be a full card number.
- Not include spaces, dashes, or symbols.

---

# Do Not Store Sensitive Payment Data

A BIN Profile should only store the first 6 digits of a card.

MCP should not include:

- Full card numbers.
- CVV values.
- Expiration dates.
- Cardholder names.
- Full track data.
- Any other sensitive payment credential data.

If the user provides full card data, MCP should not submit it. It should ask for only the first 6 digits if a BIN Profile edit is still needed.

---

# Advanced Use: Payment Profile Filtering or Routing

A BIN Profile may be used inside a Payment Profile as an advanced filtering/routing mechanism.

This is an advanced payment capability and should only be used when the user has advanced payment needs.

Examples:

- Route matching BINs to a specific gateway group.
- Route matching BINs away from a specific gateway group.
- Apply special handling for known high-decline BINs.
- Send known BIN groups through a fallback path.
- Abort processing for a user-confirmed blocked BIN list.
- Separate routing by business/corp strategy.
- Record metadata when specific BINs are used.

Important:

```text
Editing a BIN Profile that is used in a Payment Profile can affect payment routing.
```

If a BIN Profile is already used by a Payment Profile, changing `bin_6` may change which cards match the payment flow filter.

This can affect:

- Gateway routing.
- Blocking behavior.
- Fallback behavior.
- Abort paths.
- Reporting/metadata behavior.

MCP should treat `bin_6` edits carefully when the BIN Profile is connected to payment-routing logic.

---

## MCP Warning for Advanced Payment Use

If the BIN Profile is intended for Payment Profile filtering or routing, MCP should warn:

```text
BIN-based filtering or routing inside a Payment Profile is an advanced payment-routing capability. Editing this BIN Profile may affect how credit card payments are routed, blocked, aborted, or processed. Please confirm the final BIN list and the intended payment behavior before changes are made.
```

---

# Safe Edit Workflow

Recommended MCP workflow:

1. Confirm the `bin_profile_id`.
2. Identify which fields need to change.
3. Only include fields that should be modified.
4. If editing `bin_6`, determine the complete desired final BIN list.
5. Do not submit a partial `bin_6` list unless the user wants to replace the full list with only those values.
6. Validate every BIN as a 6-digit string.
7. Remove duplicates if appropriate, or warn the user.
8. If human in the loop, show the final `bin_6` array before submitting.
9. If the BIN Profile may be used in Payment Profiles, warn about payment-routing impact.
10. Submit `EditBinProfile`.
11. Save the returned `bin_profile_id`.

---

# Human Review Before Editing `bin_6`

If interacting with a human user, MCP should display the final BIN array before submitting.

Recommended message:

```text
The `bin_6` array replaces the full existing BIN list. It does not append. Below is the full BIN list I will save. Please confirm that every BIN that should remain is present.
```

Example review:

```json
{
  "bin_6": [
    "411111",
    "422222",
    "433333",
    "444444"
  ]
}
```

The user should approve or request changes before the MCP submits the edit.

---

# MCP Questions Before Editing a BIN Profile

Before calling `EditBinProfile`, MCP should ask:

1. Which BIN Profile should be edited?
2. Which fields should be changed?
3. Is the edit only to name, description, or enabled state?
4. Is `bin_6` being changed?
5. If `bin_6` is being changed, what is the complete final BIN list?
6. Is the user adding one or more BINs?
7. Is the user removing one or more BINs?
8. Is the user replacing the full list?
9. Has the user confirmed that `bin_6` overwrites the full list if provided?
10. Are all BINs exactly 6 digits?
11. Are any full card numbers or sensitive payment data present?
12. Is this BIN Profile used in a Payment Profile?
13. If used in a Payment Profile, could this edit affect routing, blocking, or filtering?
14. Should the related Payment Profile be reviewed after the BIN edit?

---

# Common Mistakes

## Mistake: Trying to Append One BIN

Incorrect:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "444444"
  ]
}
```

This does not append `444444`.

It replaces the whole list with only `444444`.

---

## Mistake: Omitting Existing BINs That Should Remain

If existing BINs should remain, they must be included in the request.

Correct:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111",
    "422222",
    "444444"
  ]
}
```

---

## Mistake: Including Full Card Numbers

Incorrect:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "4111111111111111"
  ]
}
```

Correct:

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111"
  ]
}
```

---

## Mistake: Assuming a BIN Profile Blocks Payments

Editing a BIN Profile does not automatically block payments.

Blocking only happens if a Payment Profile is configured to use the BIN Profile and route matches to `action_abort_flow`.

---

# Validation Checklist

Before submitting `EditBinProfile`:

1. `bin_profile_id` is present.
2. Only intended fields are included.
3. If `bin_6` is omitted, the existing BIN list will remain unchanged.
4. If `bin_6` is included, it contains the complete desired final list.
5. MCP is not attempting to append a single BIN by submitting only that BIN.
6. MCP is not accidentally removing existing BINs.
7. Every BIN is exactly 6 digits.
8. Every BIN is a string.
9. No full card numbers are included.
10. No CVV, expiration date, or cardholder data is included.
11. Duplicates have been reviewed.
12. If clearing the list, the user explicitly confirmed.
13. If the BIN Profile may be used in a Payment Profile, the user was warned about routing/filtering impact.
14. If human in the loop, the final `bin_6` array was shown for review.

---

# Example: Rename Only

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "name": "Business A - Updated BIN List"
}
```

Because `bin_6` is omitted, the existing BIN list remains unchanged.

---

# Example: Disable Only

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "enabled": false
}
```

Because `bin_6` is omitted, the existing BIN list remains unchanged.

---

# Example: Replace Full BIN List

```json
{
  "bin_profile_id": "XXXXXXXXXXXXXXXXXXXX",
  "bin_6": [
    "411111",
    "422222",
    "433333"
  ]
}
```

This sets the entire BIN list to exactly those values.

---

# Output Schema

A successful response returns:

```json
{
  "api_call_id": "XXXXXXXXXXXXXXXXXXXX",
  "api_call_unix": 1740000000,
  "code": 1,
  "bin_profile_id": "YYYYYYYYYYYYYYYYYYYY",
  "result": "..."
}
```

Fields:

| Field | Description |
|---|---|
| `api_call_id` | 20-character API call ID. |
| `api_call_unix` | Unix timestamp when the API call was initiated. |
| `code` | API response code. `1` indicates success. |
| `bin_profile_id` | 20-character BIN Profile ID. |
| `result` | Human-readable result message. |

---

# Quick Reference

Most important rule:

```text
If bin_6 is present, it replaces the full existing BIN array.
```

To add one BIN:

```text
Fetch/know existing BINs → append new BIN locally → submit full final bin_6 array
```

To remove one BIN:

```text
Fetch/know existing BINs → remove BIN locally → submit full final bin_6 array
```

To rename or enable/disable only:

```text
Omit bin_6 entirely
```

Core MCP rule:

```text
Never submit bin_6 unless it contains every BIN that should remain after the edit.
```


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.