Purchase Gift Card
curl --request POST \
--url http://localhost:3050/api/v1/business/open/gift-card/purchase \
--header 'Content-Type: application/json' \
--data '
{
"product_id": "<string>",
"amount": 50,
"quantity": 1,
"recipient_email": "[email protected]",
"agree_to_terms": true,
"from_name": "John Doe",
"recipient_phone_number": "+2348062964137"
}
'import requests
url = "http://localhost:3050/api/v1/business/open/gift-card/purchase"
payload = {
"product_id": "<string>",
"amount": 50,
"quantity": 1,
"recipient_email": "[email protected]",
"agree_to_terms": True,
"from_name": "John Doe",
"recipient_phone_number": "+2348062964137"
}
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({
product_id: '<string>',
amount: 50,
quantity: 1,
recipient_email: '[email protected]',
agree_to_terms: true,
from_name: 'John Doe',
recipient_phone_number: '+2348062964137'
})
};
fetch('http://localhost:3050/api/v1/business/open/gift-card/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_PORT => "3050",
CURLOPT_URL => "http://localhost:3050/api/v1/business/open/gift-card/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([
'product_id' => '<string>',
'amount' => 50,
'quantity' => 1,
'recipient_email' => '[email protected]',
'agree_to_terms' => true,
'from_name' => 'John Doe',
'recipient_phone_number' => '+2348062964137'
]),
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 := "http://localhost:3050/api/v1/business/open/gift-card/purchase"
payload := strings.NewReader("{\n \"product_id\": \"<string>\",\n \"amount\": 50,\n \"quantity\": 1,\n \"recipient_email\": \"[email protected]\",\n \"agree_to_terms\": true,\n \"from_name\": \"John Doe\",\n \"recipient_phone_number\": \"+2348062964137\"\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("http://localhost:3050/api/v1/business/open/gift-card/purchase")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": \"<string>\",\n \"amount\": 50,\n \"quantity\": 1,\n \"recipient_email\": \"[email protected]\",\n \"agree_to_terms\": true,\n \"from_name\": \"John Doe\",\n \"recipient_phone_number\": \"+2348062964137\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3050/api/v1/business/open/gift-card/purchase")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": \"<string>\",\n \"amount\": 50,\n \"quantity\": 1,\n \"recipient_email\": \"[email protected]\",\n \"agree_to_terms\": true,\n \"from_name\": \"John Doe\",\n \"recipient_phone_number\": \"+2348062964137\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Gift card purchased successfully",
"status": true,
"data": {
"uuid": "<string>",
"amount": 123,
"quantity": 123,
"totalAmount": 123,
"totalFee": 123,
"platformFee": 123,
"providerFee": 123,
"currencyCode": "<string>",
"recipientEmail": "<string>",
"reference": "<string>",
"status": "<string>",
"productName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"redemptionCodes": [
{
"cardNumber": "<string>",
"pinCode": "<string>",
"redemptionUrl": "<string>"
}
],
"providerTransactionId": "<string>"
}
}Buy Gift Card
Purchase Gift Card
POST
/
api
/
v1
/
business
/
open
/
gift-card
/
purchase
Purchase Gift Card
curl --request POST \
--url http://localhost:3050/api/v1/business/open/gift-card/purchase \
--header 'Content-Type: application/json' \
--data '
{
"product_id": "<string>",
"amount": 50,
"quantity": 1,
"recipient_email": "[email protected]",
"agree_to_terms": true,
"from_name": "John Doe",
"recipient_phone_number": "+2348062964137"
}
'import requests
url = "http://localhost:3050/api/v1/business/open/gift-card/purchase"
payload = {
"product_id": "<string>",
"amount": 50,
"quantity": 1,
"recipient_email": "[email protected]",
"agree_to_terms": True,
"from_name": "John Doe",
"recipient_phone_number": "+2348062964137"
}
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({
product_id: '<string>',
amount: 50,
quantity: 1,
recipient_email: '[email protected]',
agree_to_terms: true,
from_name: 'John Doe',
recipient_phone_number: '+2348062964137'
})
};
fetch('http://localhost:3050/api/v1/business/open/gift-card/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_PORT => "3050",
CURLOPT_URL => "http://localhost:3050/api/v1/business/open/gift-card/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([
'product_id' => '<string>',
'amount' => 50,
'quantity' => 1,
'recipient_email' => '[email protected]',
'agree_to_terms' => true,
'from_name' => 'John Doe',
'recipient_phone_number' => '+2348062964137'
]),
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 := "http://localhost:3050/api/v1/business/open/gift-card/purchase"
payload := strings.NewReader("{\n \"product_id\": \"<string>\",\n \"amount\": 50,\n \"quantity\": 1,\n \"recipient_email\": \"[email protected]\",\n \"agree_to_terms\": true,\n \"from_name\": \"John Doe\",\n \"recipient_phone_number\": \"+2348062964137\"\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("http://localhost:3050/api/v1/business/open/gift-card/purchase")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": \"<string>\",\n \"amount\": 50,\n \"quantity\": 1,\n \"recipient_email\": \"[email protected]\",\n \"agree_to_terms\": true,\n \"from_name\": \"John Doe\",\n \"recipient_phone_number\": \"+2348062964137\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3050/api/v1/business/open/gift-card/purchase")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": \"<string>\",\n \"amount\": 50,\n \"quantity\": 1,\n \"recipient_email\": \"[email protected]\",\n \"agree_to_terms\": true,\n \"from_name\": \"John Doe\",\n \"recipient_phone_number\": \"+2348062964137\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Gift card purchased successfully",
"status": true,
"data": {
"uuid": "<string>",
"amount": 123,
"quantity": 123,
"totalAmount": 123,
"totalFee": 123,
"platformFee": 123,
"providerFee": 123,
"currencyCode": "<string>",
"recipientEmail": "<string>",
"reference": "<string>",
"status": "<string>",
"productName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"redemptionCodes": [
{
"cardNumber": "<string>",
"pinCode": "<string>",
"redemptionUrl": "<string>"
}
],
"providerTransactionId": "<string>"
}
}Body
application/json
Product uuid
Amount
Example:
50
Quantity
Example:
1
Recipient email
Example:
Agree to terms and conditions
Example:
true
From name
Example:
"John Doe"
Recipient phone number
Example:
"+2348062964137"

