Create intent for widget redirect
curl --request POST \
--url https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"buyer": {
"email": "example@email.com",
"id": "unique_customer_id"
},
"currency": "USD",
"idempotency_key": "unique_string",
"items": [
{
"amount": "10.70",
"description": "optional item description",
"id": "item id",
"image_url": "https://developer-image.url/image.png",
"title": "Item title"
}
],
"transaction_type": "BUY_VDA",
"reference": "44cda1bb-2625-4acf-9d84-0cb78589e9a6"
}
'import requests
url = "https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect"
payload = {
"buyer": {
"email": "example@email.com",
"id": "unique_customer_id"
},
"currency": "USD",
"idempotency_key": "unique_string",
"items": [
{
"amount": "10.70",
"description": "optional item description",
"id": "item id",
"image_url": "https://developer-image.url/image.png",
"title": "Item title"
}
],
"transaction_type": "BUY_VDA",
"reference": "44cda1bb-2625-4acf-9d84-0cb78589e9a6"
}
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({
buyer: {email: 'example@email.com', id: 'unique_customer_id'},
currency: 'USD',
idempotency_key: 'unique_string',
items: [
{
amount: '10.70',
description: 'optional item description',
id: 'item id',
image_url: 'https://developer-image.url/image.png',
title: 'Item title'
}
],
transaction_type: 'BUY_VDA',
reference: '44cda1bb-2625-4acf-9d84-0cb78589e9a6'
})
};
fetch('https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect', 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://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect",
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([
'buyer' => [
'email' => 'example@email.com',
'id' => 'unique_customer_id'
],
'currency' => 'USD',
'idempotency_key' => 'unique_string',
'items' => [
[
'amount' => '10.70',
'description' => 'optional item description',
'id' => 'item id',
'image_url' => 'https://developer-image.url/image.png',
'title' => 'Item title'
]
],
'transaction_type' => 'BUY_VDA',
'reference' => '44cda1bb-2625-4acf-9d84-0cb78589e9a6'
]),
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://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect"
payload := strings.NewReader("{\n \"buyer\": {\n \"email\": \"example@email.com\",\n \"id\": \"unique_customer_id\"\n },\n \"currency\": \"USD\",\n \"idempotency_key\": \"unique_string\",\n \"items\": [\n {\n \"amount\": \"10.70\",\n \"description\": \"optional item description\",\n \"id\": \"item id\",\n \"image_url\": \"https://developer-image.url/image.png\",\n \"title\": \"Item title\"\n }\n ],\n \"transaction_type\": \"BUY_VDA\",\n \"reference\": \"44cda1bb-2625-4acf-9d84-0cb78589e9a6\"\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://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"buyer\": {\n \"email\": \"example@email.com\",\n \"id\": \"unique_customer_id\"\n },\n \"currency\": \"USD\",\n \"idempotency_key\": \"unique_string\",\n \"items\": [\n {\n \"amount\": \"10.70\",\n \"description\": \"optional item description\",\n \"id\": \"item id\",\n \"image_url\": \"https://developer-image.url/image.png\",\n \"title\": \"Item title\"\n }\n ],\n \"transaction_type\": \"BUY_VDA\",\n \"reference\": \"44cda1bb-2625-4acf-9d84-0cb78589e9a6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect")
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 \"buyer\": {\n \"email\": \"example@email.com\",\n \"id\": \"unique_customer_id\"\n },\n \"currency\": \"USD\",\n \"idempotency_key\": \"unique_string\",\n \"items\": [\n {\n \"amount\": \"10.70\",\n \"description\": \"optional item description\",\n \"id\": \"item id\",\n \"image_url\": \"https://developer-image.url/image.png\",\n \"title\": \"Item title\"\n }\n ],\n \"transaction_type\": \"BUY_VDA\",\n \"reference\": \"44cda1bb-2625-4acf-9d84-0cb78589e9a6\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"redirect_url": "https://redirect.forte.io/0f7660c1-a106-481f-acf9-1848e98a7230?redirect_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdGF0ZSI6IjRnd1ZRWnFDV0FMYXBHZVVvS0tpQm4zRVIyWkRweDExIiwiZXhwIjoxNjkyMDQ1MTI5LCJpc3MiOiJmb3J0ZV9hdXRoX3N2YyIsInRva2VuX3R5cGUiOiJleHRlcm5hbF90b2tlbiJ9.avRqsX_ohBVaZ-3i1eCUWkqPrJhuTafjklh5BJ4oevQ"
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}{
"error": {
"code": 123,
"reason": "Conflict",
"status": 409,
"message": "<string>"
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}Forte Payments
Create Redirect Intent
Create a payment intent for the customer to be redirected on hosted UI and make a purchase there.
POST
/
payments
/
v2
/
intent
/
redirect
Create intent for widget redirect
curl --request POST \
--url https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"buyer": {
"email": "example@email.com",
"id": "unique_customer_id"
},
"currency": "USD",
"idempotency_key": "unique_string",
"items": [
{
"amount": "10.70",
"description": "optional item description",
"id": "item id",
"image_url": "https://developer-image.url/image.png",
"title": "Item title"
}
],
"transaction_type": "BUY_VDA",
"reference": "44cda1bb-2625-4acf-9d84-0cb78589e9a6"
}
'import requests
url = "https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect"
payload = {
"buyer": {
"email": "example@email.com",
"id": "unique_customer_id"
},
"currency": "USD",
"idempotency_key": "unique_string",
"items": [
{
"amount": "10.70",
"description": "optional item description",
"id": "item id",
"image_url": "https://developer-image.url/image.png",
"title": "Item title"
}
],
"transaction_type": "BUY_VDA",
"reference": "44cda1bb-2625-4acf-9d84-0cb78589e9a6"
}
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({
buyer: {email: 'example@email.com', id: 'unique_customer_id'},
currency: 'USD',
idempotency_key: 'unique_string',
items: [
{
amount: '10.70',
description: 'optional item description',
id: 'item id',
image_url: 'https://developer-image.url/image.png',
title: 'Item title'
}
],
transaction_type: 'BUY_VDA',
reference: '44cda1bb-2625-4acf-9d84-0cb78589e9a6'
})
};
fetch('https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect', 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://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect",
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([
'buyer' => [
'email' => 'example@email.com',
'id' => 'unique_customer_id'
],
'currency' => 'USD',
'idempotency_key' => 'unique_string',
'items' => [
[
'amount' => '10.70',
'description' => 'optional item description',
'id' => 'item id',
'image_url' => 'https://developer-image.url/image.png',
'title' => 'Item title'
]
],
'transaction_type' => 'BUY_VDA',
'reference' => '44cda1bb-2625-4acf-9d84-0cb78589e9a6'
]),
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://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect"
payload := strings.NewReader("{\n \"buyer\": {\n \"email\": \"example@email.com\",\n \"id\": \"unique_customer_id\"\n },\n \"currency\": \"USD\",\n \"idempotency_key\": \"unique_string\",\n \"items\": [\n {\n \"amount\": \"10.70\",\n \"description\": \"optional item description\",\n \"id\": \"item id\",\n \"image_url\": \"https://developer-image.url/image.png\",\n \"title\": \"Item title\"\n }\n ],\n \"transaction_type\": \"BUY_VDA\",\n \"reference\": \"44cda1bb-2625-4acf-9d84-0cb78589e9a6\"\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://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"buyer\": {\n \"email\": \"example@email.com\",\n \"id\": \"unique_customer_id\"\n },\n \"currency\": \"USD\",\n \"idempotency_key\": \"unique_string\",\n \"items\": [\n {\n \"amount\": \"10.70\",\n \"description\": \"optional item description\",\n \"id\": \"item id\",\n \"image_url\": \"https://developer-image.url/image.png\",\n \"title\": \"Item title\"\n }\n ],\n \"transaction_type\": \"BUY_VDA\",\n \"reference\": \"44cda1bb-2625-4acf-9d84-0cb78589e9a6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.sandbox.lemmax.com/payments/v2/intent/redirect")
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 \"buyer\": {\n \"email\": \"example@email.com\",\n \"id\": \"unique_customer_id\"\n },\n \"currency\": \"USD\",\n \"idempotency_key\": \"unique_string\",\n \"items\": [\n {\n \"amount\": \"10.70\",\n \"description\": \"optional item description\",\n \"id\": \"item id\",\n \"image_url\": \"https://developer-image.url/image.png\",\n \"title\": \"Item title\"\n }\n ],\n \"transaction_type\": \"BUY_VDA\",\n \"reference\": \"44cda1bb-2625-4acf-9d84-0cb78589e9a6\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"redirect_url": "https://redirect.forte.io/0f7660c1-a106-481f-acf9-1848e98a7230?redirect_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdGF0ZSI6IjRnd1ZRWnFDV0FMYXBHZVVvS0tpQm4zRVIyWkRweDExIiwiZXhwIjoxNjkyMDQ1MTI5LCJpc3MiOiJmb3J0ZV9hdXRoX3N2YyIsInRva2VuX3R5cGUiOiJleHRlcm5hbF90b2tlbiJ9.avRqsX_ohBVaZ-3i1eCUWkqPrJhuTafjklh5BJ4oevQ"
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}{
"error": {
"code": 123,
"reason": "Conflict",
"status": 409,
"message": "<string>"
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}{
"error": {
"message": "The Foo resource could not be found",
"reason": "Not Found",
"status": 404
}
}Authorizations
access_token returned by the /auth/v1/oauth2/tokens API call.
Body
application/json
Payment intent request payload
Request payload for BUY_VDA transaction type
Details of the customer purchasing the item. Either email or wallet or both must be present.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Currency of the item.
Available options:
USD, EUR Example:
"USD"
A unique value provided to ensure the operation is idempotent.
Maximum string length:
1000Example:
"idempotency-key-1"
Required array length:
1 elementShow child attributes
Show child attributes
Transaction type for buying Virtual Digital Assets, e.g. game currency.
Available options:
BUY_VDA Optional merchant-provided reference.
Maximum string length:
100Example:
"44cda1bb-2625-4acf-9d84-0cb78589e9a6"
Response
Create intent redirect response
Show child attributes
Show child attributes
⌘I