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

# QR (Argentina)

Localpayment enables merchants to process instant payments through Argentina's standardized QR payment system. This guide outlines the process for initiating QR-based payments through Localpayment's API, detailing required parameters, handling responses, and interpreting status codes for seamless integration with Argentina's interoperable payment network.

## Before You Begin

Ensure you have:

* Valid [API credentials ](https://docs.localpayment.com/docs/api-keys-and-environments.md) (access token).

***

## Step 1. Create QR Payment

To generate a QR code for payment collection, send a `POST` request to the [Create Payin](https://docs.localpayment.com/reference/payins.md) endpoint with QR-specific parameters.

> [!NOTE]
>
> You don't need to send the payer's bank account in the request. The customer selects their bank account when they scan the QR code with their banking app.

### Key Request Parameters

The request requires several key objects specific to QR payments:

| Object | Description | Required |
| - | - | - |
| `paymentMethod.type` | Must be `BankTransfer` | ✅ |
| `sender` | Sender information for compliance | ✅ |
| `merchant` | Merchant/business details | ✅ |
| `paymentMethod` | Payment method configuration | ✅ |
| `amount` | Transaction amount | ✅ |
| `currency` | Transaction currency code | ✅ |
| `country` | Must be `ARG` | ✅ |

See all [available parameters](https://docs.localpayment.com/reference/payins.md) in the request.

### Example Request

Below is an example using `curl`:

```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
curl --request POST \
     --url https://api.stage.localpayment.com/api/payin/ \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Authorization: Bearer <your_access_token>' \
     --data '
{
  "paymentMethod": {
    "type": "BankTransfer",
    "code": "1050",
    "flow": "REDIRECT"
  },
  "currency": "ARS",
  "merchant": {
    "type": "COMPANY",
    "name": "Company"
  },
  "payer": {
    "type": "INDIVIDUAL",
    "document": {
      "type": "CUIL",
      "id": "20961504870"
    },
    "name": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com"
  },
  "externalId": "c8b89840-5d11-4e87-a0dc-86ad2d050492",
  "country": "ARG",
  "amount": 800,
  "accountNumber": "{{yourAccountNumber}}",
  "conceptCode": "0038",
  "comment": "",
  "transactionType": "PayIn",
  "clientCode": "clientCode",
  "requireAuth": false,
  "file": false
}
'
```

***

## Step 2. Handle the Response

### Successful Response

A successful QR payment creation includes the QR code data and payment details:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "externalId": "4b242857-6c21-4d09-8a23-f868105f3f4a",
  "internalId": "cde8e3f5-0056-49e4-916e-61402c36a8f9",
  "paymentMethod": {
    "type": "BankTransfer",
    "code": "1050",
    "flow": "REDIRECT"
  },
  "country": "ARG",
  "currency": "ARS",
  "amount": 800,
  "accountNumber": "{{yourAccountNumber}}",
  "confirmed": {
    "currency": "ARS",
    "amount": 10,
    "fxQuote": 1
  },
  "payment": {
    "currency": "ARS",
    "fxQuote": 1,
    "financingFee": 0,
    "amount": 10
  },
  "localTaxes": [
    {
      "code": "0001",
      "percentage": 1.25,
      "description": "IDC",
      "currency": "ARS",
      "fxSource": 1,
      "fxQuote": 0,
      "amount": 10,
      "account": "{{YourAccountNumber}}"
    }
  ],
  "withHoldings": [],
  "fees": {
    "description": "Fee",
    "currency": "ARS",
    "fxSource": 1,
    "fxQuote": 1,
    "amount": 0,
    "account": "{{YourAccountNumber}}"
  },
  "status": {
    "code": "100",
    "description": "INPROGRESS",
    "detail": "The payin is pending the confirmation"
  },
  "qr": {
    "code": "00020101021102080000000041370012com.TESTbind98113071613202899020143220018B00000500110ETA0125015001120322678275512600220000531905012067208748520457345802AR5912Localpayment6014CABA - Almagro6108C1006ACT530303262100706S1590981080004A01263047179",
    "expirationDate": "2024-09-30T16:18:50.322266+00:00"
  },
  "merchant": {
    "type": "COMPANY",
    "name": "Company"
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "John",
    "lastname": "Doe",
    "document": {
      "type": "CUIL",
      "id": "20963504870"
    },
    "email": "john.doe@example.com"
  },
  "intermediaries": [],
  "date": {
    "creationDate": "2024-09-23T17:38:47.667+00:00",
    "processedDate": "2024-09-23T17:38:50.4244067",
    "expirationDate": "2024-09-30T16:18:50.322266+00:00"
  },
  "errors": []
}
```

### Key Response Fields

| Parameter | Description | Use Case |
| - | - | - |
| `qr.code` | Raw QR code payload in standardized format | Render scannable QR code using any QR generation library. |
| `qr.expirationDate` | ISO timestamp when QR becomes invalid | Display countdown timer and handle expiration logic. |
| `externalId` | Your original reference number. | Internal reconciliation and order matching. |
| `status.code` | Current transaction state (`100` = `INPROGRESS`) | Determine next steps in payment flow. |
| `date.creationDate` | When transaction was created. | Analytics and performance tracking. |

### Error Response

When QR generation fails, you'll receive detailed error information:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "externalId": "ce0aaa1a-4532-43b9-930a-26e780aba99b",
  "status": {
    "code": "812",
    "description": "REJECTED"
  },
  "errors": [
    {
      "code": "812",
      "detail": "External Id already used - duplication"
    }
  ]
}
```

***

## Step 3. Display QR Code and Handle Payment

1. **QR Display**: Present QR code to customer through chosen channel.
2. **Bank App Scan**: Customer scans QR with their Argentine bank mobile app.
3. **Payment Authorization**: Customer confirms payment in their banking environment.
4. **Real-time Confirmation**: Localpayment receives instant payment notification.
5. **Status Update**: Your system receives webhook with payment confirmation.

![](https://mintcdn.com/localpayment-1fee3d41/thasGykLOKju8tM0/images/docs/34a44fbca10b1a48237bb6b66107f2c47eeeddd28411fd5a63bd5181b900718f-qr-arg.png?fit=max\&auto=format\&n=thasGykLOKju8tM0\&q=85\&s=20f081d728a53324d120c2e349e2cae1)

### Best Practices for QR Display

* Minimum display size: 250x250 pixels for mobile scanning.
* Maintain 1:1 aspect ratio without distortion.
* Ensure high contrast (dark on light background).
* Add quiet zone (white border) around QR code.
* Include alt text (e.g. "QR Code Payment").
* Show Clear Payment Instructions.
* Handle Time-to-Live (TTL) and Expiration.

***

## Step 4. Track Transaction Status

Monitor QR payment progress through these methods:

> [card] [Webhooks (Recommended)](https://docs.localpayment.com/docs/webhooks.md)
>
> Receive real-time notifications when transaction status changes. Most efficient for production environments.

> [card] [Status API Endpoint](https://docs.localpayment.com/reference/get-transaction-status.md)
>
> Query transaction status programmatically. Useful for polling or recovering lost webhook notifications.

> [card] [Business Portal View](https://docs.localpayment.com/docs/dashboard-overview.md)
>
> Visual interface for monitoring transactions. Great for manual oversight and detailed transaction analysis.

### Common Status Codes

The Localpayment API provides various status codes to indicate the progress and outcome of the payment in the response.

| Code | Status | Description |
| :- | :- | :- |
| `103` | `APPROVED` | The payin was confirmed but not credited yet. |
| `200` | `Completed` | The payin was completed. |
| `811` | `Rejected` | Requested amount is higher or lower than allowed max/min values. |

> [!NOTE]
>
> **Complete Reference**
>
> View all status codes in our [Transaction Status Documentation](https://docs.localpayment.com/reference/transaction-status-error-codes).

***

## Testing Your Integration

### Sandbox Environment

Use the staging environment for testing:

```
https://api.stage.localpayment.com/api/payin/
```

### Test QR Scenarios

Verify your integration handles these scenarios:

1. **Successful Payment**: Complete QR scan and payment flow.
2. **QR Expiration**: Handle expired QR codes gracefully.
3. **Multiple Payment Attempts**: Same QR scanned multiple times.
4. **Status Updates**: Webhook handling and status polling.

***

## Next Steps

After implementing QR payments, consider these additional capabilities:

> [card] [Refund the transaction](https://docs.localpayment.com/docs/refund-apm-payment.md)
>
> If necessary, you can refund the payment to the customer. Refer to the documentation for details.

> [card] [Review transaction details](https://docs.localpayment.com/reference/get-transaction-status.md)
>
> You can retrieve transaction information using the Localpayment API for detailed insights.


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