Create payment

POST /payments

Creates a new payment for analysis

Request body

paymentobjectrequired
payment object
idstring \| null

Identify the payment with a unique code that does not repeat within the same account. If not provided, a random identifier will be generated.

typestring enumrequired

Payment type

Allowed: purchase verify
statusstring enum

Payment status. See the documentation for more details on possible statuses.

Allowed: initiated succeeded declined failed blocked
currencystringrequired

Payment currency according to the ISO 4217 standard.

amountfloat

Value with two decimal places. Use "." as the decimal separator.

timestampdate-time \| null

Date and time when the payment was initiated in ISO 8601 format. If not sent, the current time will be used. The maximum period for retroactive submission (backfill) is 24 hours. Future timestamps are not allowed.

methodobjectrequired

Payment method. Preferably, send all available information in this request. If some data is not available at this stage of your flow, it can be sent later through the same parameter in the update operation.

method object
typestring enumrequired

Payment method type.

Allowed: credit_card debit_card
cardobjectrequired
card object
networkstring enumrequired

Card network

Allowed: visa mastercard american_express diners_club elo hipercard jcb discover other
presencestring enumrequired

Indicates whether the transaction was made with card present (CP) or card not present (CNP). See the card presence documentation for more information.

Allowed: card_present card_not_present
binstring \| null

First 8 digits of the PAN that identify the card issuer (also known as IIN)

last_fourstring \| null

Last 4 digits of the PAN

backendobject

Information about the external server sending the request to your backend API. Make sure the data sent is from the remote server outside your security perimeter, not from intermediate servers within your infrastructure.

backend object
ip_addressstring \| null

IPv4 or IPv6 address of the external server. If this data is not available, leave the field blank. Private addresses will be ignored in the analysis.

headersobject \| null

HTTP headers sent by the external server. If possible, send all of them. Otherwise, send at least `User-Agent`, `Accept`, `Accept-Encoding`, `Accept-Language`, and `Host`. Confidential headers used for authentication and session will be automatically removed.

deviceobject

Information about the user's device, if the payment was made in an online environment (web or app). Do not send this block for attempts initiated without direct user interaction (recurring renewal, for example).

device object
ip_addressstring \| null

IPv4 or IPv6 address of the user's device. If this data is not available, leave the field blank. Private addresses will be rejected.

headersobject \| null

HTTP headers sent by the user's device in the request. If possible, send all of them. Otherwise, send at least `User-Agent`, `Accept`, `Accept-Encoding`, `Accept-Language`, and `Host`. Confidential headers used for authentication and session will be automatically removed.

fingerprintobject

User's device fingerprint.

fingerprint object
idstringrequired

Unique identifier code of the device fingerprint.

providerstring enumrequired

Fingerprint collection service provider.

Allowed: fingerprintjs basic
userobject

Information about the user making the payment.

user object
idstring \| null

User identifier code.

emailstring \| null

User email. If you want analysis without personal data, provide only the domain (e.g. `gmail.com`).

orderobject

Order information.

order object
idstring \| null

Optional order identifier code (or purchase, subscription, cart, etc). Payment retries on the same order should use the same identifier to track the number of attempts. See the documentation for more details on the order code.

merchantobjectrequired

Merchant information. Use this field to specify the business unit, franchise, or company performing the operation.

merchant object
idstringrequired

Identifier code of the merchant performing the operation.

countrystring \| null

Merchant country in ISO 3166-1 alpha-2 format (2 characters).

category_codestring \| null

Merchant category code (MCC) according to the ISO 18245 standard.

transactionsarray

List of transaction attempts for this payment. Required if payment `status` is `succeeded` or `declined`. Recommended for `failed` and `blocked` if there are transaction attempts.

transactions[] item
idstring

Unique transaction identifier code. See the documentation for more details on the transaction code.

statusstring enumrequired

Transaction attempt return status. See the documentation for more details on possible statuses.

Allowed: succeeded declined failed
durationinteger

Transaction execution time in milliseconds (1 second = 1000 milliseconds).

timestampdate-time \| null

Date and time when the transaction was initiated in ISO 8601 format. If not sent, the current time will be used. The maximum period for retroactive submission (backfill) is 24 hours. Future timestamps are not allowed.

connectorobjectrequired

Information about the payment connector used in the transaction. The connector can be an acquirer, a sub-acquirer, or a gateway.

connector object
idstringrequired

Integration code with the connector. Provide a code that represents an affiliation contract or a specific integration connection. We recommend prefixing the code with the connector type to facilitate report queries.

typestringrequired

Connector type. See the documentation for the complete list.

response_codestring \| null

Alphanumeric response code of the attempt. For credit cards in Brazil, preferably use the standard determined by ABECS normative 21. Required if `transaction.status` is `succeeded` or `declined`. Recommended for `failed` when present.

metadataobject \| null

Additional metadata. For information about requirements and limits, see the documentation.

analyzeobject

Enables payment analysis.

analyze object
ruleobject \| null

Optionally specify the rule to be applied in the risk recommendation.

rule object
namestring \| null

Rule name, as previously registered. If the specified rule does not exist or does not have an active published version, the request will not fail and the risk recommendation will be provided according to the account's default configuration.

bot_behaviourboolean

Detects automated behavior (bots, scripts, etc.)

Responses

201Payment created successfully
Response body
paymentobject
payment object
idstring

Identifier code of the created payment.

statusstring

Payment status.

analysesobject

Results of the requested analyses.

analyses object
bot_behaviourobject
bot_behaviour object
actionstring enum

Recommended action based on the risk score and the configuration in the admin panel.

Allowed: allow challenge deny
scorefloat

Risk score in decimal format between `0.00` and `1.00` with two decimal places. The closer to 1, the higher the probability the payment was made by a bot. This is an informational field only. We recommend using the `action` field recommendation to implement decision-making. To simulate an arbitrary score in the test account, check the documentation.

401Invalid access credentials
Response body
errorsarray
errors[] item
fieldstring

Request field where the error occurred

typestring

Error type code

messagestring

Error message

422Invalid parameters
Response body
errorsarray
errors[] item
fieldstring

Request field where the error occurred

typestring

Error type code

messagestring

Error message

{
  "payment": {
    "id": "string",
    "type": "purchase",
    "status": "initiated",
    "currency": "BRL",
    "amount": 10.23,
    "timestamp": "2024-01-01T00:00:00Z",
    "method": {
      "type": "credit_card",
      "card": {
        "network": null,
        "presence": null,
        "bin": null,
        "last_four": null
      }
    },
    "backend": {
      "ip_address": "200.200.200.200",
      "headers": {
        "User-Agent": "Java-Http-Client/11.0",
        "Accept": "application/json",
        "EveryOtherHeader": "value"
      }
    },
    "device": {
      "ip_address": "200.200.200.200",
      "headers": {
        "User-Agent": "Chrome",
        "Accept": "text/html,application/xhtml+xml",
        "EveryOtherHeader": "value"
      },
      "fingerprint": {
        "id": null,
        "provider": null
      }
    },
    "user": {
      "id": "string",
      "email": "teste@gmail.com"
    },
    "order": {
      "id": "string"
    },
    "merchant": {
      "id": "string",
      "country": "BR",
      "category_code": "7997"
    },
    "transactions": [
      {
        "id": null,
        "status": null,
        "duration": null,
        "timestamp": null,
        "connector": null
      }
    ],
    "metadata": {
      "plano": "premium_1",
      "categoria_do_cliente": "vip"
    },
    "analyze": {
      "rule": {
        "name": null
      },
      "bot_behaviour": false
    }
  }
}