Issue multiple cards in a single atomic request
curl --request POST \
--url https://mag3nt.com/api/issue/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cards": [
{
"purpose": "<string>",
"limit_amount": 123
}
],
"network": "eip155:8453",
"asset": "USDC"
}
'import requests
url = "https://mag3nt.com/api/issue/bulk"
payload = {
"cards": [
{
"purpose": "<string>",
"limit_amount": 123
}
],
"network": "eip155:8453",
"asset": "USDC"
}
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({
cards: [{purpose: '<string>', limit_amount: 123}],
network: 'eip155:8453',
asset: 'USDC'
})
};
fetch('https://mag3nt.com/api/issue/bulk', 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/bulk",
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([
'cards' => [
[
'purpose' => '<string>',
'limit_amount' => 123
]
],
'network' => 'eip155:8453',
'asset' => 'USDC'
]),
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/bulk"
payload := strings.NewReader("{\n \"cards\": [\n {\n \"purpose\": \"<string>\",\n \"limit_amount\": 123\n }\n ],\n \"network\": \"eip155:8453\",\n \"asset\": \"USDC\"\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/bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cards\": [\n {\n \"purpose\": \"<string>\",\n \"limit_amount\": 123\n }\n ],\n \"network\": \"eip155:8453\",\n \"asset\": \"USDC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/issue/bulk")
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 \"cards\": [\n {\n \"purpose\": \"<string>\",\n \"limit_amount\": 123\n }\n ],\n \"network\": \"eip155:8453\",\n \"asset\": \"USDC\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"cards": [
{
"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"
}
],
"total_allocated": 123
}{
"error": "Insufficient balance",
"available": 40,
"requested": 50,
"network": "eip155:8453",
"asset": "USDC"
}Cards
Issue multiple cards in a single atomic request
Creates up to 1000 cards atomically. All cards are allocated from treasury balance in a single atomic operation. Supports idempotency via header.
POST
/
api
/
issue
/
bulk
Issue multiple cards in a single atomic request
curl --request POST \
--url https://mag3nt.com/api/issue/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cards": [
{
"purpose": "<string>",
"limit_amount": 123
}
],
"network": "eip155:8453",
"asset": "USDC"
}
'import requests
url = "https://mag3nt.com/api/issue/bulk"
payload = {
"cards": [
{
"purpose": "<string>",
"limit_amount": 123
}
],
"network": "eip155:8453",
"asset": "USDC"
}
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({
cards: [{purpose: '<string>', limit_amount: 123}],
network: 'eip155:8453',
asset: 'USDC'
})
};
fetch('https://mag3nt.com/api/issue/bulk', 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/bulk",
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([
'cards' => [
[
'purpose' => '<string>',
'limit_amount' => 123
]
],
'network' => 'eip155:8453',
'asset' => 'USDC'
]),
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/bulk"
payload := strings.NewReader("{\n \"cards\": [\n {\n \"purpose\": \"<string>\",\n \"limit_amount\": 123\n }\n ],\n \"network\": \"eip155:8453\",\n \"asset\": \"USDC\"\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/bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cards\": [\n {\n \"purpose\": \"<string>\",\n \"limit_amount\": 123\n }\n ],\n \"network\": \"eip155:8453\",\n \"asset\": \"USDC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/issue/bulk")
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 \"cards\": [\n {\n \"purpose\": \"<string>\",\n \"limit_amount\": 123\n }\n ],\n \"network\": \"eip155:8453\",\n \"asset\": \"USDC\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"cards": [
{
"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"
}
],
"total_allocated": 123
}{
"error": "Insufficient balance",
"available": 40,
"requested": 50,
"network": "eip155:8453",
"asset": "USDC"
}Authorizations
API key prefixed with 'Bearer sx_live_...'
Headers
Unique key to prevent duplicate bulk operations
Body
application/json
⌘I