Skip to main content

Host-to-Host Integration

Quick Reference

WhatServer-to-server charge API
WhyMaximum control over retries, idempotency, and error handling
Reading Time20 min
DifficultyAdvanced
PrerequisitesAuthentication → Environment

Host-to-Host (H2H) is direct API integration: your backend calls A55 with card and order data. You retain full control over retries, idempotency, and error handling.


Why H2H (comparison)

CriterionH2HSDKCheckout Page
Control levelFullPartialMinimal
Card data handlingYou collect, A55 securesBrowser SDK collects, A55 securesA55-hosted — fully managed
3DS managementYou handle redirectSDK handlesA55 handles
SecurityA55 encrypts and tokenizesA55 handles in browserA55 manages end-to-end
Best forTeams needing full controlNative checkout experienceFastest launch

When to use

  • You need to collect card data on your servers before sending it to A55.
  • You need maximum server-side control over the charge lifecycle.
  • You will handle payer redirects when the API returns pending and action_url (3DS challenge or fingerprint collection).

Card fields (request body)

FieldDescription
card_nameCardholder name as printed on the card
card_numberPrimary Account Number (PAN)
card_expiry_monthExpiry month (1–12)
card_expiry_yearExpiry year (four digits)
card_cvvCard verification value

Technical flow


Step-by-step integration

1

Get an access token

curl -s -X POST "https://auth.a55.tech/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET"
2

Build and send the charge

POST https://sandbox.api.a55.tech/api/v1/bank/wallet/charge/

curl -sS -X POST 'https://sandbox.api.a55.tech/api/v1/bank/wallet/charge/' \
-H 'Authorization: Bearer $ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: ord_001' \
-d '{
"wallet_uuid": "00000000-0000-4000-8000-000000000001",
"merchant_id": "merchant_123",
"payer_name": "Jane Doe",
"payer_email": "jane@example.com",
"payer_cell_phone": "+5511999999999",
"payer_tax_id": "12345678901",
"items": [{"name": "Order", "quantity": 1, "value": 10000}],
"payer_address": {"street": "Av. Paulista 1000", "city": "São Paulo", "state": "SP", "zip_code": "01310100", "country": "BR"},
"currency": "BRL",
"installment_value": 10000,
"installment_count": 1,
"due_date": "2026-12-31",
"description": "H2H charge",
"type_charge": "credit_card",
"card_name": "JANE DOE",
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2030,
"card_cvv": "123",
"reference_external_id": "ord_001",
"threeds_authentication": false,
"webhook_url": "https://merchant.example/webhooks/a55",
"redirect_url": "https://merchant.example/return"
}'
3

Handle the response

The response always returns the full charge object. The key fields that change by outcome are status, action_url, and message.

{
"charge_uuid": "a34f2499-2a40-40a5-8f5a-578002a88f51",
"local_currency": 159.8,
"currency": "EUR",
"usd_currency": 185.59,
"type": "credit_card",
"date": "2026-04-01",
"description": "#18770 Payments Cabo HDMI 2.1 Ultra 8K",
"due_date": "2025-10-11",
"status": "confirmed",
"message": [],
"installment_count": 1,
"installments": [],
"pix_payload": {},
"qra_payload": {},
"applepay_payload": {},
"charge_payment_url": null,
"action_url": "",
"session_id": null,
"subscription": {},
"reference_external_id": "10ccf81a-1de7-4a3e-b86d-f3f685e8ee57",
"is_async": false
}
4

Handle redirect (if pending)

If the response includes action_url, redirect the buyer to that URL. After the payer completes the action (3DS challenge or fingerprint), they are automatically redirected to your redirect_url. Always rely on the webhook for the final transaction status.

if (response.action_url) {
window.location.href = response.action_url;
}
5

Confirm via webhook

Configure webhook_url so you receive async status updates even if the buyer closes the browser.

{
"charge_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "paid",
"transaction_reference": "txn_ref_001"
}

Test with sandbox cards

Card NumberBrandScenarioExpected Status
4111 1111 1111 1111VisaSuccessful paymentconfirmed
5500 0000 0000 0004MastercardSuccessful paymentconfirmed
4000 0000 0000 0002VisaCard declineddeclined
4000 0000 0000 0101Visa3DS challenge requiredconfirmed
4000 0000 0000 0069VisaProcessing errorerror
5105 1051 0510 5100MastercardInsufficient fundsdeclined

Want higher approval rates?

Visa Data Only sends enriched transaction data to issuers through 3DS rails — without any challenge redirect. Square's pilot over 6 million transactions showed up to +646 basis points improvement.

If you already send device_info for 3DS, you already have the data. Set data_only: true instead of threeds_authentication: true.

Trade-off: no liability shift (merchant bears fraud). For high-volume, low-risk LATAM transactions, the approval rate gain typically exceeds fraud cost.

Learn how to activate Data Only →