Create Gift Card
curl --request POST \
--url https://api.launchmystore.io/api/v1/gift_cards.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"initial_value": 123,
"balance": 123,
"currency": "<string>",
"code": "<string>",
"customer_id": "<string>",
"note": "<string>",
"expires_on": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/gift_cards.json"
payload = {
"initial_value": 123,
"balance": 123,
"currency": "<string>",
"code": "<string>",
"customer_id": "<string>",
"note": "<string>",
"expires_on": "<string>"
}
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({
initial_value: 123,
balance: 123,
currency: '<string>',
code: '<string>',
customer_id: '<string>',
note: '<string>',
expires_on: '<string>'
})
};
fetch('https://api.launchmystore.io/api/v1/gift_cards.json', 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.launchmystore.io/api/v1/gift_cards.json",
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([
'initial_value' => 123,
'balance' => 123,
'currency' => '<string>',
'code' => '<string>',
'customer_id' => '<string>',
'note' => '<string>',
'expires_on' => '<string>'
]),
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.launchmystore.io/api/v1/gift_cards.json"
payload := strings.NewReader("{\n \"initial_value\": 123,\n \"balance\": 123,\n \"currency\": \"<string>\",\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"note\": \"<string>\",\n \"expires_on\": \"<string>\"\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.launchmystore.io/api/v1/gift_cards.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"initial_value\": 123,\n \"balance\": 123,\n \"currency\": \"<string>\",\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"note\": \"<string>\",\n \"expires_on\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/gift_cards.json")
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 \"initial_value\": 123,\n \"balance\": 123,\n \"currency\": \"<string>\",\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"note\": \"<string>\",\n \"expires_on\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"state": "success",
"message": null,
"data": {
"gift_card": {
"id": "5c1b8a7d-2e3f-4a9b-8c6d-1f2e3a4b5c6d",
"gift_card_id": "5c1b8a7d-2e3f-4a9b-8c6d-1f2e3a4b5c6d",
"code": "GIFT-WXYZ-5678-ABCD",
"initial_value": 100,
"balance": 100,
"currency": "USD",
"enabled": true,
"disabled_at": null,
"starts_at": "2024-01-20T14:30:00.000Z",
"expires_on": "2025-06-15T00:00:00.000Z",
"customer_id": "cust_xyz789",
"order_id": null,
"note": "Holiday promotion",
"created_at": "2024-01-20T14:30:00.000Z",
"updated_at": "2024-01-20T14:30:00.000Z"
}
}
}
Gift Cards
Create Gift Card
Create a new gift card
POST
/
api
/
v1
/
gift_cards.json
Create Gift Card
curl --request POST \
--url https://api.launchmystore.io/api/v1/gift_cards.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"initial_value": 123,
"balance": 123,
"currency": "<string>",
"code": "<string>",
"customer_id": "<string>",
"note": "<string>",
"expires_on": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/gift_cards.json"
payload = {
"initial_value": 123,
"balance": 123,
"currency": "<string>",
"code": "<string>",
"customer_id": "<string>",
"note": "<string>",
"expires_on": "<string>"
}
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({
initial_value: 123,
balance: 123,
currency: '<string>',
code: '<string>',
customer_id: '<string>',
note: '<string>',
expires_on: '<string>'
})
};
fetch('https://api.launchmystore.io/api/v1/gift_cards.json', 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.launchmystore.io/api/v1/gift_cards.json",
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([
'initial_value' => 123,
'balance' => 123,
'currency' => '<string>',
'code' => '<string>',
'customer_id' => '<string>',
'note' => '<string>',
'expires_on' => '<string>'
]),
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.launchmystore.io/api/v1/gift_cards.json"
payload := strings.NewReader("{\n \"initial_value\": 123,\n \"balance\": 123,\n \"currency\": \"<string>\",\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"note\": \"<string>\",\n \"expires_on\": \"<string>\"\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.launchmystore.io/api/v1/gift_cards.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"initial_value\": 123,\n \"balance\": 123,\n \"currency\": \"<string>\",\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"note\": \"<string>\",\n \"expires_on\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/gift_cards.json")
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 \"initial_value\": 123,\n \"balance\": 123,\n \"currency\": \"<string>\",\n \"code\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"note\": \"<string>\",\n \"expires_on\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"state": "success",
"message": null,
"data": {
"gift_card": {
"id": "5c1b8a7d-2e3f-4a9b-8c6d-1f2e3a4b5c6d",
"gift_card_id": "5c1b8a7d-2e3f-4a9b-8c6d-1f2e3a4b5c6d",
"code": "GIFT-WXYZ-5678-ABCD",
"initial_value": 100,
"balance": 100,
"currency": "USD",
"enabled": true,
"disabled_at": null,
"starts_at": "2024-01-20T14:30:00.000Z",
"expires_on": "2025-06-15T00:00:00.000Z",
"customer_id": "cust_xyz789",
"order_id": null,
"note": "Holiday promotion",
"created_at": "2024-01-20T14:30:00.000Z",
"updated_at": "2024-01-20T14:30:00.000Z"
}
}
}
Body Parameters
Gift card value in major currency units (e.g.
100 for $100.00)Starting balance in major currency units (defaults to
initial_value)Currency code (ISO 4217)
Custom gift card code (auto-generated if not provided)
Associate with a customer
Internal note
Expiration date (ISO 8601)
Response
{
"status": 201,
"state": "success",
"message": null,
"data": {
"gift_card": {
"id": "5c1b8a7d-2e3f-4a9b-8c6d-1f2e3a4b5c6d",
"gift_card_id": "5c1b8a7d-2e3f-4a9b-8c6d-1f2e3a4b5c6d",
"code": "GIFT-WXYZ-5678-ABCD",
"initial_value": 100,
"balance": 100,
"currency": "USD",
"enabled": true,
"disabled_at": null,
"starts_at": "2024-01-20T14:30:00.000Z",
"expires_on": "2025-06-15T00:00:00.000Z",
"customer_id": "cust_xyz789",
"order_id": null,
"note": "Holiday promotion",
"created_at": "2024-01-20T14:30:00.000Z",
"updated_at": "2024-01-20T14:30:00.000Z"
}
}
}
⌘I