curl --request POST \
--url https://api.sbx.moduluslabs.io/ecom/v1/payment-intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 86500,
"currency": "PHP",
"description": "Order #1234",
"metadata": {
"order_id": "1234"
}
}
'import requests
url = "https://api.sbx.moduluslabs.io/ecom/v1/payment-intents"
payload = {
"amount": 86500,
"currency": "PHP",
"description": "Order #1234",
"metadata": { "order_id": "1234" }
}
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: 86500,
currency: 'PHP',
description: 'Order #1234',
metadata: {order_id: '1234'}
})
};
fetch('https://api.sbx.moduluslabs.io/ecom/v1/payment-intents', 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/payment-intents",
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' => 86500,
'currency' => 'PHP',
'description' => 'Order #1234',
'metadata' => [
'order_id' => '1234'
]
]),
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.sbx.moduluslabs.io/ecom/v1/payment-intents"
payload := strings.NewReader("{\n \"amount\": 86500,\n \"currency\": \"PHP\",\n \"description\": \"Order #1234\",\n \"metadata\": {\n \"order_id\": \"1234\"\n }\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.sbx.moduluslabs.io/ecom/v1/payment-intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 86500,\n \"currency\": \"PHP\",\n \"description\": \"Order #1234\",\n \"metadata\": {\n \"order_id\": \"1234\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.sbx.moduluslabs.io/ecom/v1/payment-intents");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"amount\": 86500,\n \"currency\": \"PHP\",\n \"description\": \"Order #1234\",\n \"metadata\": {\n \"order_id\": \"1234\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "b7e2c1a4-9f3d-4c6b-8a21-5e0f7d9c3b18",
"client_secret": "3f9a6d2e-7c14-4b8f-a5d0-1e6c2b9f4a73",
"amount": 86500,
"currency": "PHP",
"status": "ACTIVE",
"expires_at": "2026-09-04T12:00:00Z"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}Create Payment Intent
Create a payment intent on your server, then confirm it in the browser with the JavaScript SDK
curl --request POST \
--url https://api.sbx.moduluslabs.io/ecom/v1/payment-intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 86500,
"currency": "PHP",
"description": "Order #1234",
"metadata": {
"order_id": "1234"
}
}
'import requests
url = "https://api.sbx.moduluslabs.io/ecom/v1/payment-intents"
payload = {
"amount": 86500,
"currency": "PHP",
"description": "Order #1234",
"metadata": { "order_id": "1234" }
}
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: 86500,
currency: 'PHP',
description: 'Order #1234',
metadata: {order_id: '1234'}
})
};
fetch('https://api.sbx.moduluslabs.io/ecom/v1/payment-intents', 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/payment-intents",
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' => 86500,
'currency' => 'PHP',
'description' => 'Order #1234',
'metadata' => [
'order_id' => '1234'
]
]),
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.sbx.moduluslabs.io/ecom/v1/payment-intents"
payload := strings.NewReader("{\n \"amount\": 86500,\n \"currency\": \"PHP\",\n \"description\": \"Order #1234\",\n \"metadata\": {\n \"order_id\": \"1234\"\n }\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.sbx.moduluslabs.io/ecom/v1/payment-intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 86500,\n \"currency\": \"PHP\",\n \"description\": \"Order #1234\",\n \"metadata\": {\n \"order_id\": \"1234\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.sbx.moduluslabs.io/ecom/v1/payment-intents");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"amount\": 86500,\n \"currency\": \"PHP\",\n \"description\": \"Order #1234\",\n \"metadata\": {\n \"order_id\": \"1234\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "b7e2c1a4-9f3d-4c6b-8a21-5e0f7d9c3b18",
"client_secret": "3f9a6d2e-7c14-4b8f-a5d0-1e6c2b9f4a73",
"amount": 86500,
"currency": "PHP",
"status": "ACTIVE",
"expires_at": "2026-09-04T12:00:00Z"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}{
"code": "INVALID_CURRENCY",
"message": "<string>",
"request_id": "<string>"
}201 Created with the intent id and client_secret. Hand both to the JavaScript SDK to render the card fields and confirm the payment. Card data is never sent to this endpoint.Authentication
This is a server-side endpoint. Send your secret key as an HTTP Bearer token:Authorization: Bearer sk_test_...
pk_) instead, scoped to this intent by its client_secret.
Amounts
amount is an integer in the currency’s smallest unit (for PHP, centavos). For example, 86500 is PHP 865.00. Valid range is 1 to 99999999.
Expiry
expires_in_minutes controls how long the intent stays payable if the customer does not confirm. It defaults to 1440 (24 hours), with a minimum of 5 and a maximum of 10080 (7 days). After it lapses, the intent’s status becomes EXPIRED. Create a fresh intent and re-mount the SDK.
Authorizations
Server-side secret key (sk_) as an HTTP Bearer token: Authorization: Bearer sk_.... Creates payment intents. Never expose the secret key in a browser or mobile app.
Body
Amount to charge in the currency's smallest unit (for PHP, centavos). 86500 = PHP 865.00. Integer, range 1 to 99,999,999.
1 <= x <= 9999999986500
ISO 4217 currency code: a string of exactly 3 uppercase letters (for example, PHP). Must be a currency enabled for your account.
3^[A-Z]{3}$Human-readable label, echoed back on the receipt. Optional; this endpoint imposes no length limit.
"Order #1234"
Minutes the intent stays payable if unconfirmed. Integer, 5 to 10080 (7 days). Default 1440 (24 hours).
5 <= x <= 100801440
Free-form string key/value pairs stored with the intent. This endpoint imposes no key-count, length, or size limits.
Show child attributes
Show child attributes
Response
Payment intent created.
Unique payment intent identifier (UUID v7). Pass this to the SDK.
"b7e2c1a4-9f3d-4c6b-8a21-5e0f7d9c3b18"
Client secret that authorizes confirming this one intent. Pass it to the SDK with id. Keep it out of logs and URLs.
Amount in the smallest currency unit.
86500
ISO 4217 currency code.
"PHP"
Always ACTIVE on create.
ACTIVE RFC 3339 UTC timestamp when the intent stops being payable.
"2026-09-04T12:00:00Z"
Was this page helpful?