Getting started
Quickstart
From your key to a payment link, a signed webhook and a confirmed transfer.
- Get your API key
Your account must be verified by an official document. In the El-B app, open API and generate your key. It starts with
elb_sk_and is shown once: keep it on your server, never in code that runs in a browser or a mobile app. - Check the key
Read your account: your credits and the limits that apply to you.
curl https://el-b.com/api/v1/account \ -H "Authorization: Bearer $ELB_API_KEY" - Create a payment
Seal what you deliver and where. The answer holds
url: send it to the sender, on the platform where you negotiated.curl -X POST "https://el-b.com/api/v1/payments" \ -H "Authorization: Bearer $ELB_API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "amount_dzd": 45000, "deliverable": "iPhone 13, 128 GB, used", "fulfillment_target": "Hand delivery in Bab Ezzouar, Algiers", "platform": "Facebook Marketplace", "recipient_handle": "Phone Store DZ", "label": "Order #1042", "join_mode": "verified" }'use Illuminate\Support\Facades\Http; $response = Http::withToken(env('ELB_API_KEY')) ->acceptJson() ->post('https://el-b.com/api/v1/payments', [ 'amount_dzd' => 45000, 'deliverable' => 'iPhone 13, 128 GB, used', 'fulfillment_target' => 'Hand delivery in Bab Ezzouar, Algiers', 'platform' => 'Facebook Marketplace', 'recipient_handle' => 'Phone Store DZ', 'label' => 'Order #1042', 'join_mode' => 'verified', ]); $payment = $response->json('data');const response = await fetch('https://el-b.com/api/v1/payments', { method: 'POST', headers: { Authorization: `Bearer ${process.env.ELB_API_KEY}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "amount_dzd": 45000, "deliverable": "iPhone 13, 128 GB, used", "fulfillment_target": "Hand delivery in Bab Ezzouar, Algiers", "platform": "Facebook Marketplace", "recipient_handle": "Phone Store DZ", "label": "Order #1042", "join_mode": "verified" }), }); const { data } = await response.json();import os import requests response = requests.request( "POST", "https://el-b.com/api/v1/payments", headers={"Authorization": f"Bearer {os.environ['ELB_API_KEY']}"}, json={ "amount_dzd": 45000, "deliverable": "iPhone 13, 128 GB, used", "fulfillment_target": "Hand delivery in Bab Ezzouar, Algiers", "platform": "Facebook Marketplace", "recipient_handle": "Phone Store DZ", "label": "Order #1042", "join_mode": "verified", }, ) data = response.json() - Hear back with a webhook
Register an endpoint for the events you need.
payment.reference_submittedtells you the transaction number is in.curl -X POST "https://el-b.com/api/v1/webhooks" \ -H "Authorization: Bearer $ELB_API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "url": "https://shop.example.com/elb/webhooks", "events": [ "payment.reference_submitted", "payment.finalized" ] }'use Illuminate\Support\Facades\Http; $response = Http::withToken(env('ELB_API_KEY')) ->acceptJson() ->post('https://el-b.com/api/v1/webhooks', [ 'url' => 'https://shop.example.com/elb/webhooks', 'events' => [ 'payment.reference_submitted', 'payment.finalized', ], ]); $payment = $response->json('data');const response = await fetch('https://el-b.com/api/v1/webhooks', { method: 'POST', headers: { Authorization: `Bearer ${process.env.ELB_API_KEY}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://shop.example.com/elb/webhooks", "events": [ "payment.reference_submitted", "payment.finalized" ] }), }); const { data } = await response.json();import os import requests response = requests.request( "POST", "https://el-b.com/api/v1/webhooks", headers={"Authorization": f"Bearer {os.environ['ELB_API_KEY']}"}, json={ "url": "https://shop.example.com/elb/webhooks", "events": [ "payment.reference_submitted", "payment.finalized", ], }, ) data = response.json() - Confirm the transfer
Once you see the transfer in your BaridiMob history, confirm it. The payment is complete and its receipt is issued.
curl -X POST "https://el-b.com/api/v1/payments/Kx7pR2mQ9a/confirm" \ -H "Authorization: Bearer $ELB_API_KEY" \ -H "Accept: application/json"use Illuminate\Support\Facades\Http; $response = Http::withToken(env('ELB_API_KEY')) ->acceptJson() ->post('https://el-b.com/api/v1/payments/Kx7pR2mQ9a/confirm'); $payment = $response->json('data');const response = await fetch('https://el-b.com/api/v1/payments/Kx7pR2mQ9a/confirm', { method: 'POST', headers: { Authorization: `Bearer ${process.env.ELB_API_KEY}`, Accept: 'application/json', }, }); const { data } = await response.json();import os import requests response = requests.request( "POST", "https://el-b.com/api/v1/payments/Kx7pR2mQ9a/confirm", headers={"Authorization": f"Bearer {os.environ['ELB_API_KEY']}"}, ) data = response.json()
Next: verify each delivery's signature before trusting it.