Create a payment intent
curl --request POST \
--url https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1000,
"currency": "AED",
"planCode": "PREMIUM_MONTHLY",
"seats": 1,
"userEmail": "test@test.com",
"userName": "John Doe",
"chargeCode": "EXTRA_STORAGE",
"quota": 100,
"isRenewable": true
}
'import requests
url = "https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments"
payload = {
"amount": 1000,
"currency": "AED",
"planCode": "PREMIUM_MONTHLY",
"seats": 1,
"userEmail": "test@test.com",
"userName": "John Doe",
"chargeCode": "EXTRA_STORAGE",
"quota": 100,
"isRenewable": True
}
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({
amount: 1000,
currency: 'AED',
planCode: 'PREMIUM_MONTHLY',
seats: 1,
userEmail: 'test@test.com',
userName: 'John Doe',
chargeCode: 'EXTRA_STORAGE',
quota: 100,
isRenewable: true
})
};
fetch('https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments', 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://dev-billing-api.iqraa.ai/api/v1/api/v1/payments",
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([
'amount' => 1000,
'currency' => 'AED',
'planCode' => 'PREMIUM_MONTHLY',
'seats' => 1,
'userEmail' => 'test@test.com',
'userName' => 'John Doe',
'chargeCode' => 'EXTRA_STORAGE',
'quota' => 100,
'isRenewable' => true
]),
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://dev-billing-api.iqraa.ai/api/v1/api/v1/payments"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"AED\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"seats\": 1,\n \"userEmail\": \"test@test.com\",\n \"userName\": \"John Doe\",\n \"chargeCode\": \"EXTRA_STORAGE\",\n \"quota\": 100,\n \"isRenewable\": true\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://dev-billing-api.iqraa.ai/api/v1/api/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"AED\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"seats\": 1,\n \"userEmail\": \"test@test.com\",\n \"userName\": \"John Doe\",\n \"chargeCode\": \"EXTRA_STORAGE\",\n \"quota\": 100,\n \"isRenewable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments")
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 \"amount\": 1000,\n \"currency\": \"AED\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"seats\": 1,\n \"userEmail\": \"test@test.com\",\n \"userName\": \"John Doe\",\n \"chargeCode\": \"EXTRA_STORAGE\",\n \"quota\": 100,\n \"isRenewable\": true\n}"
response = http.request(request)
puts response.read_bodyPayments
Create a payment intent
POST
/
api
/
v1
/
payments
Create a payment intent
curl --request POST \
--url https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1000,
"currency": "AED",
"planCode": "PREMIUM_MONTHLY",
"seats": 1,
"userEmail": "test@test.com",
"userName": "John Doe",
"chargeCode": "EXTRA_STORAGE",
"quota": 100,
"isRenewable": true
}
'import requests
url = "https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments"
payload = {
"amount": 1000,
"currency": "AED",
"planCode": "PREMIUM_MONTHLY",
"seats": 1,
"userEmail": "test@test.com",
"userName": "John Doe",
"chargeCode": "EXTRA_STORAGE",
"quota": 100,
"isRenewable": True
}
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({
amount: 1000,
currency: 'AED',
planCode: 'PREMIUM_MONTHLY',
seats: 1,
userEmail: 'test@test.com',
userName: 'John Doe',
chargeCode: 'EXTRA_STORAGE',
quota: 100,
isRenewable: true
})
};
fetch('https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments', 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://dev-billing-api.iqraa.ai/api/v1/api/v1/payments",
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([
'amount' => 1000,
'currency' => 'AED',
'planCode' => 'PREMIUM_MONTHLY',
'seats' => 1,
'userEmail' => 'test@test.com',
'userName' => 'John Doe',
'chargeCode' => 'EXTRA_STORAGE',
'quota' => 100,
'isRenewable' => true
]),
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://dev-billing-api.iqraa.ai/api/v1/api/v1/payments"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"AED\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"seats\": 1,\n \"userEmail\": \"test@test.com\",\n \"userName\": \"John Doe\",\n \"chargeCode\": \"EXTRA_STORAGE\",\n \"quota\": 100,\n \"isRenewable\": true\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://dev-billing-api.iqraa.ai/api/v1/api/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"AED\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"seats\": 1,\n \"userEmail\": \"test@test.com\",\n \"userName\": \"John Doe\",\n \"chargeCode\": \"EXTRA_STORAGE\",\n \"quota\": 100,\n \"isRenewable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-billing-api.iqraa.ai/api/v1/api/v1/payments")
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 \"amount\": 1000,\n \"currency\": \"AED\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"seats\": 1,\n \"userEmail\": \"test@test.com\",\n \"userName\": \"John Doe\",\n \"chargeCode\": \"EXTRA_STORAGE\",\n \"quota\": 100,\n \"isRenewable\": true\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The amount for the payment intent
Example:
1000
The currency for the payment intent
Example:
"AED"
The plan code associated with the payment intent (for subscriptions)
Example:
"PREMIUM_MONTHLY"
Number of seats (for subscriptions)
Example:
1
The user email for the payment intent
Example:
"test@test.com"
The user name for the payment intent
Example:
"John Doe"
The entitlement code for the addon
Example:
"EXTRA_STORAGE"
The quota amount for the addon
Required range:
x >= 1Example:
100
Whether the addon can be automatically renewed
Example:
true
Response
Payment intent created successfully
⌘I