Create Virtual Card
curl --request POST \
--url https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"balance": 10,
"currency": "USD",
"card_type": "VISA",
"category": "PERSONAL",
"grade": "BASIC"
}
'import requests
url = "https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}"
payload = {
"balance": 10,
"currency": "USD",
"card_type": "VISA",
"category": "PERSONAL",
"grade": "BASIC"
}
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({
balance: 10,
currency: 'USD',
card_type: 'VISA',
category: 'PERSONAL',
grade: 'BASIC'
})
};
fetch('https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}', 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.getmipay.com/api/virtual-cards/action/card/{userId}",
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([
'balance' => 10,
'currency' => 'USD',
'card_type' => 'VISA',
'category' => 'PERSONAL',
'grade' => 'BASIC'
]),
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://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}"
payload := strings.NewReader("{\n \"balance\": 10,\n \"currency\": \"USD\",\n \"card_type\": \"VISA\",\n \"category\": \"PERSONAL\",\n \"grade\": \"BASIC\"\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://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"balance\": 10,\n \"currency\": \"USD\",\n \"card_type\": \"VISA\",\n \"category\": \"PERSONAL\",\n \"grade\": \"BASIC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}")
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 \"balance\": 10,\n \"currency\": \"USD\",\n \"card_type\": \"VISA\",\n \"category\": \"PERSONAL\",\n \"grade\": \"BASIC\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"card_id": "CARD_123456",
"user_id": "SP6VC",
"card_number": "4111111111111111",
"expiry_date": "12/2026",
"cvv": "123",
"balance": 10,
"currency": "USD",
"card_type": "VISA",
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}Virtual Cards
Create Card
Create a new virtual card for a specific user
POST
/
virtual-cards
/
action
/
card
/
{userId}
Create Virtual Card
curl --request POST \
--url https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"balance": 10,
"currency": "USD",
"card_type": "VISA",
"category": "PERSONAL",
"grade": "BASIC"
}
'import requests
url = "https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}"
payload = {
"balance": 10,
"currency": "USD",
"card_type": "VISA",
"category": "PERSONAL",
"grade": "BASIC"
}
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({
balance: 10,
currency: 'USD',
card_type: 'VISA',
category: 'PERSONAL',
grade: 'BASIC'
})
};
fetch('https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}', 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.getmipay.com/api/virtual-cards/action/card/{userId}",
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([
'balance' => 10,
'currency' => 'USD',
'card_type' => 'VISA',
'category' => 'PERSONAL',
'grade' => 'BASIC'
]),
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://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}"
payload := strings.NewReader("{\n \"balance\": 10,\n \"currency\": \"USD\",\n \"card_type\": \"VISA\",\n \"category\": \"PERSONAL\",\n \"grade\": \"BASIC\"\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://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"balance\": 10,\n \"currency\": \"USD\",\n \"card_type\": \"VISA\",\n \"category\": \"PERSONAL\",\n \"grade\": \"BASIC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.getmipay.com/api/virtual-cards/action/card/{userId}")
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 \"balance\": 10,\n \"currency\": \"USD\",\n \"card_type\": \"VISA\",\n \"category\": \"PERSONAL\",\n \"grade\": \"BASIC\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"card_id": "CARD_123456",
"user_id": "SP6VC",
"card_number": "4111111111111111",
"expiry_date": "12/2026",
"cvv": "123",
"balance": 10,
"currency": "USD",
"card_type": "VISA",
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}Authorizations
JWT bearer token returned by POST /action/auth. Send protected requests with: Authorization: Bearer . Tokens expire after 24 hours.
Path Parameters
User ID for whom to create the card
Example:
"SP6VC"
Body
application/json
Virtual card creation details
Required range:
x >= 0.01Example:
10
Available options:
USD, EUR, XAF Example:
"USD"
Available options:
VISA, MASTERCARD Example:
"VISA"
Available options:
PERSONAL, BUSINESS Example:
"PERSONAL"
Available options:
BASIC, PREMIUM Example:
"BASIC"
⌘I
