Getting started

Quickstart

From zero to a paid order in five minutes: create a key, make a call, place an order and send its payment link.

1. Create an API key

In the dashboard go to Settings → Developers → API keys and click Create key. Give it a name, pick an expiration and choose its permissions. For this guide grant Products: read, Orders: read & write and Payment links: read & write.

The full key (mk_live_...) is shown once. Store it as an environment variable on your server:

export MALLA_API_KEY="mk_live_..."

2. Install the SDK (optional)

Everything works with plain HTTP, but the TypeScript SDK gives you types, retries and pagination for free.

npm install @malla/business

3. Find something to sell

List your active products and pick a variant id. Every product has at least one variant; that's what orders reference.

curl "https://api.malla.fun/products?status=active&limit=3" \
-H "Authorization: Bearer $MALLA_API_KEY"

# Then the product, with its variants:
curl "https://api.malla.fun/products/PRODUCT_ID" \
-H "Authorization: Bearer $MALLA_API_KEY"

4. Place an order

The customer is found by phone, or created. Stock is reserved right away and the order starts as pending.

curl -X POST "https://api.malla.fun/orders" \
-H "Authorization: Bearer $MALLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer": { "phone": "+503 7000 0000", "name": "Ana López" },
"items": [{ "variantId": "VARIANT_ID", "quantity": 2 }]
}'

5. Get paid

Create a payment link for the order and send its url to the customer (by WhatsApp, email or on your site). When they pay, the order becomes paid and you receive an order.paid webhook.

curl -X POST "https://api.malla.fun/payment-links" \
-H "Authorization: Bearer $MALLA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "orderId": "ORDER_ID" }'

Next steps