# RevCent MCP Guide: `ValidateUserShop`

AI/MCP-focused guide for validating a RevCent User Shop, also called a Third-Party Shop.

This document explains when to use `ValidateUserShop`, what it checks, and when to follow up with `FixUserShop`.

---

## Operation Summary

Operation:

```text
ValidateUserShop
```

Title:

```text
Validate A User Shop
```

Purpose:

```text
Validate an existing User Shop in RevCent.
```

`ValidateUserShop` should be called after creating a User Shop with `CreateUserShop`.

The operation connects to the external store and checks settings related to the RevCent Payments plugin.

For WooCommerce shops, this validation helps confirm that:

- the store has the RevCent Payments plugin installed,
- the plugin is reachable by RevCent,
- the plugin settings are configured properly,
- the User Shop connection is working,
- required RevCent plugin configuration is valid.

---

## When to Use

Run `ValidateUserShop` immediately after:

```text
CreateUserShop
```

Recommended flow:

```text
CreateUserShop
    ↓
ValidateUserShop
    ↓
If validation returns an error:
        Run FixUserShop once
        ↓
        ValidateUserShop again if needed
```

Also use `ValidateUserShop` after:

- editing shop credentials,
- changing the shop URL,
- changing plugin settings,
- reinstalling or updating the RevCent Payments plugin,
- troubleshooting WooCommerce checkout/payment behavior,
- fixing a shop configuration issue.

---

## Input Schema

`ValidateUserShop` requires:

| Field | Type | Required | Description |
|---|---:|---:|---|
| `user_shop_id` | string | Yes | 20-character User Shop ID. |

Example:

```json
{
  "user_shop_id": "XXXXXXXXXXXXXXXXXXXX"
}
```

If the User Shop ID is unknown, use `GetUserShops` to retrieve available User Shops and identify the correct ID.

---

## Output Schema

Successful output can include:

| Field | Type | Description |
|---|---:|---|
| `api_call_id` | string | 20-character API call ID. |
| `api_call_unix` | integer | Unix timestamp when the API call was initiated. |
| `code` | integer | API response code. |
| `user_shop_id` | string | 20-character User Shop ID. |
| `result` | string | Validation result message. |

The `result` field should be read carefully.

If the result indicates an error or configuration issue, the AI/MCP client should consider running `FixUserShop`.

---

## What Validation Means

`ValidateUserShop` is a verification step.

It is not just a generic “ping” operation.

It is meant to confirm that the user's shop has the RevCent Payments plugin and that the plugin is configured properly for RevCent.

Conceptual behavior:

```text
RevCent connects to the store
    ↓
RevCent checks RevCent Payments plugin settings
    ↓
RevCent returns validation result
    ↓
If there is an error, AI/MCP reads the result and runs FixUserShop if appropriate
```

---

## Error Handling

If `ValidateUserShop` returns an error:

1. Read the `result` message.
2. Explain the issue to the user if needed.
3. Run `FixUserShop` once.
4. Run `ValidateUserShop` again if needed.
5. If errors remain after `FixUserShop`, read the remaining error and notify the user that support/manual resolution may be required.

Important:

```text
FixUserShop should be run once if ValidateUserShop returns an error.
```

Do not repeatedly run `FixUserShop` without reviewing the returned result.

---

## Relationship to `FixUserShop`

`FixUserShop` is the companion operation to `ValidateUserShop`.

Use `ValidateUserShop` to check whether the shop is properly configured.

Use `FixUserShop` when validation reports configuration issues related to the RevCent Payments plugin.

Important limitation:

```text
FixUserShop only attempts to fix required RevCent plugin settings.
```

It does not fix:

- unrelated WooCommerce plugin issues,
- unrelated WordPress issues,
- custom store code,
- server problems,
- DNS issues,
- third-party plugin conflicts,
- non-RevCent checkout problems.

If `FixUserShop` cannot fix the issue, the user may need support or manual troubleshooting.

---

## Best Practices

- Always validate after creating a User Shop.
- Always validate after changing credentials or plugin settings.
- Read the `result` field before deciding what to do next.
- Run `FixUserShop` once if validation returns an error.
- Validate again after running `FixUserShop`.
- Do not treat a newly created shop as ready until validation succeeds.
- Do not use validation as a replacement for post-creation setup such as shipping method mapping, alternate payment mapping, and product import.

---

## AI/MCP Decision Guide

| Situation | Correct Action |
|---|---|
| User Shop was just created | Run `ValidateUserShop`. |
| User Shop ID is unknown | Run `GetUserShops` first. |
| Validation succeeds | Continue post-creation setup. |
| Validation returns an error | Read `result`, then run `FixUserShop` once. |
| Fix succeeds | Run `ValidateUserShop` again if needed. |
| Fix does not resolve issue | Read result and tell user support/manual resolution may be needed. |

---

## Final AI/MCP Instruction

Call `ValidateUserShop` after creating a User Shop.

The validation method connects to the store and checks settings related to the RevCent Payments plugin. It verifies that the user's shop has the RevCent Payments plugin, that the plugin is configured properly, and that RevCent can validate the shop connection.

If validation returns an error, run `FixUserShop` once. `FixUserShop` attempts to automatically fix configuration issues with the RevCent Payments plugin. If errors remain after the fix, read the result and notify the user that customer support or manual resolution may be required.


---
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.