Skip to main content
Learn how you can make your first test payment using the Localpayment API and understand the essentials for running secure payment flows in your sandbox environment. Get started by making your first test payment with the Localpayment API in the sandbox environment. You’ll authenticate your requests, explore available payment methods, run a card payment, manage webhooks, and check the final transaction status.

Overview

The Localpayment Sandbox is a complete testing platform that mirrors our production environment without processing real transactions. It provides a secure space to test your integration across various payment methods, currencies, and countries before going live.

Sandbox Environment

Use our dedicated sandbox API endpoint for all testing activities

Test Data

Access comprehensive test cards and accounts for all scenarios

Real-time Simulation

Receive instant webhook notifications for all test transactions

API Reference

Explore our complete API documentation with examples

Before You Begin

Before you begin, ensure you have:

API Credentials

Valid API credentials and access token for authentication.

Account Setup

Proper account setup for your target country and business verification.

IP Whitelisting

Whitelist your server IP addresses for API access.

Webhook Endpoint

Set up a webhook URL to receive payment notifications.

Step 1: Generate Access Token

To interact with Localpayment’s API, you need an access token for authentication. This token is required for all API requests. To generate an access token, you’ll need to make a POST request to the Generate an Access Token endpoint with your Localpayment username and password included in the request body as a JSON object.

Example Request

curl

Successful Response

ImportantUse the access token from the response in all subsequent API requests. Include it in the Authorization header as Bearer <your_access_token>. Tokens expire for security reasons - use the refresh token to obtain new access tokens without re-authenticating.

Step 2: Retrieve Available Payment Methods

Before creating a payment, check which payment methods are available for your account and target country. To get the available payment methods, send a GET request to the Get Available Payment Methods endpoint, including your accountNumber as a query parameter.

Example Request

curl

Successful Response

For card payments, look for payment methods where paymentMethodType is CreditCard or DebitCard. Note the code value (e.g., 1000 for Visa in Argentina) as you’ll need it for the payment request.

Step 3: Create a Payment Request

Now you’re ready to create your first test payment. We’ll use a credit card payment for Argentina as an example. To create a credit card payment, send a POST request to the Create Payin endpoint, including your access token in the Authorization header.

Key Request Fields

The request requires several key parameters:

Example Request

Below is an example using curl:
curl

Successful Response

A successful response includes detailed transaction information and tracking identifiers:

Key Response Fields


Step 4: Handle Webhook Notifications

Webhooks provide real-time notifications about transaction status changes. Configure your webhook URL in the Localpayment Business Portal to receive these notifications.

Webhook Payload Example

Implementation Tip:Your webhook endpoint should return a 200 OK status immediately upon receiving the webhook, then process the notification asynchronously to avoid timeouts.

Step 5: Track Transaction Status

You can proactively check transaction status using the Get Transaction Status endpoint. Send a GET request, replacing {externalId} with your unique transaction identifier to obtain the transaction status.

Example Request

curl

Successful Response

Common Status Codes

ImportantAlways check the status.code field to determine the transaction outcome. For the full list of possible transaction statuses, see the complete status reference.

Testing Different Payment Methods

Localpayment supports various payment methods beyond credit cards. Each method has specific request parameters and response structures. Below are examples for bank transfers with key differences highlighted.
Bank transfer payments allow customers to pay directly from their bank accounts through local payment schemes.

Example Request

curl

Key Request Differences for Bank Transfers

Successful Response

Key Response Differences for Bank Transfers


Next Steps

Explore Payins Options

Discover all available payment methods including cards and APMs.

Explore Payouts Options

Learn about sending payments to bank accounts and digital wallets.

Discover Country Coverage

Check available payment methods, currencies, and specific requirements for each country.

API Reference

Access complete API documentation with endpoints, parameters, and code examples.
Last modified on November 24, 2026