curl --request POST \
--url https://api.sbx.moduluslabs.io/ecom/v1/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"merchant_branch_reference_number": "SH-ANG-001",
"type": "multi_use",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": {
"color": "black"
}
}
],
"description": "Order for wireless earbuds",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
},
"expires_at": "2026-07-18T00:00:00Z",
"max_uses": 10,
"metadata": {
"campaign_id": "summer-2026",
"internal_ref": "CRM-4821"
}
}
'import requests
url = "https://api.sbx.moduluslabs.io/ecom/v1/checkout"
payload = {
"merchant_branch_reference_number": "SH-ANG-001",
"type": "multi_use",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": { "color": "black" }
}
],
"description": "Order for wireless earbuds",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
},
"expires_at": "2026-07-18T00:00:00Z",
"max_uses": 10,
"metadata": {
"campaign_id": "summer-2026",
"internal_ref": "CRM-4821"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_branch_reference_number: 'SH-ANG-001',
type: 'multi_use',
currency: 'PHP',
amount: 150000,
line_items: [
{
sku: 'PROD-001',
name: 'Wireless Earbuds',
unit_price: 75000,
quantity: 2,
metadata: {color: 'black'}
}
],
description: 'Order for wireless earbuds',
order_reference: 'ORD-2026-0618-001',
redirect_urls: {
success: 'https://merchant.com/payment/success',
declined: 'https://merchant.com/payment/declined',
expired: 'https://merchant.com/payment/expired'
},
expires_at: '2026-07-18T00:00:00Z',
max_uses: 10,
metadata: {campaign_id: 'summer-2026', internal_ref: 'CRM-4821'}
})
};
fetch('https://api.sbx.moduluslabs.io/ecom/v1/checkout', 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.sbx.moduluslabs.io/ecom/v1/checkout",
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([
'merchant_branch_reference_number' => 'SH-ANG-001',
'type' => 'multi_use',
'currency' => 'PHP',
'amount' => 150000,
'line_items' => [
[
'sku' => 'PROD-001',
'name' => 'Wireless Earbuds',
'unit_price' => 75000,
'quantity' => 2,
'metadata' => [
'color' => 'black'
]
]
],
'description' => 'Order for wireless earbuds',
'order_reference' => 'ORD-2026-0618-001',
'redirect_urls' => [
'success' => 'https://merchant.com/payment/success',
'declined' => 'https://merchant.com/payment/declined',
'expired' => 'https://merchant.com/payment/expired'
],
'expires_at' => '2026-07-18T00:00:00Z',
'max_uses' => 10,
'metadata' => [
'campaign_id' => 'summer-2026',
'internal_ref' => 'CRM-4821'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.sbx.moduluslabs.io/ecom/v1/checkout"
payload := strings.NewReader("{\n \"merchant_branch_reference_number\": \"SH-ANG-001\",\n \"type\": \"multi_use\",\n \"currency\": \"PHP\",\n \"amount\": 150000,\n \"line_items\": [\n {\n \"sku\": \"PROD-001\",\n \"name\": \"Wireless Earbuds\",\n \"unit_price\": 75000,\n \"quantity\": 2,\n \"metadata\": {\n \"color\": \"black\"\n }\n }\n ],\n \"description\": \"Order for wireless earbuds\",\n \"order_reference\": \"ORD-2026-0618-001\",\n \"redirect_urls\": {\n \"success\": \"https://merchant.com/payment/success\",\n \"declined\": \"https://merchant.com/payment/declined\",\n \"expired\": \"https://merchant.com/payment/expired\"\n },\n \"expires_at\": \"2026-07-18T00:00:00Z\",\n \"max_uses\": 10,\n \"metadata\": {\n \"campaign_id\": \"summer-2026\",\n \"internal_ref\": \"CRM-4821\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.sbx.moduluslabs.io/ecom/v1/checkout")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_branch_reference_number\": \"SH-ANG-001\",\n \"type\": \"multi_use\",\n \"currency\": \"PHP\",\n \"amount\": 150000,\n \"line_items\": [\n {\n \"sku\": \"PROD-001\",\n \"name\": \"Wireless Earbuds\",\n \"unit_price\": 75000,\n \"quantity\": 2,\n \"metadata\": {\n \"color\": \"black\"\n }\n }\n ],\n \"description\": \"Order for wireless earbuds\",\n \"order_reference\": \"ORD-2026-0618-001\",\n \"redirect_urls\": {\n \"success\": \"https://merchant.com/payment/success\",\n \"declined\": \"https://merchant.com/payment/declined\",\n \"expired\": \"https://merchant.com/payment/expired\"\n },\n \"expires_at\": \"2026-07-18T00:00:00Z\",\n \"max_uses\": 10,\n \"metadata\": {\n \"campaign_id\": \"summer-2026\",\n \"internal_ref\": \"CRM-4821\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.sbx.moduluslabs.io/ecom/v1/checkout");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Idempotency-Key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"merchant_branch_reference_number\": \"SH-ANG-001\",\n \"type\": \"multi_use\",\n \"currency\": \"PHP\",\n \"amount\": 150000,\n \"line_items\": [\n {\n \"sku\": \"PROD-001\",\n \"name\": \"Wireless Earbuds\",\n \"unit_price\": 75000,\n \"quantity\": 2,\n \"metadata\": {\n \"color\": \"black\"\n }\n }\n ],\n \"description\": \"Order for wireless earbuds\",\n \"order_reference\": \"ORD-2026-0618-001\",\n \"redirect_urls\": {\n \"success\": \"https://merchant.com/payment/success\",\n \"declined\": \"https://merchant.com/payment/declined\",\n \"expired\": \"https://merchant.com/payment/expired\"\n },\n \"expires_at\": \"2026-07-18T00:00:00Z\",\n \"max_uses\": 10,\n \"metadata\": {\n \"campaign_id\": \"summer-2026\",\n \"internal_ref\": \"CRM-4821\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_branch_reference_number": "SH-ANG-001",
"merchant_branch_name": "SM City Angeles - Branch 1",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": {}
}
],
"expires_at": "2026-07-18T00:00:00Z",
"hosted_url": "https://pay.moduluslabs.io/checkout/550e8400-e29b-41d4-a716-446655440000",
"successful_payment_count": 3,
"metadata": {},
"created_at": "2026-06-18T10:30:00Z",
"updated_at": "2026-06-18T14:22:00Z",
"description": "Order for wireless earbuds",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
},
"max_uses": 10,
"cancelled_at": "2023-11-07T05:31:56Z",
"cancellation_reason": "<string>"
}
}Create a Payment Link
Create a hosted payment link and return the URL to share with customers
curl --request POST \
--url https://api.sbx.moduluslabs.io/ecom/v1/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"merchant_branch_reference_number": "SH-ANG-001",
"type": "multi_use",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": {
"color": "black"
}
}
],
"description": "Order for wireless earbuds",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
},
"expires_at": "2026-07-18T00:00:00Z",
"max_uses": 10,
"metadata": {
"campaign_id": "summer-2026",
"internal_ref": "CRM-4821"
}
}
'import requests
url = "https://api.sbx.moduluslabs.io/ecom/v1/checkout"
payload = {
"merchant_branch_reference_number": "SH-ANG-001",
"type": "multi_use",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": { "color": "black" }
}
],
"description": "Order for wireless earbuds",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
},
"expires_at": "2026-07-18T00:00:00Z",
"max_uses": 10,
"metadata": {
"campaign_id": "summer-2026",
"internal_ref": "CRM-4821"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_branch_reference_number: 'SH-ANG-001',
type: 'multi_use',
currency: 'PHP',
amount: 150000,
line_items: [
{
sku: 'PROD-001',
name: 'Wireless Earbuds',
unit_price: 75000,
quantity: 2,
metadata: {color: 'black'}
}
],
description: 'Order for wireless earbuds',
order_reference: 'ORD-2026-0618-001',
redirect_urls: {
success: 'https://merchant.com/payment/success',
declined: 'https://merchant.com/payment/declined',
expired: 'https://merchant.com/payment/expired'
},
expires_at: '2026-07-18T00:00:00Z',
max_uses: 10,
metadata: {campaign_id: 'summer-2026', internal_ref: 'CRM-4821'}
})
};
fetch('https://api.sbx.moduluslabs.io/ecom/v1/checkout', 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.sbx.moduluslabs.io/ecom/v1/checkout",
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([
'merchant_branch_reference_number' => 'SH-ANG-001',
'type' => 'multi_use',
'currency' => 'PHP',
'amount' => 150000,
'line_items' => [
[
'sku' => 'PROD-001',
'name' => 'Wireless Earbuds',
'unit_price' => 75000,
'quantity' => 2,
'metadata' => [
'color' => 'black'
]
]
],
'description' => 'Order for wireless earbuds',
'order_reference' => 'ORD-2026-0618-001',
'redirect_urls' => [
'success' => 'https://merchant.com/payment/success',
'declined' => 'https://merchant.com/payment/declined',
'expired' => 'https://merchant.com/payment/expired'
],
'expires_at' => '2026-07-18T00:00:00Z',
'max_uses' => 10,
'metadata' => [
'campaign_id' => 'summer-2026',
'internal_ref' => 'CRM-4821'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.sbx.moduluslabs.io/ecom/v1/checkout"
payload := strings.NewReader("{\n \"merchant_branch_reference_number\": \"SH-ANG-001\",\n \"type\": \"multi_use\",\n \"currency\": \"PHP\",\n \"amount\": 150000,\n \"line_items\": [\n {\n \"sku\": \"PROD-001\",\n \"name\": \"Wireless Earbuds\",\n \"unit_price\": 75000,\n \"quantity\": 2,\n \"metadata\": {\n \"color\": \"black\"\n }\n }\n ],\n \"description\": \"Order for wireless earbuds\",\n \"order_reference\": \"ORD-2026-0618-001\",\n \"redirect_urls\": {\n \"success\": \"https://merchant.com/payment/success\",\n \"declined\": \"https://merchant.com/payment/declined\",\n \"expired\": \"https://merchant.com/payment/expired\"\n },\n \"expires_at\": \"2026-07-18T00:00:00Z\",\n \"max_uses\": 10,\n \"metadata\": {\n \"campaign_id\": \"summer-2026\",\n \"internal_ref\": \"CRM-4821\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.sbx.moduluslabs.io/ecom/v1/checkout")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_branch_reference_number\": \"SH-ANG-001\",\n \"type\": \"multi_use\",\n \"currency\": \"PHP\",\n \"amount\": 150000,\n \"line_items\": [\n {\n \"sku\": \"PROD-001\",\n \"name\": \"Wireless Earbuds\",\n \"unit_price\": 75000,\n \"quantity\": 2,\n \"metadata\": {\n \"color\": \"black\"\n }\n }\n ],\n \"description\": \"Order for wireless earbuds\",\n \"order_reference\": \"ORD-2026-0618-001\",\n \"redirect_urls\": {\n \"success\": \"https://merchant.com/payment/success\",\n \"declined\": \"https://merchant.com/payment/declined\",\n \"expired\": \"https://merchant.com/payment/expired\"\n },\n \"expires_at\": \"2026-07-18T00:00:00Z\",\n \"max_uses\": 10,\n \"metadata\": {\n \"campaign_id\": \"summer-2026\",\n \"internal_ref\": \"CRM-4821\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.sbx.moduluslabs.io/ecom/v1/checkout");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Idempotency-Key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"merchant_branch_reference_number\": \"SH-ANG-001\",\n \"type\": \"multi_use\",\n \"currency\": \"PHP\",\n \"amount\": 150000,\n \"line_items\": [\n {\n \"sku\": \"PROD-001\",\n \"name\": \"Wireless Earbuds\",\n \"unit_price\": 75000,\n \"quantity\": 2,\n \"metadata\": {\n \"color\": \"black\"\n }\n }\n ],\n \"description\": \"Order for wireless earbuds\",\n \"order_reference\": \"ORD-2026-0618-001\",\n \"redirect_urls\": {\n \"success\": \"https://merchant.com/payment/success\",\n \"declined\": \"https://merchant.com/payment/declined\",\n \"expired\": \"https://merchant.com/payment/expired\"\n },\n \"expires_at\": \"2026-07-18T00:00:00Z\",\n \"max_uses\": 10,\n \"metadata\": {\n \"campaign_id\": \"summer-2026\",\n \"internal_ref\": \"CRM-4821\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_branch_reference_number": "SH-ANG-001",
"merchant_branch_name": "SM City Angeles - Branch 1",
"currency": "PHP",
"amount": 150000,
"line_items": [
{
"sku": "PROD-001",
"name": "Wireless Earbuds",
"unit_price": 75000,
"quantity": 2,
"metadata": {}
}
],
"expires_at": "2026-07-18T00:00:00Z",
"hosted_url": "https://pay.moduluslabs.io/checkout/550e8400-e29b-41d4-a716-446655440000",
"successful_payment_count": 3,
"metadata": {},
"created_at": "2026-06-18T10:30:00Z",
"updated_at": "2026-06-18T14:22:00Z",
"description": "Order for wireless earbuds",
"order_reference": "ORD-2026-0618-001",
"redirect_urls": {
"success": "https://merchant.com/payment/success",
"declined": "https://merchant.com/payment/declined",
"expired": "https://merchant.com/payment/expired"
},
"max_uses": 10,
"cancelled_at": "2023-11-07T05:31:56Z",
"cancellation_reason": "<string>"
}
}201 Created with the full payment link object wrapped in data. Share the returned hosted_url with your customer to collect payment.Idempotency
This endpoint requires anIdempotency-Key header — a unique client-generated identifier (letters, digits, dot, hyphen, underscore; 8–64 characters, e.g. your own order ID). Reusing the same key with an identical body returns the original response without creating a duplicate. Reusing it with a different body returns 409 idempotency_mismatch. Keys expire after 24 hours.
Amount validation
Theamount must equal the sum of every line item (unit_price × quantity). For the example below, 75000 × 2 = 150000.
merchant_branch_reference_number is required when your API key is scoped to a partner or merchant. Branch-scoped keys can omit it — the link is created against that branch automatically.Required scope
payment_links.createAuthorizations
API key passed as a bearer token. Use sk_live_ keys for production and sk_test_ keys for sandbox. Keys are provisioned during merchant onboarding.
Headers
Unique client-generated identifier to prevent duplicate operations. Allowed characters: letters, digits, dot (.), hyphen (-), and underscore (_); 8–64 characters — e.g. your own order ID. Reusing the same key with an identical body returns the original response; reusing it with a different body returns 409 idempotency_mismatch. Keys expire after 24 hours.
^[A-Za-z0-9._-]{8,64}$Body
one_time accepts exactly one successful payment then becomes CONSUMED. multi_use accepts multiple payments, optionally up to max_uses.
one_time, multi_use ISO 4217 currency code. Currently supported: PHP.
"PHP"
Total amount in the smallest currency unit. Must equal the sum of all line items (unit_price × quantity).
x >= 1150000
1 to 100 line items.
1 - 100 elementsShow child attributes
Show child attributes
ISO 8601 timestamp. Must be in the future.
"2026-07-18T00:00:00Z"
Required if your API key is scoped to a partner or merchant. Not required for branch-scoped keys.
"SH-ANG-001"
For multi_use only. Omit or set to null for unlimited. Must be greater than 1. Ignored for one_time links.
x >= 210
Free-form text displayed to the customer on the checkout page.
"Order for wireless earbuds"
Your internal order identifier.
100"ORD-2026-0618-001"
URLs to redirect the customer after payment. Each URL must use HTTPS.
Show child attributes
Show child attributes
Key-value pairs for your own use. Max 50 keys, key max 40 characters, value max 500 characters.
Show child attributes
Show child attributes
Response
Payment link created
The payment link object returned by all endpoints.
Show child attributes
Show child attributes
Was this page helpful?