Quickstart
Only four steps to run your first test payment in the Sandbox.
- 1
Create merchant account
Submit your details in the dashboard and pass KYC review.
- 2
Get API keys
Create a test key (sk_test_*) in Developer Settings for the Sandbox.
- 3
Create a test payment
Call the payments API with your sandbox key.
- 4
Set up webhooks
Configure a webhook URL to listen for payment results and status changes.
Example: create a payment
cURLcurl
curl -X POST https://api.ledepay.com/v1/payments \
-H "Authorization: Bearer sk_test_xxxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"currency": "CNY",
"capture": true,
"description": "Order #1001"
}'TypeScriptcurl
import LedePay from "@ledepay/sdk";
const client = new LedePay("sk_test_xxxx");
const payment = await client.payments.create({
amount: 100,
currency: "CNY",
description: "Order #1001",
});
console.log(payment.id); // pi_xxx
console.log(payment.status); // requires_payment_method
The response field id is the unique identifier of the payment object. Use it for refunds and queries.