Pay charge (SDK)
POST
/api/v1/bank/public/charge/{uuid}/payPublic endpoint
This endpoint is called by the A55Pay SDK from the payer's browser. It does not require a Bearer token — the charge UUID acts as the authorization context. Your backend creates the charge first, then the frontend SDK calls this endpoint.
Request headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
uuid | string (UUID) | Yes | Charge UUID returned by Create charge |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
card_number | string | Yes | Card PAN |
card_name | string | Yes | Cardholder name |
card_expiry_month | string | Yes | Expiry month MM |
card_expiry_year | string | Yes | Expiry year YYYY |
card_cvv | string | Yes | Card verification value |
payer_tax_id | string | Yes | Payer tax ID (CPF, RFC, RUT) |
device_info | object | No | Browser fingerprint for 3DS (see Create charge) |
Response fields
| Field | Type | Description |
|---|---|---|
charge_uuid | string | Charge identifier |
status | string | confirmed, pending (3DS required), or error |
url_3ds | string | 3DS challenge redirect URL (when status: "pending") |
message | array/null | Error details when status: "error" |
HTTP status codes
| Status | Description |
|---|---|
| 200 | Payment processed or 3DS challenge initiated |
| 400 | Invalid card data or missing required fields |
| 404 | Charge not found or expired |
| 409 | Charge already paid or cancelled |
| 422 | Validation error (invalid card, expired) |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Code examples
- cURL
- Python
- Node.js
curl -s -X POST "https://core-manager.a55.tech/api/v1/bank/public/charge/a1b2c3d4-e5f6-7890-abcd-ef1234567890/pay" \
-H "Content-Type: application/json" \
-d '{
"card_number": "4024007153763191",
"card_name": "MARIA SILVA",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"card_cvv": "123",
"payer_tax_id": "123.456.789-09"
}'
import requests
charge_uuid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
try:
response = requests.post(
f"https://core-manager.a55.tech/api/v1/bank/public/charge/{charge_uuid}/pay",
json={
"card_number": "4024007153763191",
"card_name": "MARIA SILVA",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"card_cvv": "123",
"payer_tax_id": "123.456.789-09",
},
headers={"Content-Type": "application/json"},
)
response.raise_for_status()
result = response.json()
if result["status"] == "pending":
print(f"3DS redirect: {result['url_3ds']}")
else:
print(f"Payment: {result['status']}")
except requests.exceptions.HTTPError as e:
print(f"HTTP {e.response.status_code}: {e.response.json()}")
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
const chargeUuid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890";
try {
const response = await fetch(
`https://core-manager.a55.tech/api/v1/bank/public/charge/${chargeUuid}/pay`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
card_number: "4024007153763191",
card_name: "MARIA SILVA",
card_expiry_month: "12",
card_expiry_year: "2030",
card_cvv: "123",
payer_tax_id: "123.456.789-09",
}),
}
);
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
if (result.status === "pending") {
console.log(`3DS redirect: ${result.url_3ds}`);
} else {
console.log(`Payment: ${result.status}`);
}
} catch (error) {
console.error("Payment failed:", error.message);
}
Error response example
{
"charge_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "error",
"message": [
{
"code": "CARD_DECLINED",
"source": "acquirer",
"description": "Transaction declined by issuing bank"
}
]
}