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

> Accept BCP payments from customers in Peru, who pay a payment code in BCP online banking or the BCP app, and check the PSPs that process BCP.

export const ProviderLogo = ({code, alt, bleed = false}) => {
  const root = `https://assets.payrails.io/img/logos/${code}`;
  const sources = bleed ? [`${root}/logo-full-bleed.svg`, `${root}/logo.svg`] : [`${root}/logo.svg`];
  const [index, setIndex] = useState(0);
  const ref = useRef(null);
  const fail = i => setIndex(current => current === i ? i + 1 : current);
  useEffect(() => {
    const img = ref.current;
    if (img && img.complete) img.decode().catch(() => fail(index));
  }, [index]);
  if (index >= sources.length) {
    return <span className="provider-card-logo-fallback" role="img" aria-label={alt}>
        {(alt || code).charAt(0).toUpperCase()}
      </span>;
  }
  return <img key={sources[index]} ref={ref} src={sources[index]} alt={alt} onError={() => fail(index)} />;
};

BCP (Banco de Crédito del Perú) is one of the largest banks in Peru. With BCP as a payment method, customers get a payment code at checkout and pay it from their BCP account, in online banking or the BCP app.

Payrails processes BCP through dLocal as the payment service provider (PSP). Open the dLocal guide below for its setup steps and request examples.

## How a BCP payment works

BCP is a redirect payment method that's paid with a code:

1. The customer selects BCP at checkout.
2. Payrails returns a redirect URL from the PSP, and the customer goes to the PSP's page, which shows a BCP payment code.
3. The customer returns to your `returnInfo` URL. The payment is still pending at this point.
4. The customer pays the code in BCP online banking or the BCP app.
5. Payrails receives the final result from the PSP and updates the payment.

Each payment is single-use: the customer pays every code on its own. Payrails captures BCP payments immediately, so a successful payment is final. To return funds, [refund the payment](/docs/orchestration/payment-acceptance/refund-a-payment).

## Supported currencies and countries

BCP supports PEN (Peruvian sol) as its only presentment currency.

BCP is available to customers based in:

<table>
  <thead>
    <tr><th className="min-w-[115px]">Regions</th><th>Countries</th></tr>
  </thead>

  <tbody>
    <tr><td><b>Latin America</b></td><td><span className="inline-flex flex-row flex-wrap"><span className="text-xs text-nowrap rounded-sm hover:mint-bg-gray-100 cursor-default px-1">🇵🇪 Peru</span></span></td></tr>
  </tbody>
</table>

## Integrate BCP

Choose the PSP that processes BCP for you. Each guide covers the PSP-side setup, the Payrails configuration and the request fields that PSP requires.

<CardGroup cols="2">
  <Card href="/docs/orchestration/payment-methods/bcp/dlocal">
    <div className="provider-card">
      <span className="provider-card-logo">
        <ProviderLogo code="dlocal" alt="dLocal logo" bleed />
      </span>

      <div>
        <p className="provider-card-name">dLocal</p>
        <p className="provider-card-type">BCP via dLocal</p>
      </div>
    </div>
  </Card>
</CardGroup>

## Check PSPs

<table>
  <thead>
    <tr><th>Workflow</th><th><a href="/docs/orchestration/payment-methods/bcp/dlocal">dLocal</a></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>

## Ways to integrate BCP

* **Payrails SDK:** the [Web SDK](/docs/orchestration/checkout-sdks/web) shows BCP when your workflow returns it as a payment option, and redirects the customer to the page with the payment code. To control how the redirect opens, listen for the [`actionRequired` event](/docs/orchestration/checkout-sdks/web/guides/action-required-event).
* **Payrails API:** call [lookup payment options](/docs/orchestration/payment-acceptance/lookup-payment-options), then authorize with `bcp` as the `paymentMethodCode`. Each PSP guide lists the `meta` fields that PSP requires.

In both cases, confirm the final result through [webhook notifications](/docs/orchestration/payment-acceptance/receive-notifications) or the execution status. Don't treat the customer's return to your `success` URL as proof of payment.


## Related topics

- [BCP via dLocal](/docs/orchestration/payment-methods/bcp/dlocal.md)
- [Create a new Ruleset](/reference/createruleset.md)
- [Update a Ruleset](/reference/updateruleset.md)


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