Payments

Overview

This document outlines the process for initiating a transaction through the Facilero API. By using the provided curl command, you can make a POST request to start the transaction. Once the request is processed, a webhook will deliver the transaction details to your server. If 3D Secure authentication is required, the client will need to be redirected to complete the process.

API Endpoint

Live

POST https://live.facilero.com/api/v1/payments/card

Sandbox

POST https://sandbox.facilero.com/api/v1/payments/card

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer <AUTH_TOKEN>
    Replace <AUTH_TOKEN> with the actual token obtained from the Authorization Service.
  • Referer: <REFERER_URL>
    Replace <REFERER_URL> with the relevant referring URL.

Request Body

Fields

FieldTypeRequiredDescription
requestIdStringYesUnique ID for the payment request.
midStringYesMerchant account ID to which the transaction will be associated.
cardObject (Card)YesContains card details (see Card Object).
amountStringYesTransaction amount as a string. Follow currency precision rules.
currencyStringYesISO 4217 currency code (e.g., USD, EUR).
langStringYesLanguage code for communication.
callbackUrlStringNoURL for receiving transaction status updates. Required for 3D transactions (requestThreeDSecure = true).
successRedirectUrlStringNoURL to redirect the customer after a successful payment. Required for 3D transactions (requestThreeDSecure = true).
failureRedirectUrlStringNoURL to redirect the customer after a failed payment. Required for 3D transactions (requestThreeDSecure = true).
billingDetailsObject (BillingDetails)YesContains billing details such as name, address, and contact info (see BillingDetails Object).
orderObject (Order)YesContains order information (see Order Object).
deviceObject (Device)YesContains device information for risk assessment (see Device Object).
kycVerifiedBooleanNoIndicates if the customer has been KYC (Know Your Customer) verified.
previousPaymentCountLongNoNumber of previous payments (for First-Time Deposit (FTD) calculations).
metadataMap<String, String>NoAdditional key-value metadata for custom use.

Card Object

FieldTypeRequiredDescription
numberStringYesCard number in string format.
cardHolderNameStringNoName of the cardholder as printed on the card.
expMonthStringYesExpiration month of the card (MM format).
expYearStringYesExpiration year of the card (YYYY format).
cvvStringYesCard verification code (CVV/CVC).
requestThreeDSecureBooleanYesIndicates whether 3D Secure is required.

BillingDetails Object

FieldTypeRequiredDescription
externalUserIdStringNoExternal identifier for the customer in your system.
firstNameStringYesFirst name of the customer.
lastNameStringYesLast name of the customer.
address1StringYesBilling address line 1.
cityStringYesBilling city.
stateStringYesBilling state or province.
countryStringYesBilling country (ISO Alpha-2 format, e.g., US, FR).
postalCodeStringYesPostal code.
phoneStringNoCustomer’s phone number.
emailStringYesCustomer’s email address.
dateOfBirthStringYesCustomer’s date of birth (YYYY-MM-DD format).

Order Object

FieldTypeRequiredDescription
dateStringNoDate of the order.
orderIdStringNoUnique identifier for the order.
titleStringNoTitle or name of the order.
siteIdStringNoSite identifier where the order was placed.
nameStringNoCustomer's name for the order.
domainNameStringNoDomain name where the order was placed.

Device Object

FieldTypeRequiredDescription
deviceIdStringNoUnique identifier for the device.
fingerprintDataStringNoDevice fingerprint data for risk assessment.
ipStringYesCustomer's IP address.
acceptStringNoBrowser's accept header. Required for 3D Secure transactions
acceptLanguageStringNoLanguage accepted by the browser. Required for 3D Secure transactions
userAgentStringYesUser-Agent header for identifying the browser.
javaEnabledBooleanNoFlag indicating whether Java is enabled. Required for 3D Secure transactions
javaScriptEnabledBooleanNoFlag indicating whether JavaScript is enabled. Required for 3D Secure transactions
deviceLanguageStringNoLanguage set on the device. Required for 3D Secure transactions
colorDepthStringNoScreen color depth in bits. Required for 3D Secure transactions
screenHeightStringNoScreen height in pixels. Required for 3D Secure transactions
screenWidthStringNoScreen width in pixels. Required for 3D Secure transactions
deviceTimezoneStringNoTimezone of the device. Required for 3D Secure transactions

Example Request Body

{
  "requestId": "req12345",
  "mid": "merchant456",
  "card": {
    "number": "4111111111111111",
    "cardHolderName": "John Doe",
    "expMonth": "12",
    "expYear": "2025",
    "cvv": "123",
    "requestThreeDSecure": true
  },
  "amount": "100.00",
  "currency": "USD",
  "lang": "en",
  "callbackUrl": "https://yourserver.com/callback",
  "successRedirectUrl": "https://yourserver.com/success",
  "failureRedirectUrl": "https://yourserver.com/failure",
  "billingDetails": {
    "firstName": "John",
    "lastName": "Doe",
    "address1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "country": "US",
    "postalCode": "10001",
    "phone": "+123456789",
    "email": "[email protected]"
  },
  "order": {
    "date": "2024-10-10",
    "orderId": "ord789",
    "title": "Product Purchase",
    "siteId": "site001",
    "name": "John Doe",
    "domainName": "example.com"
  },
  "device": {
    "deviceId": "device123",
    "fingerprintData": "fingerprintData",
    "ip": "192.168.1.1",
    "accept": "*/*",
    "acceptLanguage": "en-US",
    "userAgent": "Mozilla/5.0",
    "javaEnabled": true,
    "javaScriptEnabled": true,
    "deviceLanguage": "en",
    "colorDepth": "24",
    "screenHeight": "1080",
    "screenWidth": "1920",
    "deviceTimezone": "America/New_York"
  },
  "kycVerified": true,
  "previousPaymentCount": 5,
  "metadata": {
    "customKey1": "customValue1",
    "customKey2": "customValue2"
  }
}

Response Body

FieldTypeRequiredDescription
transactionIdStringYesUnique identifier for the transaction.
transactionStatusStringYesCurrent status of the transaction (e.g., NEW, PENDING, FAILED, REFUNDED, etc.).
declineCodeIntNoDecline code if the transaction fails.
challengeUrlStringNoURL for the 3D Secure challenge (if required for redirection).
challengeUrlIframeStringNoURL for embedding the 3D Secure challenge in an iframe (if supported).

Example Response Body

Successful Response Example:

{
  "transactionId": "txn12345",
  "transactionStatus": "SUCCEED",
}

Failed Response Example:

{
  "transactionId": "txn67890",
  "transactionStatus": "FAILED",
  "declineCode": 101
}

3D Secure Challenge Example:

supporting iframe

{
  "transactionId": "txn11223",
  "transactionStatus": "CUSTOMER_VERIFICATION",
  "challengeUrl": "https://secure-3ds-url.com/challenge",
  "challengeUrlIframe": "https://secure-3ds-url.com/iframe-challenge"
}

Not Supporting Iframe

{
  "transactionId": "txn11223",
  "transactionStatus": "CUSTOMER_VERIFICATION",
  "challengeUrl": "https://secure-3ds-url.com/challenge",
}

Merchant Callback DTO

The Merchant Callback DTO represents the structure of the callback data sent to the callbackUrl specified in the payment request. This object contains details about the transaction and its status.

Fields

FieldTypeRequiredDescription
transactionIdStringYesUnique identifier for the transaction.
requestIdStringYesThe original request ID provided when initiating the transaction.
midStringYesMerchant ID associated with the transaction.
transactionStatusEnum (TxStatus)YesThe status of the transaction (e.g., SUCCEED, FAILED, PENDING).
declineCodeIntegerNoCode indicating the reason for transaction failure (if applicable).
cardMaskStringYesMasked card number (e.g., 4111********1111).
cardHolderStringNoName of the cardholder (if available).
orderCurrencyStringYesThe currency of the original order, represented as an ISO 4217 code.
processedCurrencyStringYesThe currency in which the transaction was processed, as an ISO 4217 code.
orderAmountDoubleYesThe original amount of the transaction in the order currency.
processedAmountDoubleYesThe amount processed in the processed currency.
conversionRateDoubleYesThe conversion rate applied for currency exchange (if applicable).
callbackUrlStringNoThe URL where the callback was sent.
billingDetailsObject (BillingDetails)YesDetails of the customer’s billing information (see BillingDetails object).
orderObject (Order)YesInformation about the associated order (see Order object).
createdAtStringYesTimestamp when the transaction was created.

Example Callback Object

{
  "transactionId": "txn12345",
  "requestId": "req67890",
  "mid": "merchant001",
  "transactionStatus": "SUCCEED",
  "declineCode": null,
  "cardMask": "411111******1111",
  "cardHolder": "John Doe",
  "orderCurrency": "USD",
  "processedCurrency": "USD",
  "orderAmount": 100.0,
  "processedAmount": 100.0,
  "conversionRate": 1.0,
  "callbackUrl": "https://yourserver.com/callback",
  "billingDetails": {
    "firstName": "John",
    "lastName": "Doe",
    "country": "US",
    "email": "[email protected]"
  },
  "order": {
    "orderId": "order789",
    "title": "Product Purchase"
  },
  "createdAt": "2024-01-01T12:00:00Z"
}

Completing the Payment

After receiving the webhook, you need to redirect the client to the 3dsRedirectUrl to complete the payment. Once the 3DS process is finished, the client will be redirected to the callback URL if successful, or to the callbackFail URL if the payment fails.

Ensure that all required fields are filled correctly to avoid transaction issues.

This documentation provides an overview of creating a transaction using the Facilero API, handling callbacks, and redirecting the client for 3DS authentication.


⚠️ Important Note on Amount Formatting

The Card Payment API does not use a checksum mechanism, however merchants should still be aware of the following formatting detail:

  • In requests, the amount field is provided as a string (e.g., "200.00").
  • In callbacks, the amount fields (orderAmount, processedAmount) are returned as double values (e.g., 200.0).

Because Facilero uses native numeric types internally, trailing zeros after the decimal point may not be preserved. This is expected behavior and does not indicate a data mismatch.

👉 Merchants should always use the amount value provided in the callback when performing validations or reconciliation, rather than comparing against the raw string format from the original request.