curl --request GET \
--url https://mag3nt.com/api/pay/{code}/prepareimport requests
url = "https://mag3nt.com/api/pay/{code}/prepare"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mag3nt.com/api/pay/{code}/prepare', 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://mag3nt.com/api/pay/{code}/prepare",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mag3nt.com/api/pay/{code}/prepare"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mag3nt.com/api/pay/{code}/prepare")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/pay/{code}/prepare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"intent": {
"code": "<string>",
"amount": 123,
"asset": "<string>",
"network": "<string>",
"memo": "<string>",
"status": "<string>",
"type": "<string>",
"uses": 123,
"max_uses": 123,
"expires_at": "2023-11-07T05:31:56Z"
},
"treasury": "<string>",
"token": {
"contract": "<string>",
"decimals": 123,
"type": "<string>"
},
"accepted_protocols": [
"<string>"
],
"agent_payable": true,
"amount_mode": "fixed",
"settlement": {
"address": "<string>",
"network": "<string>",
"asset": "<string>",
"token_contract": "<string>",
"token_decimals": 123,
"mode": "DIRECT"
},
"settlement_mode": "DIRECT",
"is_owner": true
}{
"error": "<string>",
"code": "no_active_plan"
}{
"error": "Card not found"
}{
"error": "<string>",
"code": "holder_not_ready",
"message": "<string>"
}Prepare payment intent for a pay link
Returns everything a payer’s wallet or agent needs to build a transaction: intent details, settlement destination, token contract, and settlement_mode. For a DIRECT credential the destination is the merchant’s own on-chain holder address instead of the mag3nt treasury; DIRECT also enforces the membership pricing gate and the MAG3NT fee-meter debt floor before returning payment instructions. Agents (JSON Accept header, non-browser user agent) get HTTP 402 with WWW-Authenticate; browsers get HTTP 200.
curl --request GET \
--url https://mag3nt.com/api/pay/{code}/prepareimport requests
url = "https://mag3nt.com/api/pay/{code}/prepare"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mag3nt.com/api/pay/{code}/prepare', 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://mag3nt.com/api/pay/{code}/prepare",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mag3nt.com/api/pay/{code}/prepare"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mag3nt.com/api/pay/{code}/prepare")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/pay/{code}/prepare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"intent": {
"code": "<string>",
"amount": 123,
"asset": "<string>",
"network": "<string>",
"memo": "<string>",
"status": "<string>",
"type": "<string>",
"uses": 123,
"max_uses": 123,
"expires_at": "2023-11-07T05:31:56Z"
},
"treasury": "<string>",
"token": {
"contract": "<string>",
"decimals": 123,
"type": "<string>"
},
"accepted_protocols": [
"<string>"
],
"agent_payable": true,
"amount_mode": "fixed",
"settlement": {
"address": "<string>",
"network": "<string>",
"asset": "<string>",
"token_contract": "<string>",
"token_decimals": 123,
"mode": "DIRECT"
},
"settlement_mode": "DIRECT",
"is_owner": true
}{
"error": "<string>",
"code": "no_active_plan"
}{
"error": "Card not found"
}{
"error": "<string>",
"code": "holder_not_ready",
"message": "<string>"
}Path Parameters
Response
Payment intent (browser)
Show child attributes
Show child attributes
Settlement destination - the merchant's on-chain holder for DIRECT, or the mag3nt treasury for CUSTODIAL.
Show child attributes
Show child attributes
False for open-amount links - an autonomous agent has no fixed price to pay against.
fixed, open Show child attributes
Show child attributes
DIRECT, CUSTODIAL