curl --request POST \
--url https://api.spenza.com/api/v3/plans/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"iccid": "8901260853182965429",
"productName": "AT&T 5GB",
"activateNow": true,
"scheduleDate": "2026-08-01T00:00:00Z",
"metaData": {
"source": "web",
"campaignId": "123"
}
}
'import requests
url = "https://api.spenza.com/api/v3/plans/purchase"
payload = {
"iccid": "8901260853182965429",
"productName": "AT&T 5GB",
"activateNow": True,
"scheduleDate": "2026-08-01T00:00:00Z",
"metaData": {
"source": "web",
"campaignId": "123"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
iccid: '8901260853182965429',
productName: 'AT&T 5GB',
activateNow: true,
scheduleDate: '2026-08-01T00:00:00Z',
metaData: {source: 'web', campaignId: '123'}
})
};
fetch('https://api.spenza.com/api/v3/plans/purchase', 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.spenza.com/api/v3/plans/purchase",
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([
'iccid' => '8901260853182965429',
'productName' => 'AT&T 5GB',
'activateNow' => true,
'scheduleDate' => '2026-08-01T00:00:00Z',
'metaData' => [
'source' => 'web',
'campaignId' => '123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.spenza.com/api/v3/plans/purchase"
payload := strings.NewReader("{\n \"iccid\": \"8901260853182965429\",\n \"productName\": \"AT&T 5GB\",\n \"activateNow\": true,\n \"scheduleDate\": \"2026-08-01T00:00:00Z\",\n \"metaData\": {\n \"source\": \"web\",\n \"campaignId\": \"123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.spenza.com/api/v3/plans/purchase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"iccid\": \"8901260853182965429\",\n \"productName\": \"AT&T 5GB\",\n \"activateNow\": true,\n \"scheduleDate\": \"2026-08-01T00:00:00Z\",\n \"metaData\": {\n \"source\": \"web\",\n \"campaignId\": \"123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v3/plans/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"iccid\": \"8901260853182965429\",\n \"productName\": \"AT&T 5GB\",\n \"activateNow\": true,\n \"scheduleDate\": \"2026-08-01T00:00:00Z\",\n \"metaData\": {\n \"source\": \"web\",\n \"campaignId\": \"123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"transactionId": "64f1a2b3c4d5e6f7a8b9c0d1",
"statusEndpoint": "/api/v3/transactions/64f1a2b3c4d5e6f7a8b9c0d1"
}
}Purchase a plan (asynchronous)
Purchase / activate a plan for a SIM, asynchronously — always 202
with a transactionId to poll. A different request contract from
POST /api/v1.1/plans/purchase: activateNow defaults from whether
scheduleDate is set (rather than being required), scheduleDate is a
full ISO 8601 datetime (not YYYY-MM-DD), and this endpoint accepts an
optional free-form metaData object stored on the transaction.
202 only means the request was accepted for processing, not that the
purchase succeeded — validation performed after acceptance (bad ICCID,
plan not found, pricing not configured, etc.) is only visible by
polling statusEndpoint. Throttled at 60 requests/60s specific to this
route, tighter than the 120 req/60s account-wide default.
curl --request POST \
--url https://api.spenza.com/api/v3/plans/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"iccid": "8901260853182965429",
"productName": "AT&T 5GB",
"activateNow": true,
"scheduleDate": "2026-08-01T00:00:00Z",
"metaData": {
"source": "web",
"campaignId": "123"
}
}
'import requests
url = "https://api.spenza.com/api/v3/plans/purchase"
payload = {
"iccid": "8901260853182965429",
"productName": "AT&T 5GB",
"activateNow": True,
"scheduleDate": "2026-08-01T00:00:00Z",
"metaData": {
"source": "web",
"campaignId": "123"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
iccid: '8901260853182965429',
productName: 'AT&T 5GB',
activateNow: true,
scheduleDate: '2026-08-01T00:00:00Z',
metaData: {source: 'web', campaignId: '123'}
})
};
fetch('https://api.spenza.com/api/v3/plans/purchase', 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.spenza.com/api/v3/plans/purchase",
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([
'iccid' => '8901260853182965429',
'productName' => 'AT&T 5GB',
'activateNow' => true,
'scheduleDate' => '2026-08-01T00:00:00Z',
'metaData' => [
'source' => 'web',
'campaignId' => '123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.spenza.com/api/v3/plans/purchase"
payload := strings.NewReader("{\n \"iccid\": \"8901260853182965429\",\n \"productName\": \"AT&T 5GB\",\n \"activateNow\": true,\n \"scheduleDate\": \"2026-08-01T00:00:00Z\",\n \"metaData\": {\n \"source\": \"web\",\n \"campaignId\": \"123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.spenza.com/api/v3/plans/purchase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"iccid\": \"8901260853182965429\",\n \"productName\": \"AT&T 5GB\",\n \"activateNow\": true,\n \"scheduleDate\": \"2026-08-01T00:00:00Z\",\n \"metaData\": {\n \"source\": \"web\",\n \"campaignId\": \"123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v3/plans/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"iccid\": \"8901260853182965429\",\n \"productName\": \"AT&T 5GB\",\n \"activateNow\": true,\n \"scheduleDate\": \"2026-08-01T00:00:00Z\",\n \"metaData\": {\n \"source\": \"web\",\n \"campaignId\": \"123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"transactionId": "64f1a2b3c4d5e6f7a8b9c0d1",
"statusEndpoint": "/api/v3/transactions/64f1a2b3c4d5e6f7a8b9c0d1"
}
}Authorizations
Bearer token obtained from POST /api/v1.1/auth/token.
Headers
Any string unique to this logical request. On a retry with the same key
and the same request body, the original response is replayed verbatim
(with an Idempotency-Replayed: true response header) instead of the
action repeating. Reusing the key with a different body or on a
different route returns 409 IDEMPOTENCY_KEY_REUSED. A replay attempted
while the original call is still in flight returns 409 CONFLICT.
Optional — omit it and the endpoint behaves exactly as it would otherwise.
"a1b2c3d4-idem-key-001"
Body
"8901260853182965429"
"AT&T 5GB"
Defaults to !scheduleDate when omitted.
true
Full ISO 8601 datetime; required when activateNow=false.
"2026-08-01T00:00:00Z"
Free-form partner metadata stored on the transaction.
{ "source": "web", "campaignId": "123" }
Response
Accepted — poll statusEndpoint.

