Authorize a Braintree transaction
Authorizes a Braintree transaction from a JS SDK nonce and stores the vault context on the cart. PaymentMethod creation happens via the payment_method endpoint afterwards.
curl --request POST \
--url https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay \
--header 'Content-Type: application/json' \
--data '
{
"payment_method_nonce": "fake-valid-nonce",
"payment_account_id": "018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f",
"device_data": "{\"correlation_id\":\"abc123\"}"
}
'import requests
url = "https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay"
payload = {
"payment_method_nonce": "fake-valid-nonce",
"payment_account_id": "018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f",
"device_data": "{\"correlation_id\":\"abc123\"}"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method_nonce: 'fake-valid-nonce',
payment_account_id: '018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f',
device_data: '{"correlation_id":"abc123"}'
})
};
fetch('https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_method_nonce' => 'fake-valid-nonce',
'payment_account_id' => '018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f',
'device_data' => '{"correlation_id":"abc123"}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay"
payload := strings.NewReader("{\n \"payment_method_nonce\": \"fake-valid-nonce\",\n \"payment_account_id\": \"018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f\",\n \"device_data\": \"{\\\"correlation_id\\\":\\\"abc123\\\"}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay")
.header("Content-Type", "application/json")
.body("{\n \"payment_method_nonce\": \"fake-valid-nonce\",\n \"payment_account_id\": \"018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f\",\n \"device_data\": \"{\\\"correlation_id\\\":\\\"abc123\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method_nonce\": \"fake-valid-nonce\",\n \"payment_account_id\": \"018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f\",\n \"device_data\": \"{\\\"correlation_id\\\":\\\"abc123\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "bt_txn_9f8e7d6c",
"payment_type": "braintree_paypal",
"meta": {
"request_id": "018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f",
"timestamp": "2026-04-01T12:00:00Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"shop_url": "<string>",
"cart": {}
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Path Parameters
Opaque cart token returned by the create-cart response. It scopes the request to a single cart and is the credential for these endpoints — cart-token authentication carried in the path, with no bearer token or API key.
Body
Nonce from the Braintree JS SDK.
Braintree PaymentAccount UUID.
Braintree Data Collector fraud fingerprint.
Payment type override (e.g. venmo, braintree_paypal).
Show child attributes
Show child attributes
Response
Transaction authorized
Success body for a Braintree authorization.
Braintree transaction id for the authorized charge; the vault context is stored on the cart and the PaymentMethod is created later via the payment_method endpoint.
Detected payment type (e.g. braintree_paypal, venmo).
Standard response metadata included on every response.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay \
--header 'Content-Type: application/json' \
--data '
{
"payment_method_nonce": "fake-valid-nonce",
"payment_account_id": "018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f",
"device_data": "{\"correlation_id\":\"abc123\"}"
}
'import requests
url = "https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay"
payload = {
"payment_method_nonce": "fake-valid-nonce",
"payment_account_id": "018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f",
"device_data": "{\"correlation_id\":\"abc123\"}"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method_nonce: 'fake-valid-nonce',
payment_account_id: '018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f',
device_data: '{"correlation_id":"abc123"}'
})
};
fetch('https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_method_nonce' => 'fake-valid-nonce',
'payment_account_id' => '018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f',
'device_data' => '{"correlation_id":"abc123"}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay"
payload := strings.NewReader("{\n \"payment_method_nonce\": \"fake-valid-nonce\",\n \"payment_account_id\": \"018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f\",\n \"device_data\": \"{\\\"correlation_id\\\":\\\"abc123\\\"}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay")
.header("Content-Type", "application/json")
.body("{\n \"payment_method_nonce\": \"fake-valid-nonce\",\n \"payment_account_id\": \"018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f\",\n \"device_data\": \"{\\\"correlation_id\\\":\\\"abc123\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/payments/v2026-04/carts/{cart_token}/braintree/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method_nonce\": \"fake-valid-nonce\",\n \"payment_account_id\": \"018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f\",\n \"device_data\": \"{\\\"correlation_id\\\":\\\"abc123\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "bt_txn_9f8e7d6c",
"payment_type": "braintree_paypal",
"meta": {
"request_id": "018f2c1a-8b3a-7e6d-9f10-2a3b4c5d6e7f",
"timestamp": "2026-04-01T12:00:00Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"shop_url": "<string>",
"cart": {}
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}