For the complete documentation index, see llms.txt. This page is also available as Markdown.

🚀Creating a transaction

Service

  • Sends a JSON containing the data required to create an instant sale.

  • Returns a JSON containing the data of the created conversion, including the network, token, and wallet to which the crypto assets should be sent.

Registration/transaction request

The request to create/register a transaction must have, as the JSON request body, the information required to register the transaction.

Payload example

{
  "person_document": "01234567899",
  "email": "user@example.com",
  "amount_crypto": 1.10,
  "custom_id": "PN123",
  "custom_data": {
    "chain": "Arbitrum",
    "asset": "USDT"
  },
  "sender_wallet": "0x4328...edFB995B6I",
  "destination_pix_key": "01234567899",
  "notification_url": "https://your-webhook-domain.com/param=tes&token=abcd-dfg"
}

Request

Requests the creation/registration of a transaction.

PUT https://api.4p.finance/v1/cryptopix/transaction

Submits the request to register a transaction.

Headers

Name
Type
Description

x-api-key*

String

Your API key.

Request Body

Name
Type
Description

custom_id *

String

Transaction Id. Allows the receiving user to reconcile payments. Must be unique per transaction and contain a maximum of 255 characters.

destination_pix_key*

String

Pix key to which the fiat amount (BRL) will be sent after the crypto assets are received and converted. If not provided, the Pix payment will be sent to the key that must have been previously registered.

sender_wallet*

String

Key used to send the paying customer's wallet, which must be the mandatory origin of the crypto asset transfer.

notification_url *

String

URL that will receive the POST notifications sent by the webhook service right after the crypto assets are sent and converted.

amount_crypto*

Float

Original charge amount in crypto assets. Must be a value greater than or equal to 0.01, with decimal places.

person_document*

String

Document or identification number of the user to whom the transaction should be associated, equivalent to the CPF.

custom_data*

Object

Parent object for data related to the network and token that will be the target of the transaction.

Response

Note that the data object contains the transaction information, including the destination wallet for the crypto assets (receiver_wallet). The assets must be sent to this wallet in exactly the amount specified, originating from the paying customer's wallet indicated when the transaction was created.

Conclusion

After confirmation that the cryptocurrency has been received, the amount converted into fiat will be automatically sent to the Pix key provided in the request payload, or previously associated with the user's account.

The average time to send and finalize the transaction is approximately 10 seconds, and may vary depending on the selected blockchain network and that network's conditions at the time of the operation.

Learn more about notifications and callbacks in the next section.