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 implement 3DS redirects when the API returns pending and url_3ds.

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://a55-auth.auth.us-east-1.amazoncognito.com/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://core-manager.a55.tech/api/v1/bank/wallet/charge/

curl -sS -X POST 'https://core-manager.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

{
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "confirmed",
"reference_external_id": "ord_001"
}
4

Handle 3DS redirect (if pending)

If the response includes url_3ds, redirect the buyer, then listen for the completion event:

window.addEventListener('message', function (event) {
if (event.data?.event === '3ds-auth-complete') {
const chargeUuid = event.data.chargeUuid;
// Fetch charge status and update your UI
}
});
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 →