Create card
Creates a new card. Use metadata type ‘VENDOR’ for vendor cards or ‘EMPLOYEE’ for employee cards.
curl --request POST \
--url https://api.light.inc/v1/cards \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"balanceAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"description": "<string>",
"authentication": {
"phoneNumber": {
"localNumber": "<string>"
},
"email": "<string>"
},
"limits": [
{
"amount": 123,
"currency": "USD"
}
],
"deliveryContact": {
"address": {
"street": "<string>",
"houseNumberOrName": "<string>",
"city": "<string>",
"postalCode": "<string>",
"stateOrProvince": "<string>"
},
"name": {
"firstName": "<string>",
"lastName": "<string>"
},
"company": "<string>",
"email": "<string>",
"phoneNumber": {
"localNumber": "<string>"
}
}
}
'import requests
url = "https://api.light.inc/v1/cards"
payload = {
"balanceAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"description": "<string>",
"authentication": {
"phoneNumber": { "localNumber": "<string>" },
"email": "<string>"
},
"limits": [
{
"amount": 123,
"currency": "USD"
}
],
"deliveryContact": {
"address": {
"street": "<string>",
"houseNumberOrName": "<string>",
"city": "<string>",
"postalCode": "<string>",
"stateOrProvince": "<string>"
},
"name": {
"firstName": "<string>",
"lastName": "<string>"
},
"company": "<string>",
"email": "<string>",
"phoneNumber": { "localNumber": "<string>" }
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({
balanceAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
description: '<string>',
authentication: {phoneNumber: {localNumber: '<string>'}, email: '<string>'},
limits: [{amount: 123, currency: 'USD'}],
deliveryContact: {
address: {
street: '<string>',
houseNumberOrName: '<string>',
city: '<string>',
postalCode: '<string>',
stateOrProvince: '<string>'
},
name: {firstName: '<string>', lastName: '<string>'},
company: '<string>',
email: '<string>',
phoneNumber: {localNumber: '<string>'}
}
})
};
fetch('https://api.light.inc/v1/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://api.light.inc/v1/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([
'balanceAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
],
'description' => '<string>',
'authentication' => [
'phoneNumber' => [
'localNumber' => '<string>'
],
'email' => '<string>'
],
'limits' => [
[
'amount' => 123,
'currency' => 'USD'
]
],
'deliveryContact' => [
'address' => [
'street' => '<string>',
'houseNumberOrName' => '<string>',
'city' => '<string>',
'postalCode' => '<string>',
'stateOrProvince' => '<string>'
],
'name' => [
'firstName' => '<string>',
'lastName' => '<string>'
],
'company' => '<string>',
'email' => '<string>',
'phoneNumber' => [
'localNumber' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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.light.inc/v1/cards"
payload := strings.NewReader("{\n \"balanceAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"description\": \"<string>\",\n \"authentication\": {\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n },\n \"email\": \"<string>\"\n },\n \"limits\": [\n {\n \"amount\": 123,\n \"currency\": \"USD\"\n }\n ],\n \"deliveryContact\": {\n \"address\": {\n \"street\": \"<string>\",\n \"houseNumberOrName\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"stateOrProvince\": \"<string>\"\n },\n \"name\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.light.inc/v1/cards")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"balanceAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"description\": \"<string>\",\n \"authentication\": {\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n },\n \"email\": \"<string>\"\n },\n \"limits\": [\n {\n \"amount\": 123,\n \"currency\": \"USD\"\n }\n ],\n \"deliveryContact\": {\n \"address\": {\n \"street\": \"<string>\",\n \"houseNumberOrName\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"stateOrProvince\": \"<string>\"\n },\n \"name\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/cards")
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;charset=UTF-8'
request.body = "{\n \"balanceAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"description\": \"<string>\",\n \"authentication\": {\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n },\n \"email\": \"<string>\"\n },\n \"limits\": [\n {\n \"amount\": 123,\n \"currency\": \"USD\"\n }\n ],\n \"deliveryContact\": {\n \"address\": {\n \"street\": \"<string>\",\n \"houseNumberOrName\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"stateOrProvince\": \"<string>\"\n },\n \"name\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardBalanceAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"form": "PHYSICAL",
"status": "ACTIVE",
"metadata": {
"type": "VENDOR"
},
"threeDs": {
"phoneNumber": {
"countryCode": "UNDEFINED",
"localNumber": "<string>"
},
"password": "<string>",
"email": "<string>"
},
"description": "<string>",
"bin": "<string>",
"lastFour": "<string>",
"cardholderName": "<string>",
"limits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "USD",
"interval": "PER_TRANSACTION",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "VENDOR"
}Authorizations
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Headers
Body
ID of the card balance account to associate with this card.
ID of the user who will own/manage this card.
Card type metadata. Use type 'VENDOR' with vendorId for vendor cards, or type 'EMPLOYEE' with employeeId for employee cards.
Show child attributes
Show child attributes
Optional description or memo for this card.
3D Secure authentication details for the card.
Show child attributes
Show child attributes
Optional spending limits for this card.
Optional spending limits for this card.
Show child attributes
Show child attributes
Card form factor. Defaults to VIRTUAL when omitted. PHYSICAL ships a plastic card and requires deliveryContact to be set. VIRTUAL must be sent with deliveryContact left null. Mismatches are rejected with PHYSICAL_CARD_DELIVERY_CONTACT_REQUIRED or VIRTUAL_CARD_DELIVERY_CONTACT_NOT_ALLOWED.
⚠️ This enum is not exhaustive; new values may be added in the future.
PHYSICAL, VIRTUAL Recipient and address used by the card issuer to ship the physical card. Only address and name are required.
Show child attributes
Show child attributes
Response
default response
⚠️ This enum is not exhaustive; new values may be added in the future.
PHYSICAL, VIRTUAL ⚠️ This enum is not exhaustive; new values may be added in the future.
ACTIVE, FROZEN, CLOSED, UPDATE_IN_PROGRESS Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⚠️ This enum is not exhaustive; new values may be added in the future.
VENDOR, EMPLOYEE curl --request POST \
--url https://api.light.inc/v1/cards \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"balanceAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"description": "<string>",
"authentication": {
"phoneNumber": {
"localNumber": "<string>"
},
"email": "<string>"
},
"limits": [
{
"amount": 123,
"currency": "USD"
}
],
"deliveryContact": {
"address": {
"street": "<string>",
"houseNumberOrName": "<string>",
"city": "<string>",
"postalCode": "<string>",
"stateOrProvince": "<string>"
},
"name": {
"firstName": "<string>",
"lastName": "<string>"
},
"company": "<string>",
"email": "<string>",
"phoneNumber": {
"localNumber": "<string>"
}
}
}
'import requests
url = "https://api.light.inc/v1/cards"
payload = {
"balanceAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"description": "<string>",
"authentication": {
"phoneNumber": { "localNumber": "<string>" },
"email": "<string>"
},
"limits": [
{
"amount": 123,
"currency": "USD"
}
],
"deliveryContact": {
"address": {
"street": "<string>",
"houseNumberOrName": "<string>",
"city": "<string>",
"postalCode": "<string>",
"stateOrProvince": "<string>"
},
"name": {
"firstName": "<string>",
"lastName": "<string>"
},
"company": "<string>",
"email": "<string>",
"phoneNumber": { "localNumber": "<string>" }
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({
balanceAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
description: '<string>',
authentication: {phoneNumber: {localNumber: '<string>'}, email: '<string>'},
limits: [{amount: 123, currency: 'USD'}],
deliveryContact: {
address: {
street: '<string>',
houseNumberOrName: '<string>',
city: '<string>',
postalCode: '<string>',
stateOrProvince: '<string>'
},
name: {firstName: '<string>', lastName: '<string>'},
company: '<string>',
email: '<string>',
phoneNumber: {localNumber: '<string>'}
}
})
};
fetch('https://api.light.inc/v1/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://api.light.inc/v1/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([
'balanceAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
],
'description' => '<string>',
'authentication' => [
'phoneNumber' => [
'localNumber' => '<string>'
],
'email' => '<string>'
],
'limits' => [
[
'amount' => 123,
'currency' => 'USD'
]
],
'deliveryContact' => [
'address' => [
'street' => '<string>',
'houseNumberOrName' => '<string>',
'city' => '<string>',
'postalCode' => '<string>',
'stateOrProvince' => '<string>'
],
'name' => [
'firstName' => '<string>',
'lastName' => '<string>'
],
'company' => '<string>',
'email' => '<string>',
'phoneNumber' => [
'localNumber' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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.light.inc/v1/cards"
payload := strings.NewReader("{\n \"balanceAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"description\": \"<string>\",\n \"authentication\": {\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n },\n \"email\": \"<string>\"\n },\n \"limits\": [\n {\n \"amount\": 123,\n \"currency\": \"USD\"\n }\n ],\n \"deliveryContact\": {\n \"address\": {\n \"street\": \"<string>\",\n \"houseNumberOrName\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"stateOrProvince\": \"<string>\"\n },\n \"name\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.light.inc/v1/cards")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"balanceAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"description\": \"<string>\",\n \"authentication\": {\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n },\n \"email\": \"<string>\"\n },\n \"limits\": [\n {\n \"amount\": 123,\n \"currency\": \"USD\"\n }\n ],\n \"deliveryContact\": {\n \"address\": {\n \"street\": \"<string>\",\n \"houseNumberOrName\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"stateOrProvince\": \"<string>\"\n },\n \"name\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/cards")
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;charset=UTF-8'
request.body = "{\n \"balanceAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"description\": \"<string>\",\n \"authentication\": {\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n },\n \"email\": \"<string>\"\n },\n \"limits\": [\n {\n \"amount\": 123,\n \"currency\": \"USD\"\n }\n ],\n \"deliveryContact\": {\n \"address\": {\n \"street\": \"<string>\",\n \"houseNumberOrName\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"stateOrProvince\": \"<string>\"\n },\n \"name\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": {\n \"localNumber\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardBalanceAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"form": "PHYSICAL",
"status": "ACTIVE",
"metadata": {
"type": "VENDOR"
},
"threeDs": {
"phoneNumber": {
"countryCode": "UNDEFINED",
"localNumber": "<string>"
},
"password": "<string>",
"email": "<string>"
},
"description": "<string>",
"bin": "<string>",
"lastFour": "<string>",
"cardholderName": "<string>",
"limits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "USD",
"interval": "PER_TRANSACTION",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "VENDOR"
}