Create Virtual Card
curl --request POST \
--url https://sandbox.sturdytechnologies.com/v3/cards \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"city": "City",
"country": "Country",
"street": "123 Main St"
},
"card_balance": 10,
"user_id": "12345"
}
'import requests
url = "https://sandbox.sturdytechnologies.com/v3/cards"
payload = {
"address": {
"city": "City",
"country": "Country",
"street": "123 Main St"
},
"card_balance": 10,
"user_id": "12345"
}
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({
address: {city: 'City', country: 'Country', street: '123 Main St'},
card_balance: 10,
user_id: '12345'
})
};
fetch('https://sandbox.sturdytechnologies.com/v3/cards', 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://sandbox.sturdytechnologies.com/v3/cards",
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([
'address' => [
'city' => 'City',
'country' => 'Country',
'street' => '123 Main St'
],
'card_balance' => 10,
'user_id' => '12345'
]),
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://sandbox.sturdytechnologies.com/v3/cards"
payload := strings.NewReader("{\n \"address\": {\n \"city\": \"City\",\n \"country\": \"Country\",\n \"street\": \"123 Main St\"\n },\n \"card_balance\": 10,\n \"user_id\": \"12345\"\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://sandbox.sturdytechnologies.com/v3/cards")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"city\": \"City\",\n \"country\": \"Country\",\n \"street\": \"123 Main St\"\n },\n \"card_balance\": 10,\n \"user_id\": \"12345\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.sturdytechnologies.com/v3/cards")
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 \"address\": {\n \"city\": \"City\",\n \"country\": \"Country\",\n \"street\": \"123 Main St\"\n },\n \"card_balance\": 10,\n \"user_id\": \"12345\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"card_balance": 1000,
"card_brand": "Visa",
"card_id": "card_12345",
"card_name": "John D. Card",
"card_status": "Active",
"card_type": "Lite",
"currency": "USD",
"cvv": "123",
"expiration": "12/25",
"first_six": "123456",
"last_four": "7890"
},
"message": "<string>",
"success": true
}{
"message": "Invalid request",
"success": false
}Cards
Create Virtual Card
Add a new virtual card to a customer account
POST
/
cards
Create Virtual Card
curl --request POST \
--url https://sandbox.sturdytechnologies.com/v3/cards \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"city": "City",
"country": "Country",
"street": "123 Main St"
},
"card_balance": 10,
"user_id": "12345"
}
'import requests
url = "https://sandbox.sturdytechnologies.com/v3/cards"
payload = {
"address": {
"city": "City",
"country": "Country",
"street": "123 Main St"
},
"card_balance": 10,
"user_id": "12345"
}
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({
address: {city: 'City', country: 'Country', street: '123 Main St'},
card_balance: 10,
user_id: '12345'
})
};
fetch('https://sandbox.sturdytechnologies.com/v3/cards', 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://sandbox.sturdytechnologies.com/v3/cards",
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([
'address' => [
'city' => 'City',
'country' => 'Country',
'street' => '123 Main St'
],
'card_balance' => 10,
'user_id' => '12345'
]),
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://sandbox.sturdytechnologies.com/v3/cards"
payload := strings.NewReader("{\n \"address\": {\n \"city\": \"City\",\n \"country\": \"Country\",\n \"street\": \"123 Main St\"\n },\n \"card_balance\": 10,\n \"user_id\": \"12345\"\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://sandbox.sturdytechnologies.com/v3/cards")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"city\": \"City\",\n \"country\": \"Country\",\n \"street\": \"123 Main St\"\n },\n \"card_balance\": 10,\n \"user_id\": \"12345\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.sturdytechnologies.com/v3/cards")
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 \"address\": {\n \"city\": \"City\",\n \"country\": \"Country\",\n \"street\": \"123 Main St\"\n },\n \"card_balance\": 10,\n \"user_id\": \"12345\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"card_balance": 1000,
"card_brand": "Visa",
"card_id": "card_12345",
"card_name": "John D. Card",
"card_status": "Active",
"card_type": "Lite",
"currency": "USD",
"cvv": "123",
"expiration": "12/25",
"first_six": "123456",
"last_four": "7890"
},
"message": "<string>",
"success": true
}{
"message": "Invalid request",
"success": false
}Body
application/json
Create Virtual Card payload
Show child attributes
Show child attributes
Initial balance to load onto the card
Example:
10
Brand of the card
Available options:
Visa, Mastercard Type of card to create
Available options:
Lite, Multiuse-Lite, Virtual, Physical Currency of the card (Only USD is supported for virtual cards for now)
Available options:
USD, NGN, EUR, GBP Identifier of the user to whom the card will be issued
Example:
"12345"
