Notus API
Fiat

Create a fiat withdrawal order

This endpoint creates a fiat withdrawal order for a given quote id.

POST
/api/v1/fiat/withdraw
x-api-key<token>

In: header

quoteIdstring
taxIdstring
paymentMethodToReceiveDetailsobject
walletAddressstring
Match^0x[a-fA-F0-9]{40}$
chainIdnumber

Response Body

curl -X POST "https://api.notus.team/api/v1/fiat/withdraw" \
  -H "Content-Type: application/json" \
  -d '{
    "quoteId": "string",
    "taxId": "string",
    "paymentMethodToReceiveDetails": {
      "type": "PIX",
      "pixKey": "string"
    },
    "walletAddress": "string",
    "chainId": 0
  }'
const body = JSON.stringify({
  "quoteId": "string",
  "taxId": "string",
  "paymentMethodToReceiveDetails": {
    "type": "PIX",
    "pixKey": "string"
  },
  "walletAddress": "string",
  "chainId": 0
})

fetch("https://api.notus.team/api/v1/fiat/withdraw", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://api.notus.team/api/v1/fiat/withdraw"
  body := strings.NewReader(`{
    "quoteId": "string",
    "taxId": "string",
    "paymentMethodToReceiveDetails": {
      "type": "PIX",
      "pixKey": "string"
    },
    "walletAddress": "string",
    "chainId": 0
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.notus.team/api/v1/fiat/withdraw"
body = {
  "quoteId": "string",
  "taxId": "string",
  "paymentMethodToReceiveDetails": {
    "type": "PIX",
    "pixKey": "string"
  },
  "walletAddress": "string",
  "chainId": 0
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;

var body = BodyPublishers.ofString("""{
  "quoteId": "string",
  "taxId": "string",
  "paymentMethodToReceiveDetails": {
    "type": "PIX",
    "pixKey": "string"
  },
  "walletAddress": "string",
  "chainId": 0
}""");
HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://api.notus.team/api/v1/fiat/withdraw"))
  .header("Content-Type", "application/json")
  .POST(body)
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var body = new StringContent("""
{
  "quoteId": "string",
  "taxId": "string",
  "paymentMethodToReceiveDetails": {
    "type": "PIX",
    "pixKey": "string"
  },
  "walletAddress": "string",
  "chainId": 0
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PostAsync("https://api.notus.team/api/v1/fiat/withdraw", body);
var responseBody = await response.Content.ReadAsStringAsync();
{
  "withdrawOrder": {
    "expiresAt": "2023-12-31T23:59:59.999Z",
    "userOpHash": "0x1234567890",
    "orderId": "123e4567-e89b-12d3-a456-426614174000",
    "amountToSendInCryptoCurrency": "100",
    "amountToReceiveInFiatCurrency": "100",
    "transactionFeeAmountInCryptoCurrency": "100",
    "estimatedGasFeeAmountInCryptoCurrency": "100"
  }
}
{
  "statusCode": 400,
  "id": "FIAT_QUOTE_EXPIRED",
  "message": "The quote with id '03dbe93b-b259-480b-9fb6-3684ad5b28ba' has expired"
}
{
  "statusCode": 401,
  "id": "UNAUTHORIZED_EXCEPTION",
  "message": "Unauthorized"
}
{
  "statusCode": 404,
  "id": "FIAT_QUOTE_NOT_FOUND",
  "message": "The quote with id '03dbe93b-b259-480b-9fb6-3684ad5b28ba' was not found"
}
{
  "statusCode": 500,
  "id": "FAILED_TO_CREATE_FIAT_DEPOSIT",
  "message": "Failed to create fiat deposit for quote: '03dbe93b-b259-480b-9fb6-3684ad5b28ba'"
}