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

# Wallet Fri (Guatemala)

Localpayment enables merchants to process instant digital wallet payments through Guatemala's Wallet Fri system. This guide outlines the process for initiating Wallet Fri payments through Localpayment's API, detailing required parameters, handling responses, and interpreting status codes for seamless integration with Guatemala's popular digital wallet platform.

## Before You Begin

Ensure you have:

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

***

## Step 1. Create Wallet Fri Payment

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

### Key Request Parameters

The request requires several key objects specific to Wallet Fri payments:

| Object | Description | Required |
| - | - | - |
| `paymentMethod.type` | Must be `Wallet`. | ✅ |
| `paymentMethod.code` | Must be `1880` for Wallet Fri. | ✅ |
| `payer` | Payer account information. | ✅ |
| `merchant` | Merchant/business details | ✅ |
| `amount` | Transaction amount | ✅ |
| `currency` | Transaction currency code | ✅ |
| `country` | Must be `GTM` | ✅ |

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": "Wallet",
    "code": "1880",
    "flow": "DIRECT"
  },
  "currency": "GTQ",
  "merchant": {
    "type": "COMPANY",
    "name": "Company"
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "John",
    "lastName": "Doe",
    "document": {
      "type": "CUI",
      "id": "3463426000101"
    },
    "email": "john.doe@example.com",
    "phone": {
      "countryCode": "gt",
      "areaCode": "502",
      "number": "55555555"
    },
    "address": {
      "street": "",
      "city": "",
      "state": "",
      "country": "",
      "comment": ""
    }
  },
  "commercialData": {
    "items": [
      {
        "id": "1441",
        "title": "Playera",
        "description": "Playera negra",
        "quantity": "1",
        "unitPrice": 1
      }
    ]
  },
  "externalId": "cda5215e-2309-4b6c-b88b-bbce35951795",
  "country": "GTM",
  "amount": 10,
  "accountNumber": "{{YourAccountNumber}}",
  "conceptCode": "0001",
  "comment": "Acme"
}
'
```

***

## Step 2. Handle the Response

### Successful Response

When you create a Wallet Fri payment, the system automatically sends a push notification to the customer's Wallet Fri app. The API response confirms the payment request was successfully created and is pending customer authorization.

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "externalId": "cda5215e-2309-4b6c-b88b-bbce35951795",
  "internalId": "e6b174f3-ee21-4653-91e7-dea034facdad",
  "paymentMethod": {
    "type": "Wallet",
    "code": "1880",
    "flow": "DIRECT"
  },
  "country": "GTM",
  "currency": "GTQ",
  "amount": 10,
  "accountNumber": "{{YourAccountNumber}}",
  "confirmed": {
    "currency": "GTQ",
    "amount": 10,
    "fxQuote": 1
  },
  "payment": {
    "currency": "GTQ",
    "fxQuote": 1,
    "financingFee": 0,
    "amount": 10
  },
  "localTaxes": [],
  "withHoldings": [],
  "fees": {
    "description": "Fee",
    "currency": "GTQ",
    "fxSource": 1,
    "fxQuote": 1,
    "amount": 0,
    "account": "{{YourAccountNumber}}"
  },
  "status": {
    "code": "100",
    "description": "INPROGRESS",
    "detail": "The payin is pending the confirmation"
  },
  "merchant": {
    "type": "COMPANY",
    "name": "Company"
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "John",
    "lastname": "Doe",
    "document": {
      "type": "CUI",
      "id": "3463426000101"
    },
    "email": "john.doe@example.com",
    "phone": {
      "countryCode": "gt",
      "areaCode": "502",
      "number": "55555555"
    },
    "address": {
      "street": "",
      "city": "",
      "state": "",
      "country": "",
      "comment": ""
    }
  },
  "intermediaries": [],
  "date": {
    "creationDate": "2025-01-23T14:15:13.368+00:00",
    "processedDate": "2025-01-23T14:15:14.6506329",
    "expirationDate": "2025-01-30T14:15:13.550683"
  },
  "errors": []
}
```

### Key Response Fields

| Parameter | Description | Use Case |
| - | - | - |
| `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. |
| `date.expirationDate` | ISO timestamp when authorization expires. | Display countdown timer and handle expiration logic. |

#### Error Response

When Wallet Fri request creation 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. Customer Authorization Process

1. **Push Notification**: Customer receives payment request directly in Wallet Fri app.
2. **App Notification**: Payment request appears as push notification on mobile device.
3. **In-App Authorization**: Customer opens Wallet Fri app to review and authorize payment.
4. **Security Verification**: Customer completes PIN or biometric authentication.
5. **Payment Confirmation**: Transaction is processed instantly upon authorization.
6. **Status Update**: Your system receives webhook with final payment status.

***

## Step 4. Track Transaction Status

Monitor Wallet Fri 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 Wallet Fri payment.

| Code | Status | Description |
| :- | :- | :- |
| `100` | `INPROGRESS` | Payment request created, notification sent. |
| `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 Wallet Fri Scenarios

Verify your integration handles these scenarios:

1. **Successful Payment**: Customer receives notification and authorizes payment.
2. **Authorization Expired**: Customer doesn't respond within the time limit.
3. **Status Updates**: Webhook handling and status polling.

***

## Demo

The following demo shows how a customer pays a Wallet Fri payment request in the app, from the pending request to the payment receipt.

![Animated walkthrough of a customer paying a Localpayment request in the Wallet Fri app, from the pending request to the payment receipt](https://mintcdn.com/localpayment-1fee3d41/-KiHmfqcrFqGOaEH/images/docs/fd9657a09b9e168412b38715918b8a2e5c66580bbf2f478e2a299ec5183ae07d-wallet-fri-demo.gif?s=4fa8a5e0c2a3af1a0df336668d493cc5)

***

## Next Steps

After implementing Wallet Fri 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.