Issue a new virtual payment card
curl --request POST \
--url https://mag3nt.com/api/issue \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "Research Agent",
"limit_amount": 50,
"network": "eip155:8453"
}
'import requests
url = "https://mag3nt.com/api/issue"
payload = {
"purpose": "Research Agent",
"limit_amount": 50,
"network": "eip155:8453"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'Research Agent', limit_amount: 50, network: 'eip155:8453'})
};
fetch('https://mag3nt.com/api/issue', 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/issue",
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([
'purpose' => 'Research Agent',
'limit_amount' => 50,
'network' => 'eip155:8453'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://mag3nt.com/api/issue"
payload := strings.NewReader("{\n \"purpose\": \"Research Agent\",\n \"limit_amount\": 50,\n \"network\": \"eip155:8453\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://mag3nt.com/api/issue")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"Research Agent\",\n \"limit_amount\": 50,\n \"network\": \"eip155:8453\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/issue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purpose\": \"Research Agent\",\n \"limit_amount\": 50,\n \"network\": \"eip155:8453\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"card": {
"id": "sx_a66a6666-1234-5678-9abc-def012345678",
"token": "tok_3b9fe670-abcd-efgh-ijkl-mnopqrstuvwx",
"purpose": "Research Agent",
"limit_amount": 50,
"status": "ACTIVE",
"mcc_locks": "",
"single_use": 0,
"expires_at": "2023-11-07T05:31:56Z",
"funding_network": "eip155:8453",
"funding_asset": "USDC",
"wallet_address": "0x1234...abcd",
"balance": 0,
"remaining": 50,
"settlement_mode": "CUSTODIAL",
"custody_mode": "CUSTODIAL",
"holder_address": "0xabc1...def2",
"chain_status": "NONE",
"balance_source": "ledger",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Card not found"
}{
"error": "Insufficient balance",
"available": 40,
"requested": 50,
"network": "eip155:8453",
"asset": "USDC"
}Cards
Issue a new virtual payment card
Creates a card backed by your treasury balance. Provide tx_hash for UI pay-and-issue flow (card starts as PENDING_FUNDING). Omit tx_hash to allocate from pre-funded balance.
POST
/
api
/
issue
Issue a new virtual payment card
curl --request POST \
--url https://mag3nt.com/api/issue \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "Research Agent",
"limit_amount": 50,
"network": "eip155:8453"
}
'import requests
url = "https://mag3nt.com/api/issue"
payload = {
"purpose": "Research Agent",
"limit_amount": 50,
"network": "eip155:8453"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'Research Agent', limit_amount: 50, network: 'eip155:8453'})
};
fetch('https://mag3nt.com/api/issue', 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/issue",
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([
'purpose' => 'Research Agent',
'limit_amount' => 50,
'network' => 'eip155:8453'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://mag3nt.com/api/issue"
payload := strings.NewReader("{\n \"purpose\": \"Research Agent\",\n \"limit_amount\": 50,\n \"network\": \"eip155:8453\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://mag3nt.com/api/issue")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"Research Agent\",\n \"limit_amount\": 50,\n \"network\": \"eip155:8453\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/issue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purpose\": \"Research Agent\",\n \"limit_amount\": 50,\n \"network\": \"eip155:8453\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"card": {
"id": "sx_a66a6666-1234-5678-9abc-def012345678",
"token": "tok_3b9fe670-abcd-efgh-ijkl-mnopqrstuvwx",
"purpose": "Research Agent",
"limit_amount": 50,
"status": "ACTIVE",
"mcc_locks": "",
"single_use": 0,
"expires_at": "2023-11-07T05:31:56Z",
"funding_network": "eip155:8453",
"funding_asset": "USDC",
"wallet_address": "0x1234...abcd",
"balance": 0,
"remaining": 50,
"settlement_mode": "CUSTODIAL",
"custody_mode": "CUSTODIAL",
"holder_address": "0xabc1...def2",
"chain_status": "NONE",
"balance_source": "ledger",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Card not found"
}{
"error": "Insufficient balance",
"available": 40,
"requested": 50,
"network": "eip155:8453",
"asset": "USDC"
}Authorizations
API key prefixed with 'Bearer sx_live_...'
Body
application/json
Human-readable label for the card
Example:
"Research Agent"
Maximum spend in USDC
Example:
50
On-chain funding transaction hash (optional)
Comma-separated merchant category codes
Hours until expiry (0 = never)
⌘I