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

# Payzone

> Connect Payzone to Payrails to accept cards and Payzone Cash in Morocco, covering the API caller, merchant details and MAC keys.

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

  This guide is intended for merchants who:

  * Use **Payrails** as a payment orchestrator
  * Use **Payzone** to accept cards or [Payzone Cash](/docs/orchestration/payment-methods/payzone-cash) in Morocco
  * Have an active Payzone account for cards, Payzone Cash or both
</Note>

***

## Create a Payzone 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 **Payzone**.
* Continue to the next step.

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

***

## Step 3: Configure your Payzone integration

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

  Payzone cards and Payzone Cash use different credentials. Fill in the fields for the payment methods you enable:

  * **Cards:** your API caller, merchant name and notification secret key from the Payzone dashboard.
  * **Payzone Cash:** your merchant ID, point of service ID, provider ID and the four MAC keys Payzone gives you.
</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_payzone`.

<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**, **Payzone Cash** or both.

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

***

### Credentials and account details for cards

The form labels each field with the payment method that needs it, for example **\[Required for Payzone Cards] Caller Name**.

**In Payzone**

1. In the Payzone dashboard, go to **Organization** → **Merchant**.
2. Under **Api Caller**, copy the **Caller Name** and **Password**.
3. Copy the **Merchant Name**.
4. Under **Payment Credentials**, copy the **Notification Secret Key**.

**In Payrails**

| Field | Value |
| :- | :- |
| **Caller Name** | Your Payzone API caller name |
| **Caller Password** | Your Payzone API caller password. Payrails signs every card request with it. |
| **Notification Secret Key** | Your Payzone notification secret key. Payrails uses it to verify Payzone's card notifications. |
| **Merchant Name** | Your Payzone merchant name |

Payrails sends card payments to the Payzone sandbox in test mode and to Payzone's live environment in live mode.

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

***

### Credentials and account details for Payzone Cash

**In Payzone**

* Get your merchant ID (acquirer ID), point of service ID, provider ID and the four MAC keys from Payzone.

**In Payrails**

| Field | Value |
| :- | :- |
| **Merchant ID** | Your Payzone acquirer ID |
| **POS ID** | Your point of service ID |
| **Provider ID** | Your provider ID |
| **MAC Receive 1**, **MAC Receive 2** | Your MAC input keys. Payrails signs Payzone Cash requests with them. |
| **MAC Send 1**, **MAC Send 2** | Your MAC output keys. Payrails uses them to verify Payzone Cash notifications. |

<img src="https://mintcdn.com/payrails-42074109/5bgwNQYa4BxIPDBd/images/docs/payzone-image-05.png?fit=max&auto=format&n=5bgwNQYa4BxIPDBd&q=85&s=b2be1e9db30984e850bf2094943f59af" alt="A screenshot showing the Payzone Payzone Cash MAC key fields." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/payzone-image-05.png" />

<img src="https://mintcdn.com/payrails-42074109/5bgwNQYa4BxIPDBd/images/docs/payzone-image-04.png?fit=max&auto=format&n=5bgwNQYa4BxIPDBd&q=85&s=5549b8094fb972f7cbc38959947c3a04" alt="A screenshot showing the Payzone account details fields for cards and Payzone Cash." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/payzone-image-04.png" />

***

### Webhooks or notifications

Payrails sends its notification URL to Payzone with every card and Payzone Cash payment, so you don't need to set one up in the Payzone dashboard. Payrails verifies card notifications with your notification secret key and Payzone Cash notifications with your MAC send keys.

***

## Request fields for Payzone

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 Payzone when you include them. For more about meta fields, refer to [Meta fields](/docs/orchestration/meta-fields).

| Field | Status | Description |
| :- | :- | :- |
| `amount` | Required | Sent to Payzone as the payment amount and currency. |
| `meta.order.lines` | Required | At least one line. Payrails builds the line item description from them when you don't send `meta.order.description`. |
| `meta.clientContext.ipAddress` | Required | Sent as the customer's IP address. |
| `meta.customer.country.code` | Required | Sent as the payment country. |
| `instrument.holderName` | Required | Sent as the account holder. You can send `meta.customer.name` and `meta.customer.lastName` instead. |
| `meta.order.description` | Optional | Sent as the line item description. |
| `meta.clientContext.language`, `userAgent`, `acceptHeader`, `colorDepth`, `screenHeight`, `screenWidth`, `timeZoneOffset` | Optional | Sent as browser details for 3D Secure. `language` must be a valid language tag, for example `fr-MA`. |
| `holderReference` | Optional | Sent as the customer ID. |
| `merchantReference` | Optional | Sent as the payment ID. |

***

## Enable the integration

**In Payrails**

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

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

***

## Next steps

1. Run a test card payment in the Payzone sandbox.
2. Verify that:
   * The payment appears in Payzone.
   * 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

- [Payzone Cash via Payzone](/docs/orchestration/payment-methods/payzone-cash/payzone.md)
- [Payzone Cash](/docs/orchestration/payment-methods/payzone-cash.md)
- [Integrations](/docs/orchestration/integrations.md)


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