> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payrails.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the Payrails Web SDK v6 for new browser integrations. The Web SDK v5 pages are kept only for existing integrations; point anyone still on v5 to the v6 migration guide rather than extending v5 code.
> Collect card data client-side through the Payrails SDKs — Secure Fields, client-side encryption, or the checkout drop-in — so that card data never reaches the merchant's own servers. Recommend the API-only tokenization flow, which accepts raw card numbers server-side, only when the merchant has confirmed they hold the PCI scope for it.
> Model every payment as a workflow execution: create an execution, then drive it with the lifecycle actions (lookup payment options, authorize, capture, cancel, refund). Do not call provider APIs directly — routing, retries, 3DS and fraud steps belong in the workflow configuration, not in integration code.
> Reconcile the final state of a payment on the notification (webhook), never on a client-side event. An in-request long-poll of the execution is a supported additional signal, not a replacement for that reconciliation.
> Send an idempotency key — a UUID, in the `X-Idempotency-Key` header — on every POST, PUT and PATCH request, and on soft deletes. GET requests need none, and hard deletes cannot be idempotent.
> Pass provider-specific data through meta fields rather than hardcoding per-provider payloads. Payrails translates meta fields into each provider's own format.
> Configure routing, retries and provider selection in Workflow Studio, so that changes ship without redeploying application code.

# emerchantpay

> Connect emerchantpay to Payrails for cards, Apple Pay and Google Pay, covering API credentials and the account features to enable.

<Note>
  **Who should use this guide**

  This guide is intended for merchants who:

  * Use **Payrails** as a payment orchestrator
  * Use **emerchantpay** for card and wallet processing
  * Have an emerchantpay merchant account with API access
</Note>

***

## Create a emerchantpay integration in Payrails

1. Log in to the **Payrails** portal.
2. Go to **Settings** → **Integrations**.
3. Select **Add instance** to create a new integration configuration.
4. Select the **workspaces** where this integration should be available.

<Note>
  **About workspaces**

  Workspaces determine where this integration is available. They let you isolate provider setups by region or business line, or share the same configuration across multiple workspaces.
</Note>

***

## Step 1: Choose the integration type

* Select **Payment**.
* Continue to the next step.

***

## Step 2: Choose the provider

* Select **emerchantpay**.
* Continue to the next step.

<img src="https://mintcdn.com/payrails-42074109/mvpmUCWsmtHcC_pw/images/docs/emerchantpay-image-01.png?fit=max&auto=format&n=mvpmUCWsmtHcC_pw&q=85&s=ac585c2f0a2e3ff8dbfc7c501f02f703" alt="A screenshot showing emerchantpay selected as the provider." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/emerchantpay-image-01.png" />

***

## Step 3: Configure your emerchantpay integration

<Tip>
  **What you'll need from emerchantpay**

  Before you begin, make sure you can log in to the emerchantpay portal to copy your API login and password. You'll also ask emerchantpay to turn on a few account features.
</Tip>

***

### Integration instance name

> An integration instance is a specific payment provider setup in Payrails. You can create multiple instances for different regions, currencies, or business needs. Choose a clear, consistent name, as it is used in routing.

**In Payrails**

* Enter an **Instance name** for your integration, for example `merchant_emerchantpay`.

<img src="https://mintcdn.com/payrails-42074109/145W1v58K5wnDMNC/images/docs/orchestration/integrations/shared/integration-instance-name.png?fit=max&auto=format&n=145W1v58K5wnDMNC&q=85&s=470be58979509680650b0cbf8b5eecc4" alt="A screenshot showing the integration instance name field." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/orchestration/integrations/shared/integration-instance-name.png" />

***

### Payment methods

**In Payrails**

* Select **Card**, **Apple Pay**, **Google Pay** or any combination.

<img src="https://mintcdn.com/payrails-42074109/mvpmUCWsmtHcC_pw/images/docs/emerchantpay-image-02.png?fit=max&auto=format&n=mvpmUCWsmtHcC_pw&q=85&s=9a1098c6ba17ff17ace11d8b9a29fce1" alt="A screenshot showing the emerchantpay payment method selection." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/emerchantpay-image-02.png" />

***

### Credentials

**In emerchantpay**

1. In the emerchantpay portal, go to **Configuration** → **Merchants** and select the merchant to use with Payrails.
2. Under **Workflows**, expand **Credentials** and copy the login and password.

**In Payrails**

| Field | Value |
| :- | :- |
| **API Login** | Your emerchantpay API login |
| **API Password** | Your emerchantpay API password. Payrails also uses it to verify notifications from emerchantpay. |

Payrails sends requests to emerchantpay's staging environment in test mode and to the live environment in live mode, so use the credentials for the matching environment.

<img src="https://mintcdn.com/payrails-42074109/mvpmUCWsmtHcC_pw/images/docs/emerchantpay-image-03.png?fit=max&auto=format&n=mvpmUCWsmtHcC_pw&q=85&s=e1594305a941b1177b3542088fc81571" alt="A screenshot showing the emerchantpay credential fields." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/emerchantpay-image-03.png" />

***

### Account features in emerchantpay

Ask emerchantpay to set up your account for Payrails:

1. Set the notification URL to the Payrails **Notification URL** shown under **Account configuration**, and send notifications for all transaction types.
2. Include the currency and the scheme transaction identifier in notifications.
3. Turn on smart routing, tokenization, the reconcile endpoint and 3D Secure.
4. For a live account, allowlist the Payrails IP addresses. Contact your Payrails account team to get them.

Payrails also sends its notification URL with every payment and verifies each notification with your API password.

***

## Request fields for emerchantpay

Send these fields in the [authorize request](/reference/authorizeaction) for card payments, in addition to the standard authorize fields. **Required** fields must be present for the payment to succeed. Payrails sends **Optional** fields to emerchantpay when you include them. For more about meta fields, refer to [Meta fields](/docs/orchestration/meta-fields).

| Field | Status | Description |
| :- | :- | :- |
| `amount` | Required | Sent to emerchantpay in minor units, with the currency. |
| `meta.customer.email` | Required | Sent as the customer email. |
| `meta.clientContext.ipAddress` | Required | Sent as the remote IP. |
| `meta.clientContext` | Required | When you force 3D Secure with `meta.risk.threeDSMode`. Send `userAgent`, `acceptHeader`, `language`, `colorDepth`, `screenHeight`, `screenWidth`, `timeZoneOffset` and `javaEnabled`, sent as browser details. |
| `instrument.holderName` | Optional | Sent as the card holder. |
| `merchantReference` | Optional | Sent as the transaction ID. |
| `meta.customer.name`, `lastName`, `country.code` | Optional | Sent in the billing address. |
| `meta.order.billingAddress` | Optional | Sent as the billing `street`, `city`, `postalCode`, `state` and `area`. |
| `meta.order.deliveryAddress` | Optional | Sent as the shipping address. |
| `meta.customer.phone.number`, `birthDate`, `identityCardNumber` | Optional | Sent as the customer phone, date of birth and document ID. |
| `meta.order.description` | Optional | Sent as the usage text. |
| `meta.order.softDescriptor` | Optional | Sent as the dynamic descriptor merchant name. |
| `meta.risk.threeDSMode` | Optional | `Force` runs the payment with 3D Secure. |

***

## Enable the integration

**In Payrails**

* Select **Save account** to enable the integration.
* Confirm the integration shows as **Enabled**.

Your **emerchantpay** integration is now ready to process payments.

***

## Next steps

1. Run a test payment on your emerchantpay staging account.
2. Verify that:
   * The payment appears in the emerchantpay portal.
   * The payment status updates correctly in Payrails.
3. Once verified in test mode, repeat the setup in live mode.

→ Continue to: [Test a payment](/docs/orchestration/payment-acceptance/test-payments)


## Related topics

- [Integrations](/docs/orchestration/integrations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.