Payment Intents
Create a payment intent to initiate a transaction. This endpoint must be called from your backend using the Secret Key.
Endpoint
Production Endpoint
Sandbox / Development
Request
http
POST /v1/payment-intents HTTP/1.1
Host: api.artopay.online
Content-Type: application/json
X-Secret-Key: sk_live_xxxxxxxxxxxx
{
"amount": 100000,
"currency": "IDR",
"customerId": "customer_test_123",
"description": "Test payment",
"metadata": {
"order_id": "order_456"
}
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
amount | integer | Yes | Amount in smallest currency unit (e.g. 100000 = IDR 100,000) |
currency | string | Yes | Must be IDR |
description | string | Yes | Human-readable description of the payment |
customerId | string | No | Customer identifier. Required for saved card flows to generate a customerToken |
metadata | object | No | Additional key-value pairs stored alongside the transaction for your reference |
Response
json
{
"amount": 75000,
"clientSecret": "pi_2e718067-a60d-4969-808c-f93458b65b47_secret_llySD6...",
"createdAt": "2026-02-02T04:25:07.617558Z",
"currency": "IDR",
"id": "726f2fec-2431-40cf-b21c-304835e92715",
"metadata": {
"orderId": "order_1"
},
"status": "created"
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique payment intent ID โ pass as paymentId in the SDK |
clientSecret | string | Frontend secret for the SDK โ pass as clientSecret |
amount | integer | Confirmed payment amount |
currency | string | Currency code (e.g. IDR) |
status | string | Initial status: created |
createdAt | string | ISO 8601 creation timestamp |
metadata | object | Echo of the metadata you provided in the request |