EnglishTürkçe تسجيل الدخول انضم مجاناً
المطورون

اربط نظام ERP لديك بالمنصة

واجهة برمجية (REST API) بسيطة بصيغة JSON لربط VLUERP أو Odoo أو SAP أو Oracle أو Microsoft Dynamics أو أي نظام ERP بالمنصة: مزامنة المنتجات والأسعار برمز الصنف، واستلام طلبات عروض الأسعار وإرسال العروض تلقائياً، وتنبيهات فورية عبر Webhooks.

✓ للمشترين: مجاناً✓ للمصانع: الباقة المميزة✓ Webhooks موقّعة✓ يعمل مع أي نظام ERP

Quick start

  1. Sign in, open API & ERP in your account, and create a key. It looks like mt_1a2b3c4d_… and is shown once.
  2. Check it works:
curl https://mena-trade.com/api/v1/me \
  -H "Authorization: Bearer mt_1a2b3c4d_YOUR_SECRET"

Base URL: https://mena-trade.com/api/v1 · JSON in, JSON out · dates ISO 8601 · prices as numbers.

Who can use it: buyers (free) and factories on the Premium plan. Codes for industries, units, currencies, incoterms and countries come from GET /reference (no key needed).

Authentication

Send the key in every request: Authorization: Bearer mt_… (or X-API-Key: mt_…). Keys belong to your company, can be revoked any time, and are stored only as a hash — we can't show a key again, so create a new one if it's lost.

Errors, limits, paging

HTTP 400
{"error": "invalid", "message": "Some fields are not valid.",
 "fields": {"price_tiers": "Add at least one price tier, or set price_on_request to true."}}
  • Codes: 401 unauthorized, 403 plan_required / plan_limit / wrong_account_type, 404 not_found, 409 conflict / closed, 429 rate_limited.
  • Limit: 120 requests a minute per key (Retry-After header on 429).
  • Lists are paged: ?page=1&page_size=50 (max 100) → {"count", "page", "next_page", "results"}.
  • Incremental sync: ?updated_since=2026-10-01T00:00:00Z on products, requests and quotes.

Products (factories)

The easiest way to keep your catalog in sync is the upsert by item code: PUT /products/sku/{sku} creates the product the first time and updates it after that.

curl -X PUT https://mena-trade.com/api/v1/products/sku/CTN-5PLY-604040 \
  -H "Authorization: Bearer mt_…" -H "Content-Type: application/json" -d '{
  "name_en": "Corrugated carton 5-ply 60x40x40",
  "name_ar": "كرتون مضلع ٥ طبقات ٦٠×٤٠×٤٠",
  "sector": "paper", "unit": "piece", "moq": 1000, "currency": "SAR",
  "price_tiers": [{"min_qty": 1000, "price": 2.40}, {"min_qty": 10000, "price": 2.10}],
  "lead_time_days": 14, "capacity_month": 500000, "hs_code": "481910", "barcode": "6281234567890",
  "units_per_carton": 50, "carton_length_cm": 60, "carton_width_cm": 40, "carton_height_cm": 40,
  "carton_gross_kg": 12.5, "storage": "ambient", "dangerous_goods": false
}'

Add photos (JPG, PNG or WebP, max 5 MB; the number allowed depends on your plan), then publish:

curl -X POST "https://mena-trade.com/api/v1/products/42/images?main=1" \
  -H "Authorization: Bearer mt_…" -F "[email protected]"

curl -X PATCH https://mena-trade.com/api/v1/products/42 \
  -H "Authorization: Bearer mt_…" -H "Content-Type: application/json" -d '{"status": "published"}'

New products start as draft. Publishing needs a photo. Every change is checked by our team against the product listing policy.

Requests for quotation & quotes

Factories — GET /rfqs lists open requests in your industry (and ones sent to you directly). Answer with:

curl -X PUT https://mena-trade.com/api/v1/rfqs/118/quote \
  -H "Authorization: Bearer mt_…" -H "Content-Type: application/json" -d '{
  "unit_price": 2.25, "currency": "SAR", "quantity": 20000, "lead_time_days": 12,
  "incoterm": "DAP", "valid_until": "2026-10-30", "notes": "Price includes 2-colour print."
}'

For requests with several product lines, send "items": [{"item_id": 7, "unit_price": 2.25}, …] instead of unit_price. DELETE /rfqs/{id}/quote withdraws it. The buyer's contact person is included once you have quoted.

Buyers — publish a request from your purchasing module, then accept the best quote:

curl -X POST https://mena-trade.com/api/v1/rfqs -H "Authorization: Bearer mt_…" \
  -H "Content-Type: application/json" -d '{
  "title": "Corrugated cartons 5-ply", "description": "Brown, 60x40x40 cm, 2-colour print",
  "sector": "paper", "quantity": 20000, "unit": "piece", "currency": "SAR",
  "delivery_city": "Riyadh", "closes_on": "2026-10-20"
}'

curl -X POST https://mena-trade.com/api/v1/rfqs/118/accept -H "Authorization: Bearer mt_…" \
  -H "Content-Type: application/json" -d '{"quote_id": 311}'

Add "factory_id": 21 to send a request to one factory only.

Chat

GET  /conversations                       your chats (with unread counts)
POST /conversations   {"rfq_id": 118}     open the chat for a request (buyers add "factory_id")
GET  /conversations/9/messages?after_id=0
POST /conversations/9/messages  {"body": "Can you send a sample?"}

As on the website, phone numbers, emails and links are hidden until the factory has quoted.

Webhooks

Add a public https:// address in your account (or POST /webhooks). We send a JSON POST when:

  • rfq.created — New request for quotation (factories)
  • quote.received — New quote (buyers)
  • quote.accepted — Quote accepted (factories)
  • message.received — New chat message
POST https://erp.example.com/menatrade/webhook
X-MenaTrade-Event: quote.received
X-MenaTrade-Timestamp: 1791240000
X-MenaTrade-Signature: sha256=5d1c…

{"id": "7b0e…", "event": "quote.received", "created_at": "2026-10-06T09:12:03+03:00",
 "data": {"rfq_id": 118, "quote": {"id": 311, "unit_price": 2.25, "currency": "SAR", …}}}

Check the signature with the secret shown when you created the webhook — HMAC-SHA256 of timestamp + "." + raw body:

# Python
import hmac, hashlib
expected = "sha256=" + hmac.new(SECRET.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256).hexdigest()
ok = hmac.compare_digest(expected, request.headers["X-MenaTrade-Signature"])

// Node.js
const expected = "sha256=" + crypto.createHmac("sha256", SECRET).update(ts + "." + rawBody).digest("hex");

Reply with any 2xx within 10 seconds. Failed deliveries are retried twice (after 10 s and 60 s); after 50 failures in a row the webhook is paused. POST /webhooks/{id}/test sends a signed ping.

Endpoint list

MethodPathWhoWhat
GET/meallYour company, plan and key
GET/referencepublicCode lists
GET · POST/productsfactoryList · create
GET · PATCH · DELETE/products/{id}factoryRead · update · delete
GET · PUT/products/sku/{sku}factoryRead · upsert by item code
POST · DELETE/products/{id}/images[/{image_id}]factoryUpload · remove photos
GET · POST/rfqsall · buyerList · publish a request
GET/rfqs/{id}allRequest with items and quotes
PUT · DELETE/rfqs/{id}/quotefactorySend/update · withdraw quote
POST/rfqs/{id}/accept · /closebuyerAccept a quote · close
GET/quotesallQuotes sent or received
GET · POST/conversations[/{id}/messages]allChat
GET · POST · DELETE/webhooks[/{id}[/test]]allWebhooks

تحتاج مساعدة في ربط Odoo أو نظام آخر؟ تواصل معنا.

تواصل معنا