Pix2DePix API
  1. Docs
Pix2DePix API
  • 📜 API Overview
  • Docs
    • 🔑 Authentication
    • 💻 Examples
    • 🪝 Webhook
    • 🛡️ Security & Limits
      • ✅ Best Practices
      • 🧱 Firewall
      • 🪲 Bug Bounty
      • 🚦 API Limits
    • 🧩 Advanced (optional)
      • 🎲 Nonce
      • 🔀 Sync / Async call
  • API Endpoints
    • Ping
      GET
    • Deposit (PIX ➔ DePix)
      POST
    • Deposit Status
      GET
  1. Docs

💻 Examples

Common Response Format#

Most Common Success Case#

Every successful API call will return a response in the following format:
{
    "response": <obj-response>,
    "async": false
}
Where <obj-response> is a JSON map { ... } containing the response information, if any. The content of this object depends on each API; please refer to the documentation API Endpoints.

In Case of an Error#

{
    "response": {
        "errorMessage" : <string-err>
    },
    "async": false
}
Where <string-err> is an error message in the form of a human-readable sentence.

In Case of Server Busy (async mode)#

If the server is very busy, your request will automatically enter asynchronous mode. In this case, you must retry with the same nonce until you receive a response synchronously.
{
    "async": true,
    "expiration": <string-date-iso8601>
    "urlResponse": <string-url>
}
Where <string-date-iso8601> is a date in the format ISO 8601 like "2024-12-20T09:33:14.768Z" e.g., and <string-url> is a that points to the response in the future.
The expiration date means that the server will give up processing the message after a certain point. If you receive an asynchronous response, you have two options:
1.
simply retry the same call with the same nonce until it returns synchronously or up to the maximum expiration date limit.
2.
OR actively fetch the response from the URL returned in "urlResponse".
If you choose the second approach, remember that the format returned at the response URL is a JSON containing the content of <obj-response> directly.

Examples#

Note: The following codes are just a draft and was generated with the help of generative AI. If you find any errors, please report them to our team so we can make the necessary corrections.

Python#

JavaScript / NodeJS#

Go#

Rust#

[dependencies]
reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
uuid = "1.3"

Java#

<dependencies>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.15.2</version>
    </dependency>
</dependencies>

Scheme / Racket#

Ruby#

Kotlin#

Elixir#

defp deps do
  [
    {:httpoison, "~> 1.8"},
    {:jason, "~> 1.4"}
  ]
end

Clojure#

C++#

Perl#

PHP#

Swift#

C#

sudo apt install libcurl4-openssl-dev libcjson-dev uuid-dev

gcc deposit.c -o deposit -lcurl -luuid -lcjson
Note: The codes above are just a draft and was generated with the help of generative AI. If you find any errors, please report them to our team so we can make the necessary corrections.
Modified at 2025-02-06 08:18:23
Previous
🔑 Authentication
Next
🪝 Webhook
Built with