curl --request POST \
--url https://api-v2.ziina.com/api/payment_intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency_code": "<string>",
"message": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"failure_url": "<string>",
"test": true,
"expiry": "<string>",
"allow_tips": false
}
'import requests
url = "https://api-v2.ziina.com/api/payment_intent"
payload = {
"amount": 123,
"currency_code": "<string>",
"message": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"failure_url": "<string>",
"test": True,
"expiry": "<string>",
"allow_tips": False
}
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: 123,
currency_code: '<string>',
message: '<string>',
success_url: '<string>',
cancel_url: '<string>',
failure_url: '<string>',
test: true,
expiry: '<string>',
allow_tips: false
})
};
fetch('https://api-v2.ziina.com/api/payment_intent', 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-v2.ziina.com/api/payment_intent",
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' => 123,
'currency_code' => '<string>',
'message' => '<string>',
'success_url' => '<string>',
'cancel_url' => '<string>',
'failure_url' => '<string>',
'test' => true,
'expiry' => '<string>',
'allow_tips' => false
]),
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-v2.ziina.com/api/payment_intent"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"message\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"test\": true,\n \"expiry\": \"<string>\",\n \"allow_tips\": false\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-v2.ziina.com/api/payment_intent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"message\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"test\": true,\n \"expiry\": \"<string>\",\n \"allow_tips\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.ziina.com/api/payment_intent")
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\": 123,\n \"currency_code\": \"<string>\",\n \"message\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"test\": true,\n \"expiry\": \"<string>\",\n \"allow_tips\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"account_id": "<string>",
"amount": 123,
"tip_amount": 123,
"vat_amount": 123,
"settled": {
"amount": 123,
"tip_amount": 123,
"vat_amount": 123,
"currency_code": "<string>"
},
"currency_code": "<string>",
"created_at": "<string>",
"status": "requires_payment_instrument",
"operation_id": "<string>",
"fee_amount": 123,
"message": "<string>",
"redirect_url": "<string>",
"embedded_url": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"latest_error": {
"message": "<string>",
"code": "<string>"
},
"allow_tips": false,
"card_details": {
"card_last_four": "<string>",
"card_brand": "visa",
"card_funding_type": "credit",
"card_category": "consumer",
"card_bin": "<string>",
"card_issuer": "<string>",
"card_country_code": "<string>",
"card_sub_brand": "<string>"
}
}Create Payment Intent
Create and manage payment intents using Ziina’s API. Ideal for custom checkouts, mobile apps, and seamless payment flows
curl --request POST \
--url https://api-v2.ziina.com/api/payment_intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency_code": "<string>",
"message": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"failure_url": "<string>",
"test": true,
"expiry": "<string>",
"allow_tips": false
}
'import requests
url = "https://api-v2.ziina.com/api/payment_intent"
payload = {
"amount": 123,
"currency_code": "<string>",
"message": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"failure_url": "<string>",
"test": True,
"expiry": "<string>",
"allow_tips": False
}
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: 123,
currency_code: '<string>',
message: '<string>',
success_url: '<string>',
cancel_url: '<string>',
failure_url: '<string>',
test: true,
expiry: '<string>',
allow_tips: false
})
};
fetch('https://api-v2.ziina.com/api/payment_intent', 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-v2.ziina.com/api/payment_intent",
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' => 123,
'currency_code' => '<string>',
'message' => '<string>',
'success_url' => '<string>',
'cancel_url' => '<string>',
'failure_url' => '<string>',
'test' => true,
'expiry' => '<string>',
'allow_tips' => false
]),
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-v2.ziina.com/api/payment_intent"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"message\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"test\": true,\n \"expiry\": \"<string>\",\n \"allow_tips\": false\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-v2.ziina.com/api/payment_intent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"message\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"test\": true,\n \"expiry\": \"<string>\",\n \"allow_tips\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.ziina.com/api/payment_intent")
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\": 123,\n \"currency_code\": \"<string>\",\n \"message\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"test\": true,\n \"expiry\": \"<string>\",\n \"allow_tips\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"account_id": "<string>",
"amount": 123,
"tip_amount": 123,
"vat_amount": 123,
"settled": {
"amount": 123,
"tip_amount": 123,
"vat_amount": 123,
"currency_code": "<string>"
},
"currency_code": "<string>",
"created_at": "<string>",
"status": "requires_payment_instrument",
"operation_id": "<string>",
"fee_amount": 123,
"message": "<string>",
"redirect_url": "<string>",
"embedded_url": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"latest_error": {
"message": "<string>",
"code": "<string>"
},
"allow_tips": false,
"card_details": {
"card_last_four": "<string>",
"card_brand": "visa",
"card_funding_type": "credit",
"card_category": "consumer",
"card_bin": "<string>",
"card_issuer": "<string>",
"card_country_code": "<string>",
"card_sub_brand": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Transaction amount. Values must be passed in the base units of their currency. For example, $10.50 should be provided as 1050.
Currency code of the amount to charge. This should be a 3-letter ISO-4217 currency code. For example, if you wish to charge 10 AED, you should pass AED. For more information on supported currencies, please visit the supported currencies page
3A message to be displayed to the user on the hosted payment page
The URL to be called by the hosted web page when the payment is successful
The URL to be called by the hosted web page when the payment is cancelled
Url where user will be redirected after failed payment
Whether to create a test payment. Test payments do not require a payment method and can be used to test the payment flow. You won't be charged for this call. You can use test cards to test the payment flow.
Unix timestamp in milliseconds, must be a future date
Whether to allow tips for this payment intent
Response
Created payment intent
id of the payment intent
Account which will receive payment
Transaction amount. Values must be passed in the base units of their currency. For example, $10.50 should be provided as 1050.
The amount of tips to be added to the payment intent
VAT amount in the presentment currency. Values are in the base units of their currency. For example, 0.50 AED is provided as 50. Zero when VAT is not applied.
Amounts in the merchant wallet currency. For AED and other same-currency payments these match the presentment fields. After FX conversion they are the AED amount, tip, and VAT.
Show child attributes
Show child attributes
Currency code of the amount to charge. This should be a 3-letter ISO-4217 currency code. For example, if you wish to charge 10 AED, you should pass AED. For more information on supported currencies, please visit the supported currencies page
Unix timestamp in milliseconds
Unique client generated UUID. In case of retries provide the same operation_id
The amount of fees paid for this payment intent
A message to be displayed to the user on the hosted payment page
The URL to be used to redirect the client to the hosted payment page
The URL to be used to show embedded payment page with the payment widget
The URL to be called by the hosted web page when the payment is successful
The URL to be called by the hosted web page when the payment is cancelled
An error that was encountered while processing the payment intent
Show child attributes
Show child attributes
Whether tips are allowed for this payment intent
Card used for the payment. Present on completed payment intents when card details are available.
Show child attributes
Show child attributes
Was this page helpful?