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

# BCP via dLocal

> Set up BCP payments through dLocal in Payrails, and see the customer details dLocal needs on each request.

Accept [BCP](/docs/orchestration/payment-methods/bcp) payments from customers in Peru with dLocal as the payment service provider (PSP). The customer selects BCP in your checkout, gets a payment code on the dLocal payment page and pays it in BCP online banking or the BCP app.

## Supported workflows

<table>
  <thead>
    <tr><th>Workflow</th><th>Supported</th></tr>
  </thead>

  <tbody>
    <tr><td>Payrails SDK</td><td>✔</td></tr>
    <tr><td>Payrails API</td><td>✔</td></tr>
    <tr><td><a href="/docs/orchestration/payment-acceptance/capture-and-cancel-modes#capture-mode">Delayed / Manual Capture</a></td><td>✖</td></tr>
    <tr><td><a href="/docs/orchestration/payment-acceptance/capture-and-cancel-modes#capture-mode">Instant Capture</a></td><td>✔</td></tr>
    <tr><td><a href="/docs/orchestration/payment-acceptance/cancel-a-payment">Cancel / Void</a></td><td>✔</td></tr>
    <tr><td><a href="/docs/orchestration/payment-acceptance/refund-a-payment">Refund / Reverse</a></td><td>✔</td></tr>
    <tr><td><a href="/docs/resources/manage-instruments">Save Instruments</a></td><td>✖</td></tr>
    <tr><td><a href="/docs/resources/payments/authorization-flags">Merchant Initiated Transaction (MIT)</a></td><td>✖</td></tr>
  </tbody>
</table>

## Before you begin

Complete these steps before you send your first BCP payment through dLocal:

1. Set up a dLocal integration in your workspace. Follow the [dLocal integration setup guide](/docs/orchestration/integrations/dlocal) if you don't have one yet.
2. Ask dLocal to enable BCP on your dLocal account.
3. In the Payrails Portal, go to **Settings → Integrations**, open your dLocal integration, select **BCP** under **Payment methods**, and save.
4. Add BCP as a [payment option](/docs/orchestration/payment-methods/set-up-payment-methods) in your workflow.

## Request fields for dLocal

Send these fields in the authorize request, in addition to the standard [authorize fields](/reference/authorizeaction). **Required** fields must be present for the payment to succeed. Payrails sends **Optional** fields to the PSP when you include them.

| Field | Status | Description |
| - | - | - |
| `amount.currency` | Required | Must be `PEN`. Payrails rejects other currencies. |
| `meta.customer.country` | Required | The customer's country object. Payrails sends `PE` to dLocal for every BCP payment, whatever `country.code` you send. |
| `meta.customer.name` | Required | Sent to dLocal as the payer name, together with `meta.customer.lastName`. |
| `meta.customer.email` | Required | Sent to dLocal as the payer email. |
| `meta.customer.identityCardNumber` | Optional | The customer's DNI (8 digits) or RUC (11 digits). Sent to dLocal as the payer document. Send it unless dLocal has agreed to accept BCP payments without it on your account. |
| `meta.customer.lastName` | Optional | Added to the payer name. |
| `meta.customer.phone` | Optional | Sent to dLocal as the payer phone number. |
| `meta.customer.reference` | Optional | Sent to dLocal as the payer's user reference. |
| `meta.customer.birthDate` | Optional | Sent to dLocal as the payer's date of birth. |
| `meta.order.billingAddress` | Optional | Sent to dLocal as the payer address. `meta.order.deliveryAddress` takes priority when both are present. |
| `meta.order.description` | Optional | Sent to dLocal as the payment description. |
| `meta.clientContext.clientType` | Optional | `desktop`, `mobile` or `app`. Sent to dLocal as the device type. |
| `meta.clientContext.ipAddress` | Optional | Sent to dLocal as the payer IP address. |

## Authorize a BCP payment

Call [authorize a payment](/reference/authorizeaction) with `bcp` as the `paymentMethodCode`. The response includes the redirect to the dLocal payment page, which shows the payment code.

```json Authorize request theme={null}
{
  "amount": {
    "value": "120.00",
    "currency": "PEN"
  },
  "paymentComposition": [
    {
      "integrationType": "api",
      "paymentMethodCode": "bcp",
      "amount": {
        "value": "120.00",
        "currency": "PEN"
      }
    }
  ],
  "meta": {
    "customer": {
      "name": "Rosa",
      "lastName": "Mamani",
      "email": "rosa.mamani@example.com",
      "identityCardNumber": "45678912",
      "country": {
        "code": "PE"
      }
    },
    "clientContext": {
      "clientType": "desktop",
      "ipAddress": "203.0.113.10"
    }
  },
  "returnInfo": {
    "success": "https://example.com/success",
    "error": "https://example.com/error"
  }
}
```

The payment stays pending until the customer pays the code. Confirm the result through [webhook notifications](/docs/orchestration/payment-acceptance/receive-notifications) or the execution status before you fulfill the order.

## How dLocal handles BCP

* Payrails sends BCP to dLocal as payment method `BC`, a bank transfer with dLocal's redirect flow. dLocal returns a redirect URL to its hosted page, where the customer gets the BCP payment code.
* dLocal accepts BCP payments from 5.00 PEN. A payment code stays payable for up to 5 days.
* The payment stays pending until the customer pays the code, and Payrails completes it from the dLocal notification.
* To stop a pending payment before the customer pays it, [cancel the payment](/docs/orchestration/payment-acceptance/cancel-a-payment).
* Payrails captures BCP payments through dLocal immediately, so a successful payment is final. To return funds, refund the payment. dLocal pays BCP refunds out to the customer's bank account, and the refund completes from the dLocal notification.
* Each BCP payment is a one-time, customer-initiated payment.


## Related topics

- [BCP](/docs/orchestration/payment-methods/bcp.md)
- [Opay via dLocal](/docs/orchestration/payment-methods/opay/dlocal.md)
- [OVO via dLocal](/docs/orchestration/payment-methods/ovo/dlocal.md)


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