Refund an APM Payment

Localpayment enables you to process refunds for Alternative Payment Methods (APMs) through both API integration and the Dashboard interface. This guide covers the complete refund workflow for APM transactions using the data-required refunds flow.

Before You Begin

Ensure you have:


Additional Refund Requirements:

  • Sufficient balance in your Localpayment account to cover the refund amount.
  • User role with refund permissions (see User Roles documentation).
  • The original transaction must be in Completed status.
  • The externalId of the original payment transaction.
  • Complete beneficiary information for data-required refunds.

Implementation Guide

Localpayment provides two methods for processing APM refunds: API integration for automated processing and Dashboard for manual operations.

API Refund Processing

Programmatically process refunds through REST API for automated workflows and integration with your systems.

Dashboard Refund Processing

Manually process refunds through the Localpayment Dashboard with a user-friendly interface. Note: All Dashboard refunds require approval.


Data-Required Refunds for APMs

APM refunds are processed as Data-Required Refunds, meaning you need both the original transaction's externalId and complete beneficiary information. Unlike direct refunds, this flow requires additional payer and bank details since QR payments involve specific beneficiary information that must be verified.

⚠️

Important: Only full refunds are permitted for APM transactions. Partial refunds are not supported.


Country-Specific Requirements

APM refunds have specific requirements and limitations depending on the country and payment method. Below are the key country-specific considerations:

  • Refund Flow: Data-required refunds with full beneficiary information.
  • Document Types: Supported Argentine document types (CUIL, DNI, etc.).
  • Processing: Refunds processed through local Argentine banking networks.

Step 1: Process Refund via API

To refund a APM payment through API, send a PATCH request to the Refund endpoint.

Key Request Parameters

The request requires several key parameters:

ParameterDescriptionRequired
externalIdThe original transaction's externalId
commentOptional note about the refund reason
beneficiaryRecipient details including bank information
beneficiary.typeBeneficiary type (INDIVIDUAL or COMPANY)
beneficiary.nameFirst name of the beneficiary
beneficiary.lastNameLast name of the beneficiary
beneficiary.document.typeDocument type of the beneficiary
beneficiary.document.idDocument ID of the beneficiary
beneficiary.bank.nameName of the beneficiary's bank
beneficiary.bank.codeBank code
beneficiary.bank.account.typeAccount type
beneficiary.bank.account.numberAccount number of the beneficiary

Example Request

Below is an example using curl:

curl --request PATCH \
  --url 'https://api.stage.localpayment.com/api/payin/{{externalId}}/refund' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <your_access_token>' \
  --data '{
    "comment": "Refund APM",
    "beneficiary": {
      "type": "INDIVIDUAL",
      "name": "John",
      "lastName": "Doe",
      "document": {
        "type": "CUIL",
        "id": "20961504870"
      },
      "bank": {
        "name": "BANCO INDUSTRIAL S.A.",
        "code": "322",
        "account": {
          "type": "C",
          "number": "3220001805117354710015"
        }
      }
    }
  }'

See all available parameters in the request.


Step 2: Handle the Response

Successful Response

A successfully processed refund returns confirmation details:

{
  "externalId": "1c364061-1f3d-4b94-c270-bf915c22e8f5",
  "internalId": "8a9abd31-31e0-429a-32a6-cca8b9e1e536",
  "status": {
    "code": "902",
    "description": "REFUNDED",
    "detail": "The payin was refunded"
  }
}

Key Response Fields

ParameterDescriptionUse Case
externalIdYour reference for the original transaction.Reconciliation and tracking.
internalIdLocalpayment's unique refund identifier.Support and audit purposes.
status.codeRefund status code (902 for successful refund).Status monitoring.

Error Response

When a refund request fails, you'll receive error information:

{
  "status": {
    "code": "400",
    "description": "ERROR",
    "detail": "Invalid operation"
  }
}

Common Error Scenarios

ErrorDescriptionSolution
Insufficient FundsYour Localpayment account balance is insufficient to cover the refund amountAdd funds to your Localpayment account or wait for pending settlements to clear
Transaction Not FoundThe provided externalId does not exist or is invalidVerify the externalId is correct and the transaction exists in your transaction history
Invalid StatusThe original transaction is not in a refundable state (must be Completed)Check the transaction status and ensure it has been successfully processed before attempting refund
Permission DeniedYour user role lacks necessary refund permissionsContact your account administrator to grant appropriate refund permissions for your role
Duplicate RefundAttempting to refund an already refunded transactionVerify the transaction hasn't been refunded previously by checking the refund status
Invalid AmountAttempting a partial refund when only full refunds are allowedProcess refund for the full transaction amount only

Dashboard Refunds

APM refunds can also be processed through the Localpayment Dashboard interface. This method provides a visual workflow for managing refunds and is particularly useful for:

  • Occasional refunds that don't require API automation.
  • Administrative oversight where approval workflows are needed.
  • Quick refund processing without development resources.

For detailed instructions on processing refunds through the Dashboard, including step-by-step guidance and interface walkthroughs, please refer to the Dashboard Refunds Guide .

⚠️

Approval Required: All refunds initiated through the Localpayment Dashboard require approval through the designated authorization workflow. Ensure you have the necessary user permissions before attempting Dashboard refunds.


Step 3: Track Refund Status

After initiating a refund, monitor its progress through these methods:

Common Refund Status Codes

CodeStatusDescription
400ERRORRefund request failed due to validation errors or invalid parameters.
902REFUNDEDThe payin was successfully refunded.
📝

Note: For complete status code reference, see the Transaction Status documentation.


Testing Your Integration

Test Scenarios

Verify your integration handles these scenarios:

  1. Successful Refund: Process refund with valid externalId and sufficient funds.
  2. Insufficient Funds: Attempt refund with inadequate account balance.
  3. Invalid Transaction: Try to refund non-existent externalId.
  4. Duplicate Refund: Attempt to refund already refunded transaction.
  5. Permission Validation: Test with users having different permission levels.

Next Steps