LaConnet Gateway Integration Guide
Use this guide to authenticate your application, initiate payments, perform gateway-managed 3DS authentication, receive callbacks, process webhooks and test expected payment outcomes in the sandbox.
Integration overview
Recommended payment processing sequence.
Obtain credentials
Generate your station API key and secret from Developer Settings.
Create payment
Submit the order, customer, device and card information.
Complete 3DS
Redirect or challenge the cardholder when authentication is required.
Verify result
Confirm the final transaction status from the API or webhook.
Authentication
Include your station API credentials on every protected request. Keep API secrets on your server and never expose them in browser JavaScript or mobile application code.
| Header | Required | Description | Example |
|---|---|---|---|
X-Api-Key
|
Required | API key issued for the store. |
lct_test_xxxxxxxxx
|
X-Api-Secret
|
Required | Secret issued with the store API key. |
sec_xxxxxxxxx
|
X-Store-Identifier
|
Required | Unique store identifier. |
1000000005
|
Idempotency-Key
|
Optional | Unique value used to prevent duplicate payment requests. |
1199679095
|
Payment endpoints
Use the sandbox base URL while developing and switch to production only after completing integration testing.
https://sandbox.laconnet.com
https://checkout.laconnet.com
/api/gateway/v2/transaction/pay
Create Payment
Creates a payment transaction. When useGatewayAuthentication=true and 3DS authentication is required, LaConnet Gateway returns serverAuthentication=true together with redirectUrl. The merchant must redirect the customer's browser to redirectUrl to complete the 3DS authentication flow.
Request headers
| Name | Required | Description | Example |
|---|---|---|---|
X-Api-Key
|
Required | API key issued for the store. | lct_test_xxxxxxxxx |
X-Api-Secret
|
Required | Secret issued with the store API key. | sec_xxxxxxxxx |
X-Store-Identifier
|
Required | Unique store identifier. | 1000000005 |
Idempotency-Key
|
Optional | Unique value used to prevent duplicate payment requests. | 1199679095 |
Request fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
orderId
|
string | Required | Unique merchant order identifier. |
1646794917
|
amount
|
decimal | Required | Transaction amount using two decimal places. |
100.50
|
currency
|
string | Required | ISO 4217 three-character currency code. |
USD
|
customer.firstName
|
string | Required | Customer's first name. |
John
|
customer.lastName
|
string | Required | Customer's last name. |
Doe
|
customer.email
|
string | Required | Customer's valid email address. |
john.doe@example.com
|
customer.address.street
|
string | Required | Customer's street address. |
123 Main Street
|
customer.address.city
|
string | Required | Customer's city. |
New York
|
customer.address.state
|
string | Required | Customer's state or province. |
NY
|
customer.address.country
|
string | Required | ISO alpha-3 country code. |
USA
|
customer.address.phoneNumber
|
string | Required | International phone number. Use '+' followed by the country code, a space and the national number. |
+1 905123456
|
customer.address.zipPostalCode
|
string | Required | Customer's ZIP or postal code. |
903856
|
customer.address.mobilePhone
|
string | Optional | Customer's mobile phone number in international format. |
+1 905123456
|
card.cardNumber
|
string | Required | Primary account number. Never log or persist this value. |
5123450000000008
|
card.expiryMonth
|
string | Required | Two-digit card expiry month. |
01
|
card.expiryYear
|
string | Required | Four-digit card expiry year. |
2039
|
card.cvv
|
string | Required | Card security code. Never store this value. |
100
|
card.nameOnCard
|
string | Optional | Customer's name as printed on the card. If omitted, the customer's first and last names may be used. |
John Doe
|
useGatewayAuthentication
|
boolean | Required | Enables LaConnet Gateway-managed 3DS authentication. When authentication is required, the response will contain serverAuthentication=true and redirectUrl. Redirect the customer's browser to redirectUrl. |
true
|
captureOnAuthorization
|
boolean | Optional | When true, captures the transaction after successful authorization. |
true
|
returnUrl
|
string | Required | HTTPS URL to which LaConnet returns the customer's browser after the 3DS authentication flow. The merchant should verify the final transaction status server-to-server after the customer returns. |
https://webhook.site/92aa241a-4a08-4ba9-b47c-a2384b07221a
|
idempotencyKey
|
string | Required | Unique key for the payment operation. |
1199679095
|
Request example
{
"orderId": "1646794917",
"amount": 100.50,
"currency": "USD",
"customer": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"address": {
"street": "123 Main Street",
"city": "New York",
"state": "NY",
"country": "USA",
"phoneNumber": "+1 905123456",
"zipPostalCode": "903856",
"mobilePhone": "+1 905123456"
}
},
"card": {
"nameOnCard": "John Doe",
"cardNumber": "5123450000000008",
"expiryMonth": "01",
"expiryYear": "2039",
"cvv": "100"
},
"useGatewayAuthentication": true,
"captureOnAuthorization": true,
"returnUrl": "https://webhook.site/92aa241a-4a08-4ba9-b47c-a2384b07221a",
"idempotencyKey": "1199679095"
}
Successful response
{
"statusCode": 201,
"status": "SUCCESS",
"serverAuthentication": true,
"redirectUrl": "https://sandbox.laconnet.com/mx-authenticate-payer/mx0e5a794e0ee23831a9e5997e0635abd3f2b95ae83da53d20bf0ee4c9559f95ee?transactionId=1349001213",
"authenticationTransactionId": "1349001213"
}
Error response
{
"statusCode": 401,
"status": "ERROR",
"error": {
"cause": "INVALID_REQUEST",
"explanation": "A required payment field is missing or invalid.",
"field": "customer.address.phoneNumber",
"validationType": "INVALID"
}
}
Code examples
curl --request POST "https://sandbox.laconnet.com/api/gateway/v2/transaction/pay" \
--header "Content-Type: application/json" \
--header "X-Api-Key: YOUR_API_KEY" \
--header "X-Api-Secret: YOUR_API_SECRET" \
--header "X-Store-Identifier: YOUR_STORE_IDENTIFIER" \
--header "Idempotency-Key: 1199679095" \
--data '{ "orderId": "1646794917", "amount": 100.50, "currency": "USD", "customer": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "address": { "street": "123 Main Street", "city": "New York", "state": "NY", "country": "USA", "phoneNumber": "+1 905123456", "zipPostalCode": "903856", "mobilePhone": "+1 905123456" } }, "card": { "nameOnCard": "John Doe", "cardNumber": "5123450000000008", "expiryMonth": "01", "expiryYear": "2039", "cvv": "100" }, "useGatewayAuthentication": true, "captureOnAuthorization": true, "returnUrl": "https://webhook.site/92aa241a-4a08-4ba9-b47c-a2384b07221a", "idempotencyKey": "1199679095"}'
using System.Net.Http.Json;
using System.Text.Json;
var client = new HttpClient
{
BaseAddress = new Uri("https://sandbox.laconnet.com")
};
client.DefaultRequestHeaders.Add(
"X-Api-Key",
"YOUR_API_KEY");
client.DefaultRequestHeaders.Add(
"X-Api-Secret",
"YOUR_API_SECRET");
client.DefaultRequestHeaders.Add(
"X-Store-Identifier",
"YOUR_STORE_IDENTIFIER");
client.DefaultRequestHeaders.Add(
"Idempotency-Key",
"1199679095");
var request = new
{
orderId = "1646794917",
amount = 100.50m,
currency = "USD",
customer = new
{
firstName = "John",
lastName = "Doe",
email = "john.doe@example.com",
address = new
{
street = "123 Main Street",
city = "New York",
state = "NY",
country = "USA",
phoneNumber = "+1 905123456",
zipPostalCode = "903856",
mobilePhone = "+1 905123456"
}
},
card = new
{
nameOnCard = "John Doe",
cardNumber = "5123450000000008",
expiryMonth = "01",
expiryYear = "2039",
cvv = "100"
},
useGatewayAuthentication = true,
captureOnAuthorization = true,
returnUrl =
"https://webhook.site/92aa241a-4a08-4ba9-b47c-a2384b07221a",
idempotencyKey = "1199679095"
};
var response = await client.PostAsJsonAsync(
"/api/gateway/v2/transaction/pay",
request);
var responseBody =
await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
throw new InvalidOperationException(
$"Payment request failed: {responseBody}");
}
using var document =
JsonDocument.Parse(responseBody);
var root = document.RootElement;
/*
|--------------------------------------------------------------------------
| Check whether LaConnet Gateway requires 3DS authentication
|--------------------------------------------------------------------------
*/
var serverAuthentication =
root.TryGetProperty(
"serverAuthentication",
out var serverAuthenticationProperty)
&&
serverAuthenticationProperty.ValueKind ==
JsonValueKind.True;
var redirectUrl =
root.TryGetProperty(
"redirectUrl",
out var redirectUrlProperty)
? redirectUrlProperty.GetString()
: null;
var authenticationTransactionId =
root.TryGetProperty(
"authenticationTransactionId",
out var authenticationIdProperty)
? authenticationIdProperty.GetString()
: null;
if (
serverAuthentication &&
!string.IsNullOrWhiteSpace(redirectUrl)
)
{
/*
* Return redirectUrl to your frontend.
*
* Your frontend must redirect the CUSTOMER'S BROWSER
* to this URL.
*/
return new
{
requiresAuthentication = true,
redirectUrl,
authenticationTransactionId
};
}
/*
|--------------------------------------------------------------------------
| No authentication redirect required
|--------------------------------------------------------------------------
*/
var status =
root.TryGetProperty(
"status",
out var statusProperty)
? statusProperty.GetString()
: null;
var transactionReference =
root.TryGetProperty(
"gatewayTransactionReference",
out var referenceProperty)
? referenceProperty.GetString()
: null;
return new
{
requiresAuthentication = false,
status,
transactionReference
};
const response = await fetch(
"https://sandbox.laconnet.com/api/gateway/v2/transaction/pay",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY",
"X-Api-Secret": "YOUR_API_SECRET",
"X-Store-Identifier": "YOUR_STORE_IDENTIFIER",
"Idempotency-Key": "1199679095"
},
body: JSON.stringify({
orderId: "1646794917",
amount: 100.50,
currency: "USD",
customer: {
firstName: "John",
lastName: "Doe",
email: "john.doe@example.com",
address: {
street: "123 Main Street",
city: "New York",
state: "NY",
country: "USA",
phoneNumber: "+1 905123456",
zipPostalCode: "903856",
mobilePhone: "+1 905123456"
}
},
card: {
nameOnCard: "John Doe",
cardNumber: "5123450000000008",
expiryMonth: "01",
expiryYear: "2039",
cvv: "100"
},
useGatewayAuthentication: true,
captureOnAuthorization: true,
returnUrl:
"https://webhook.site/92aa241a-4a08-4ba9-b47c-a2384b07221a",
idempotencyKey: "1199679095"
})
}
);
const result = await response.json();
if (!response.ok) {
throw new Error(
result?.error?.explanation ||
result?.message ||
"Payment request failed."
);
}
/*
|--------------------------------------------------------------------------
| Gateway-managed 3DS Authentication
|--------------------------------------------------------------------------
|
| If serverAuthentication is true, redirect the customer's browser
| to the redirectUrl returned by LaConnet Gateway.
|
*/
if (
result.serverAuthentication === true &&
result.redirectUrl
) {
window.location.href = result.redirectUrl;
return;
}
/*
|--------------------------------------------------------------------------
| No redirect required
|--------------------------------------------------------------------------
*/
if (
result.status === "CAPTURED" ||
result.status === "APPROVED"
) {
console.log(
"Payment completed:",
result.gatewayTransactionReference
);
return;
}
console.log(
"Payment status:",
result.status
);
redirectUrl returned by Create Payment
3DS Authentication
When useGatewayAuthentication=true, LaConnet Gateway may require cardholder authentication before the payment can proceed. If the Create Payment response contains serverAuthentication=true, redirect the customer's browser to the returned redirectUrl. LaConnet Gateway handles the 3DS authentication flow and returns the customer to the returnUrl supplied in the original payment request.
Request fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
serverAuthentication
|
boolean | Required | Indicates whether the customer must complete LaConnet Gateway-managed 3DS authentication. |
true
|
redirectUrl
|
string | Required | The URL to which the merchant must redirect the customer's browser. |
https://checkout.laconnet.com/mx-authenticate-payer/...
|
authenticationTransactionId
|
string | Required | Unique identifier assigned to the 3DS authentication transaction. |
1349001213
|
returnUrl
|
string | Required | Merchant URL supplied during Create Payment. The customer's browser is returned to this URL after the authentication process. |
https://webhook.site/92aa241a-4a08-4ba9-b47c-a2384b07221a
|
Successful response
{
"statusCode": 201,
"status": "SUCCESS",
"serverAuthentication": true,
"redirectUrl": "https://sandbox.laconnet.com/mx-authenticate-payer/mx0e5a794e0ee23831a9e5997e0635abd3f2b95ae83da53d20bf0ee4c9559f95ee?transactionId=1349001213",
"authenticationTransactionId": "1349001213"
}
Code examples
/*
* This response should normally be passed from
* your backend to your frontend.
*/
if (
response.ServerAuthentication &&
!string.IsNullOrWhiteSpace(response.RedirectUrl)
)
{
return Redirect(response.RedirectUrl);
}
/*
* result is the response returned from Create Payment.
*/
if (
result.serverAuthentication === true &&
result.redirectUrl
) {
// Redirect the CUSTOMER'S BROWSER to LaConnet Gateway.
window.location.href = result.redirectUrl;
}
/api/gateway/v2/transaction/get/{transactionReference}
Retrieve Payment Status
Retrieves the latest status of an existing gateway payment. Merchants should use this endpoint after the customer returns from 3DS authentication to confirm the final payment status before fulfilling the order.
Request headers
| Name | Required | Description | Example |
|---|---|---|---|
X-Api-Key
|
Required | API key issued for the store. | |
X-Api-Secret
|
Required | Secret issued with the store API key. | |
X-Store-Identifier
|
Required | Unique store identifier. | |
Request fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
transactionReference/tranId
|
string | Required | LaConnet transaction reference returned during payment. |
1225764026
|
Successful response
{
"statusCode": 201,
"status": "CAPTURED",
"statusMessage": "Approved: Payment was successful.",
"requestType": "PAYMENT",
"orderId": "1779182726",
"transactionId": "1225764026",
"idempotencyKey": "1199679096",
"orderAmount": 100.5,
"orderCurrency": "USD",
"transactionAmount": 100.5,
"transactionCurrency": "USD",
"authenticationTransactionId": "1349001213",
"gatewayTransactionReference": "1225764026",
"error": null,
"time": "2026-08-18T22:57:41.144Z"
}
Error response
{
"statusCode": 404,
"status": "NOT_FOUND",
"message": "Transaction was not found."
}
Code examples
curl --request GET \
"https://sandbox.laconnet.com/api/gateway/v2/transaction/get/1225764026" \
--header "X-Api-Key: YOUR_API_KEY" \
--header "X-Api-Secret: YOUR_API_SECRET" \
--header "X-Store-Identifier: YOUR_STORE_IDENTIFIER"
/api/gateway/v2/transaction/refund
Refund Payment
Creates a full or partial refund against an approved or captured payment.
Request headers
| Name | Required | Description | Example |
|---|---|---|---|
X-Api-Key
|
Required | API key issued for the store. | |
X-Api-Secret
|
Required | Secret issued with the store API key. | |
X-Store-Identifier
|
Required | Unique store identifier. | |
Idempotency-Key
|
Optional | Unique identifier for the refund operation. | |
Request fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
amount
|
decimal | Optional | Refund amount. Omit where the endpoint supports a full refund. |
50.00
|
currency
|
string | Required | Must match the original transaction currency. |
USD
|
reason
|
string | Optional | Merchant's refund reason. |
Customer requested refund.
|
Request example
{
"amount": 50.00,
"currency": "USD",
"reason": "Customer requested refund."
}
Successful response
{
"success": true,
"status": "REFUNDED",
"originalTransactionReference": "1444154958",
"refundTransactionReference": "1444154960",
"amount": 50.00,
"currency": "USD"
}
/api/gateway/v2/transaction/void
Void Payment
Voids an authorized payment before settlement or capture where the processor supports void operations.
Request headers
| Name | Required | Description | Example |
|---|---|---|---|
X-Api-Key
|
Required | API key issued for the store. | |
X-Api-Secret
|
Required | Secret issued with the store API key. | |
X-Store-Identifier
|
Required | Unique store identifier. | |
Idempotency-Key
|
Optional | Unique identifier for the void operation. | |
Request fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
approvedTransactionId
|
string | Required | Original approved transaction reference. |
1444154958
|
idempotencyKey
|
string | Optional | Unique identifier for the void request. |
12345678
|
Request example
{
"approvedTransactionId": "1444154958",
"idempotencyKey": "12345678"
}
Successful response
{
"success": true,
"status": "VOIDED",
"originalTransactionReference": "1444154958",
"voidTransactionReference": "1444154960",
"amount": 100.50,
"currency": "USD"
}
3DS authentication
When gateway authentication is enabled, LaConnet determines whether a frictionless result or cardholder challenge is required.
- Send browser and device information with the payment request.
-
Inspect the response for
serverAuthentication = trueandredirectUrl. - Redirect the customer only to the URL returned by the gateway.
- After the customer returns, retrieve the payment status server-to-server before fulfilling the order.
Return URL and callbacks
The return URL is used for browser redirection. It must not be treated as the sole source of truth for payment status.
Webhook notifications
Configure an HTTPS webhook endpoint in Developer Settings. Respond with a successful 2xx response after validating and recording the notification.
{
"notificationType": "PAYMENT",
"merchant": "TESTLACONNETMID",
"order": {
"id": "1552883048",
"reference": "1552883048",
"amount": 100.50,
"currency": "USD",
"status": "CAPTURED"
},
"transaction": {
"id": "1348318653",
"reference": "1348318653",
"type": "PAYMENT",
"amount": 100.50,
"currency": "USD",
"authorizationCode": "295526",
"stan": "295526"
},
"response": {
"gatewayCode": "APPROVED",
"acquirerCode": "00",
"acquirerMessage": "Approved"
},
"result": "SUCCESS",
"timeOfRecord": "2026-07-19T14:15:14.415Z"
}
{
"notificationType": "AUTHENTICATION",
"merchant": "TESTLACONNETMID",
"authentication": {
"version": "3DS2",
"amount": 100.50,
"transactionId": "1411015263",
"3ds": {
"acsEci": "02",
"transactionId": "891f8b0b-9eeb-424b-9ceb-680b459a1a54"
},
"3ds2": {
"protocolVersion": "2.2.0",
"transactionStatus": "Y",
"authenticationScheme": "MASTERCARD"
}
},
"order": {
"id": "1552883048",
"reference": "1552883048",
"authenticationStatus": "AUTHENTICATION_SUCCESSFUL"
},
"response": {
"gatewayCode": "APPROVED",
"gatewayRecommendation": "PROCEED"
},
"result": "SUCCESS"
}
{
"notificationType": "REFUND",
"merchant": "TESTLACONNETMID",
"order": {
"id": "1552883048",
"reference": "1552883048",
"currency": "USD",
"totalRefundedAmount": 50.00
},
"transaction": {
"id": "1348318660",
"reference": "1348318660",
"type": "REFUND",
"amount": 50.00,
"currency": "USD"
},
"response": {
"gatewayCode": "APPROVED"
},
"result": "SUCCESS"
}
Sandbox scenarios
Select these scenarios from the sandbox console to test expected gateway outcomes.
MPGS Mastercard Approved
MPGS_MC_APPROVED
Simulates an approved Mastercard payment.
MPGS Mastercard Declined
MPGS_MC_DECLINED
Simulates an issuer-declined Mastercard payment.
3DS Frictionless
MPGS_3DS_FRICTIONLESS
Simulates successful frictionless 3DS authentication.
3DS Challenge Required
MPGS_3DS_CHALLENGE
Simulates a transaction requiring cardholder challenge. The payment response contains serverAuthentication=true and a redirectUrl.
Insufficient Funds
MPGS_INSUFFICIENT_FUNDS
Simulates issuer response code 51.
Response codes
| Code | Status | Description | Recommended action |
|---|---|---|---|
00
|
APPROVED | Transaction approved by the acquirer. | Complete the order and store the transaction reference. |
05
|
DECLINED | Transaction was declined by the issuer. | Ask the customer to contact their bank or use another card. |
51
|
DECLINED | Insufficient funds. | Ask the customer to use another payment method. |
54
|
DECLINED | Card has expired. | Ask the customer to use a valid card. |
82
|
DECLINED | Issuer or card-scheme policy restriction. | Resubmit using alternative payment details. |
91
|
FAILED | Issuer or payment network unavailable. | Retry later using the same idempotency key where appropriate. |
INVALID_REQUEST
|
ERROR | The request is missing a required field or contains an invalid value. | Correct the field specified in the error response. |
UNAUTHORIZED
|
ERROR | The API credentials or store identifier are invalid. | Verify the API key, secret, environment and store identifier. |