Skip to main content

Anti-fraud Payment

API data

API Gateway
This API is used for payment gateway operations:

Introduction

The Anti-fraud Payment operation lets you process transactions with higher security by using the Sopague anti-fraud library. Make sure the anti-fraud library is properly implemented in your system before using these operations. For more information, see Anti-fraud Library.


Perform payment operation

To create a credit card transaction, send a POST request to /v1/payments with the required data. The example below illustrates a typical request.

POST /v1/payments

Via REST request with the following body:

Request
  {
"payment": {
"transactionType": "string",
"amount": 0,
"productType": "string",
"installments": 0
},
"referenceTransaction": "string",
"urlCallBack": "string",
"sellerInfo": {
"codeAntiFraud": "string"
},
"customer": {
"documentNumber": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"phoneNumber": "string",
"mobilePhoneNumber": "string",
"address": "string",
"city": "string",
"state": "string",
"zipCode": "string",
"ipAddress": "string",
"country": "string"
},
"cardInfo": {
"numberToken": "string",
"cardholderName": "string",
"securityCode": "string",
"brand": "string",
"expirationMonth": "string",
"expirationYear": "string",
"encryptedCard": "string"
},
"configSplit": [
{
"documentNumberBeneficiary": "string",
"percent": 0,
"type": "string"
}
]
}

Data dictionary - Parameters

PROPERTYDESCRIPTIONTYPELOCATIONREQUIREDSIZE
Payment.TransactionTypeTransaction type.stringbodyyesfixed
Payment.AmountOrder amount (in cents).integerbodyyes10
Payment.ProductTypeProduct type – avista / lojista.stringbodyyesfixed
Payment.InstallmentsNumber of installments.integerbodyyes2
ReferenceTransactionPayment reference provided by the integrator (returned in reconciliation).stringbodyno50
UrlCallBackMerchant callback URL for payment flow updates.stringbodyno500
sellerInfo.codeAntiFraudCode obtained via the anti-fraud library.guidbodyyes36
ConfigSplitPayment split configuration list (splits the amount between multiple beneficiaries).arraybodyno-
ConfigSplit[].documentNumberBeneficiaryBeneficiary CPF/CNPJ (numbers only, no mask).stringbodyno14
ConfigSplit[].percentSplit percentage (0–100).decimalbodyno5,2
ConfigSplit[].typeSplit type: bruto (gross amount) or liquido (after fees).stringbodyno10
CardInfo.NumberTokenTokenized card identifier.stringbodynofixed
CardInfo.CardholderNameCardholder name printed on the card.stringbodyyes30
CardInfo.SecurityCodeSecurity code (CVV).stringbodyno4
CardInfo.BrandCard brand (optional).stringbodynofixed
CardInfo.ExpirationMonthCard expiration month (two digits).stringbodyno2
CardInfo.ExpirationYearCard expiration year (two digits).stringbodyno2
CardInfo.EncryptedCardCard data encrypted with the RSA public key obtained from /cards/public-key (safe alternative to sending card data in plain text).stringbodyno2048
Customer.DocumentTypeCustomer document type.stringbodyno4
Customer.DocumentNumberCustomer document number.stringbodyno20
Customer.FirstNameCustomer first name.stringbodyno60
Customer.LastNameCustomer last name.stringbodyno60
Customer.EmailCustomer email.stringbodyno255
Customer.PhoneNumberCustomer phone number.stringbodyno15
Customer.MobilePhoneNumberCustomer mobile phone number.stringbodyno25
Customer.AddressCustomer address.stringbodyno60
Customer.ComplementAddress complement.stringbodyno60
Customer.CityCustomer city.stringbodyno50
Customer.StateCustomer state.stringbodyno2
Customer.ZipCodeCustomer ZIP/postal code.stringbodyno10
Customer.IpAddressCustomer device IP address.stringbodyno48
Customer.CountryCustomer country.stringbodyno2
Note

Installment payments: for installment payments, use productType as lojista. For one-time payments (single installment), use avista.

Domains

PROPERTYVALUES
Payment.TransactionTypecredit
Payment.ProductTypeavista, lojista
CardInfo.Brandvisa, mastercard, amex, elo, hipercard
Customer.DocumentTypecpf, cnpj
Internal error
[
{
"tag": "",
"description": "Não foi possível executar comando. Erro desconhecido."
}
]

See also

Response codes

To identify and properly handle error codes returned by transactions, see the full table:

Authorizer Host Response Codes →