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

# Amazon

> Connect Amazon Payment Service to Payrails, covering credentials, payment methods, and the Direct Transaction Feedback webhook.

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

  This guide is intended for merchants who:

  * Use **Payrails** as a payment orchestrator
  * Use **Amazon Payment Service (APS)** for payments
  * Are approved to process **raw card data**

  We use a server-to-server integration with Amazon, so your account must be enabled to process raw card data. If this isn't enabled, payments won't work in production. Please contact your Amazon account manager or support team to activate it.
</Note>

***

## Create and configure an Amazon Payment Service 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 can be used. They allow you to isolate provider setups by region or business line, or share a single configuration across multiple environments.
</Note>

***

## Step 1: Choose the integration type

* Select **Payment** and continue to the next step.

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

***

## Step 2: Choose the provider

* Select **Amazon Payment Service** and continue to the next step.

<img src="https://mintcdn.com/payrails-42074109/zqk7oWHZbW3YniA1/images/docs/amazon-image-01.png?fit=max&auto=format&n=zqk7oWHZbW3YniA1&q=85&s=3da2f583d585c939b6bb1b40ff9cc844" alt="A screenshot showing the Amazon integration selected." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/amazon-image-01.png" />

***

## Step 3: Configure your Amazon Payment Service integration

<Tip>
  **What you'll need from Amazon Payment Service**

  Before you begin, make sure you have access to:

  * APS **Merchant identifier**
  * APS **Access code**
  * APS **SHA request phrase** and **SHA response phrase** (SHA256)

  [Sign in](https://paymentservices.amazon.com/get-started/dashboard) to your Amazon Payment Service dashboard to complete this step.
</Tip>

***

### Integration instance name

> An integration instance is a specific payment provider setup in Payrails. You can create multiple instances for each provider based on region, currency, or business needs. Choose a clear, consistent name, as it is used in routing.

**In Payrails**

* Enter a clear and descriptive **Instance name**.

<img src="https://mintcdn.com/payrails-42074109/6ZmkK5ZUHpx1-EP_/images/docs/dlocal-basic-information.png?fit=max&auto=format&n=6ZmkK5ZUHpx1-EP_&q=85&s=b9a43582acab50b93394ecc2898d5ecf" alt="A screenshot showing the Payrails integration instance name field." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/dlocal-basic-information.png" />

***

### Account details

**In Amazon**

1. [Sign in](https://paymentservices.amazon.com/get-started/dashboard) to the **Amazon Payment Service (APS) merchant dashboard**.
2. Navigate to **Merchant management** → **Integration settings** → **Security settings**.
3. Copy the **Merchant identifier**.

**In Payrails**

* Paste the **Merchant identifier** into the **Merchant ID** field.

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

***

### Credentials

<Tip>
  Start by testing your integration using Amazon's sandbox credentials. When you finish testing, switch to production credentials and go live.

  Make sure the credentials you enter in Payrails match the environment you are configuring (test or live).
</Tip>

**In Amazon**

1. On **Security settings**, copy the **Access code** value.

**In Payrails**

* Paste the value into the **Access code** field.

**In Amazon**

1. Select **SHA256**.
2. Copy the **SHA Request phrase** and **SHA Response phrase**.

**In Payrails**

* Paste the values into the corresponding **SHA Request phrase** and **SHA Response phrase** fields.

***

### Payment methods

**In Payrails**

* Select the payment methods that should be enabled.

<img src="https://mintcdn.com/payrails-42074109/zqk7oWHZbW3YniA1/images/docs/amazon-image-03.png?fit=max&auto=format&n=zqk7oWHZbW3YniA1&q=85&s=348fecde1f2561f13715ad7c2c52a81b" alt="A screenshot showing the payment methods available on Amazon Payment Service (APS)." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/amazon-image-03.png" />

***

### Webhook (Direct Transaction Feedback)

<Tip>
  Payrails uses Amazon Payment Service **Direct Transaction Feedback** to receive asynchronous payment status updates.

  Configure the feedback URL in the same environment (test or production) as your Payrails integration.
</Tip>

**In Amazon**

1. Navigate to **Merchant management** → **Integration settings** → **Technical settings**.
2. Select **Trusted channel**.

> Alternatively, you may be asked to select your activated integration and choose **Hosted Checkout**, **Custom Integration**, or **Mobile SDK**.

**In Payrails**

* Copy the **Notification URL**.

<img src="https://mintcdn.com/payrails-42074109/6ZmkK5ZUHpx1-EP_/images/docs/dlocal-basic-information.png?fit=max&auto=format&n=6ZmkK5ZUHpx1-EP_&q=85&s=b9a43582acab50b93394ecc2898d5ecf" alt="A screenshot showing the Payrails integration instance name field." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/dlocal-basic-information.png" />

**In Amazon**

1. Paste the Payrails **Notification URL** into the **Direct Transaction Feedback URL** field.
2. Choose **Yes** for the **Downgrade CVV 3DS** option.
3. Select **Save changes**.

***

## Enable the integration

**In Payrails**

* Select **Save account** to enable the integration.

The **Enabled** status confirms that the Amazon Payment Service integration is active and available for routing.

<img src="https://mintcdn.com/payrails-42074109/zqk7oWHZbW3YniA1/images/docs/amazon-image-04.png?fit=max&auto=format&n=zqk7oWHZbW3YniA1&q=85&s=19664f6bd7713cc476a03dd958684f08" alt="A screenshot showing the enabled Klarna integration." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/amazon-image-04.png" />

Your Amazon Payment Service integration is now ready to process payments in the selected environment.

***

## Next steps

1. Run a test payment using an Amazon Payment Service [test card](https://paymentservices.amazon.com/docs/developer-resources/test-cards).
2. Verify that:
   * The payment appears in Amazon Payment Service.
   * 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

- [Amazon Pay](/docs/orchestration/payment-methods/amazon-pay.md)
- [Integrations](/docs/orchestration/integrations/index.md)
- [Update a Ruleset](/reference/updateruleset.md)
