Getting Started
Quickstart
Make your first Elebne API call in 5 minutes. Create a payment intent, simulate a payment, and check the result.
Quickstart
This guide walks you through creating a payment intent, simulating a payment in sandbox mode, and checking the result. You will need about 5 minutes.
Prerequisites
- An Elebne Commerce account (register in the Elebne mobile app)
- API keys (see Step 1 below)
Step 1: Get your API keys
- Open the Elebne mobile app and switch to Commerce mode.
- Go to Commerce > Developer.
- Request API access and wait for admin approval.
- Once approved, you will see your test keys: a publishable key (
pk_test_...) and a secret key (sk_test_...).
Keep your secret key safe
Never expose your sk_test_ or sk_live_ keys in client-side code, public repositories, or logs.
Step 2: Create a payment intent
curl -X POST https://api.elebne.ai/api/v1/dev/intents \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: quickstart-$(date +%s)" \
-d '{
"amount": 50000,
"label": "Commande #1234"
}'const response = await fetch('https://api.elebne.ai/api/v1/dev/intents', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_YOUR_KEY',
'Content-Type': 'application/json',
'X-Idempotency-Key': `quickstart-${Date.now()}`,
},
body: JSON.stringify({
amount: 50000,
label: 'Commande #1234',
}),
});
const data = await response.json();
console.log(data);import requests
import time
response = requests.post(
'https://api.elebne.ai/api/v1/dev/intents',
headers={
'Authorization': 'Bearer sk_test_YOUR_KEY',
'Content-Type': 'application/json',
'X-Idempotency-Key': f'quickstart-{int(time.time())}',
},
json={
'amount': 50000,
'label': 'Commande #1234',
},
)
print(response.json())The response:
{
"success": true,
"data": {
"referenceNumber": "PI-3XXXXXXXXXXXXXX",
"amount": 50000,
"label": "Commande #1234",
"status": "PENDING",
"sandbox": true,
"createdAt": "2026-04-04T10:30:00.000Z"
}
}Save the referenceNumber — you will need it in the next steps.
Step 3: Simulate a payment
In sandbox mode, you can simulate a customer paying without needing a real Elebne wallet.
curl -X POST https://api.elebne.ai/api/v1/dev/intents/PI-3XXXXXXXXXXXXXX/simulate-payment \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "X-Idempotency-Key: sim-$(date +%s)"const response = await fetch(
'https://api.elebne.ai/api/v1/dev/intents/PI-3XXXXXXXXXXXXXX/simulate-payment',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_YOUR_KEY',
'X-Idempotency-Key': `sim-${Date.now()}`,
},
}
);
const data = await response.json();
console.log(data);response = requests.post(
'https://api.elebne.ai/api/v1/dev/intents/PI-3XXXXXXXXXXXXXX/simulate-payment',
headers={
'Authorization': 'Bearer sk_test_YOUR_KEY',
'X-Idempotency-Key': f'sim-{int(time.time())}',
},
)
print(response.json())Step 4: Check the result
curl https://api.elebne.ai/api/v1/dev/intents/PI-3XXXXXXXXXXXXXX \
-H "Authorization: Bearer pk_test_YOUR_KEY"const response = await fetch(
'https://api.elebne.ai/api/v1/dev/intents/PI-3XXXXXXXXXXXXXX',
{
headers: {
'Authorization': 'Bearer pk_test_YOUR_KEY',
},
}
);
const data = await response.json();
console.log(data);response = requests.get(
'https://api.elebne.ai/api/v1/dev/intents/PI-3XXXXXXXXXXXXXX',
headers={
'Authorization': 'Bearer pk_test_YOUR_KEY',
},
)
print(response.json())The status should now be PAID:
{
"success": true,
"data": {
"referenceNumber": "PI-3XXXXXXXXXXXXXX",
"amount": 50000,
"label": "Commande #1234",
"status": "PAID",
"sandbox": true,
"paidAt": "2026-04-04T10:30:05.000Z"
}
}You have just created and completed your first payment intent.
Next steps
- Authentication — Understand key types, scopes, and security
- Sandbox — Test edge cases with magic amounts
- Webhooks — Get notified when payments complete
- Pay API — Full payment integration reference
Was this page helpful?