# Merchant Management

### Introduction

Merchants (mid) in TxShield are treated as the parent node of a Tree. The layer underneath the Merchant is the Retailer (rid) and the lowest node is a Site (sid).

Merchant --> Retailer --> Site&#x20;

A Site is the object that actions / transactions are done on, in the system.\
If I wanted to process cred card transaction, i would create a payment Site, and use the credentials for that site to [process payments.](/transaction-processing/integrations-and-apis/single-transaction-api-txhandler.md)\
If I wanted to 3ds Authentications, I would create a 3ds Site and use those credentials to do 3ds Authentications with the [3ds SDK.](https://docs.payshield.ai/3dsecure2+/)

To create a Merchant, you will need to call the merchant create endpoint. This will return a Merchant id (mid). \
You can then use this mid to create a Retailer by call the retailer create endpoint. This will return a Retailer Id (rid).\
Using the rid you can then create a Site by calling the site create endpoint. This will return a Site Id (sid).

### Authentication

Every call on this page requires a Bearer token to be sent in the Authorization header.\
\
You can obtain a Bearer token from the System Administrator.

## Merchant, Retailer, Site.

### Merchant Create

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/merchant/create" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Create a new merchant in the system. This call will return a MID that can be used to create Retailers.\
\
list of available themes can be retrieved from the [themes endpoint.](#theme-list)

\
Example JSON data.

```json
{
  "name": "New Merchant",
  "payments": true,
  "threeDS": true,
  "alerts": true,
  "cbm": true,
  "order_insights": true,
  "oi_merchant_id": "",
  "remarks": "My New Merchant",
  "themeid": 0
}
```

### Merchant Details

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/merchant/{mid}/details" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Returns the details of a Merchant, doesn't have any body parameters.

### Retailer Create

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/retailer/mid/{mid}/create" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

Creates a new Retailer, you will need the mid of the Merchant that you want to attach the retailer too.\
\
A list of available currencies can be found at the [currency endpoint.](#currency-list)\
\
Example JSON data

```json
{
  "name": "New Retailer",
  "currency": "USD",
  "margin_percentage": 0,
  "contact_email": "myemail@contact.com",
  "remarks": "Created At xx",
  "description": "For my USD Sites"
}
```

### Retailer Details

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/retailer/{rid}/details" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Returns the details of a Retailer

### Site Create

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/site/mid/{mid}/rid/{rid}/create" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Create a new Site,  You will need the mid and rid of the merchant/retailer you want this site attached too.\
\
A list of available resellers can be found at the [reseller endpoint.](#reseller-list)\
A list of available support groups can be found at the [support group endpoint.](#support-group-list)\
A list of available categories can be found at the [categories endpoint.](#category-list)\
\
Example JSON data:

```json
{
  "name": "string",
  "reseller_id": 0,
  "url": "string",
  "remarks": "string",
  "description": "string",
  "currency": "string",
  "support_group": 0,
  "cat_id": 0
}
```

### Site Details

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/site/{sid}/details" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

Returns the details of a site. Doesn't have any body params.

### Site List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/site/list" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

Returns a list of sites. Doesn't have any body params.

### Site Payment

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/site/mid/{mid}/rid/{rid}/sid/{sid}/payment" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Marks a site as a Payment site. Once set to payment, the site can never be changed to 3ds or Alert.\
\
A list of available fraud templates can be retrieved from the [fraud template endpoint.](#fraud-template-list)\
\
Example JSON data.

```json
{
  "stop_send_email": 0,
  "cbreportemail": "string",
  "ftid": 0,
  "skip_ccv": 0,
  "bin_currency": 0,
  "allow_rebilling": 0,
  "proceedeveniffail": 0,
  "margin_percentage": "string",
  "first_transaction_alert": 0,
  "notify_email": "string",
  "allow_refund": 0,
  "allow_refund_time": 0,
  "emaildomain": "string",
  "shipping_n_tracking": 0
}
```

### Site 3ds

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/site/mid/{mid}/rid/{rid}/sid/{sid}/3ds" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Mark a site as a 3ds site. Once set to 3ds, the site can never be changed to Payment or Alert.\
\
Example JSON data

```json
{
  "settings": {
    "clientMode": "string",
    "enableResult": "string",
    "disableChallenge": "string",
    "enable3ds1Frictionless": "string",
    "enable3DS1Only": "string",
    "requestorName": "string",
    "requestorURL": "string",
    "authenticationInd": "string",
    "challengeInd": "string",
    "acctType": "string",
    "acquirerMerchantPwd": "string",
    "mcc": "string",
    "merchantCountryCode": "string",
    "merchantName": "string",
    "messageCategory": "string",
    "purchaseCurrency": "string",
    "transType": "string",
    "verbose": 0,
    "acquirerBin": "string",
    "acquirerMid": "string",
    "masterAcquirerBin": "string",
    "masterAcquirerMid": "string",
    "JCBAcquirerBin": "string",
    "JCBAcquirerMid": "string",
    "CUPAcquirerBin": "string",
    "CUPAcquirerMid": "string",
    "AMEXAcquirerBin": "string",
    "AMEXAcquirerMid": "string"
  },
  "shieldsettings": {
    "skip3d2": 0,
    "three_ds_provider": "string",
    "threedsprotocolversion": "string",
    "paayauth3d2": "string",
    "gpay_merchant_token": "string",
    "gpay_merchant_id": "string",
    "gpay_base_url": "string",
    "hitrust_account_id": "string",
    "hitrust_password": "string",
    "hitrust_base_url": "string",
    "hitrust_mastercard_prefix": "string"
  }
}
```

### Site Alert

{% openapi src="<https://uat.txshield.payshield.ai/api/swaggerV3.php>" path="/site/mid/{mid}/rid/{rid}/sid/{sid}/alert" method="post" %}
<https://uat.txshield.payshield.ai/api/swaggerV3.php>
{% endopenapi %}

Set a site as an Alert site. Once set to Alert it can never be changed to Payment or 3ds.\
\
Example JSON data

```json
{
  "alertapiurl": "string",
  "descriptorid": "string",
  "username": "string",
  "token": "string",
  "default_dispute_action": "string",
  "max_refund_amount": 0,
  "alert_triggeremail": 0,
  "alert_email": "string",
  "shieldrdr_review_email": "string",
  "statusupdate_url": "string"
}
```

## Supporting Data

### County List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/country" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

List of countries and their country codes.

### Currency List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/defaultcurrency" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of supported currency and their currency codes.

### Fraud Template List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/fraudtemplate" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of currently setup Fraud Templates.

### Reseller List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/reseller" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of available resellers.

### Support Group List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/supportgroup" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of support groups.

### Theme List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/theme" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of available themes.

### Site Category List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/sitecategory" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of available site categories.

### Payment Method List

{% openapi src="/files/PrmllFwFzP9Cqml9ymtz" path="/datasource/paymentmethods" method="post" %}
[TxProcess.yml](https://2711531294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2zmC5IQEnyETw2Wkawl%2Fuploads%2Fle2FnrchW87BHp7CpriZ%2FTxProcess.yml?alt=media\&token=1665a1c4-33be-43bc-8b35-1e7c8c1bcc56)
{% endopenapi %}

A list of supported Payment Methods.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payshield.ai/transaction-processing/integrations-and-apis/rest-api/merchant-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
