Skip to Content

Spectre API — TEST Documentation

Use this page to test the authentication API on the isolated TEST environment.

Test Base URL: https://test.spacto.ly
Module Version: 18.0.1.4.0
This documentation is for TEST only. Do not use the production endpoint for QA.

1. Quick Start

  1. Download and import the Postman Collection.
  2. Download and import the TEST Environment.
  3. Select the imported environment in Postman.
  4. Use a fresh test phone number.
  5. Run the requests in the order shown below.

2. OTP for QA

QA users do not need server access. Authorized testers can open the temporary portal page:

View OTP Codes

The user must have the Spectre Auth Tester access group. The screen is read-only for testers and shows the phone, OTP code, expiry, consumed state, and attempt counters.

3. Full Authentication Flow

# Action Method Endpoint Expected
1RegisterPOST/auth/register200 + OTP metadata
2Verify OTPPOST/auth/verify-otp200 + token pair
3LoginPOST/auth/login200 + token pair
4Refresh TokenPOST/auth/refresh200 + rotated token pair
5Get ProfileGET/auth/profile200 + user
6Update ProfilePUT/auth/profile200 + updated user
7LogoutPOST/auth/logout200 + ok=true

4. Example Register Request

POST /auth/register
Content-Type: application/json

{
  "phoneNumber": "+218912345678",
  "password": "123456"
}

5. Refresh Token

POST /auth/refresh
Content-Type: application/json

{
  "refreshToken": ""
}

Refresh tokens are rotated. After a successful refresh, save both returned tokens. Reusing the old refresh token must return HTTP 401.

6. Negative Test Checklist

CaseExpected
Login with wrong password401
Register invalid phone number400
Register already verified phone409
Profile without Bearer token401
Verify incorrect OTP400
Resend OTP before cooldown429
Refresh with missing token401
Use access token as refresh token401
Reuse rotated refresh token401
Use access token after logout401

7. Completion Checklist

  • Register returns OTP metadata.
  • OTP can be read by an authorized tester from Odoo.
  • OTP verification returns access + refresh tokens.
  • Login succeeds with the verified phone and password.
  • Profile read and update work with the access token.
  • Refresh returns a new token pair and rejects replay of the old refresh token.
  • Logout revokes the current access token.
  • All negative cases return the expected HTTP status.

8. توثيق واجهات Spectre الجديدة — API Inventory

تتضمن الملفات المرفقة Auth وCatalog وCheckout وOrders وWallet وDPay وDriver وDelivery Proof وTracking وInvoice. الأمثلة مخصصة للاختبار اليدوي فقط، وليست شهادة بأن كل مسار يعمل في اختبار تكاملي مكتمل.

نزّل Collection وEnvironment الجديدين من أعلى الصفحة، ثم استورد الملفين معًا إلى Postman. استخدم بيانات اختبار فقط واضبط Token الخاص بدور Customer أو Driver أو Restaurant. بعض عمليات POST المالية والتسليم تحتاج بيانات فعلية داخل نسخة الاختبار.

حالة التكامل: SMS الحقيقي وGateway Payment وFCM وتخزين إثبات التسليم والتتبع الخارجي تتطلب إعدادات ومفاتيح وموافقات منفصلة. لا تفترض أنها مفعلة.

Invoice PDF: GET /api/v1/orders/{id}/invoice.pdf لطلب مدفوع يخص نفس العميل، ثم راجع اتجاه اللغة العربية وخطوط PDF. غير المدفوع يُرفض.

Api Core 8
  • GET /.well-known/jwks.json
  • POST /api/v1/auth/login
  • POST /api/v1/auth/logout
  • GET /api/v1/auth/profile
  • POST /api/v1/auth/refresh
Approval 4
  • GET /api/v1/restaurant/orders/pending
  • GET /api/v1/restaurant/orders/{ident}
  • POST /api/v1/restaurant/orders/{ident}/accept
  • POST /api/v1/restaurant/orders/{ident}/reject
Catalog 8
  • GET /api/v1/catalog/image/{kind}/{ident}
  • GET /api/v1/categories
  • GET /api/v1/home
  • GET /api/v1/products
  • GET /api/v1/products/{product_id}
Checkout 3
  • POST /api/v1/cart/validate
  • POST /api/v1/checkout/quote
  • GET /api/v1/payment-methods
Config Geo 2
  • GET /api/v1/config
  • GET /api/v1/geo/ref-data
Customer Extras 9
  • DELETE /api/v1/favorites
  • GET /api/v1/favorites
  • POST /api/v1/favorites
  • POST /api/v1/feedback
  • GET /api/v1/notifications
Customer Invoice 1
  • GET /api/v1/orders/{ident}/invoice.pdf
Delivery Geo 7
  • GET /api/v1/addresses
  • POST /api/v1/addresses
  • DELETE /api/v1/addresses/{ident}
  • PUT /api/v1/addresses/{ident}
  • PUT /api/v1/addresses/{ident}/default
Delivery Proof 3
  • POST /api/v1/driver/media/upload-tickets
  • POST /api/v1/driver/tasks/{ident}/deliver
  • POST /api/v1/driver/tasks/{ident}/fail
Dpay 5
  • GET /api/v1/wallet/topups/methods
  • GET /api/v1/wallet/topups/{reference}
  • POST /api/v1/wallet/topups/{reference}/check
  • POST /api/v1/wallet/topups/{reference}/start
  • POST /api/v1/wallet/topups/{reference}/verify
Dpay Reconciliation 1
  • GET /api/v1/payments/{reference}/status
Driver Auth 7
  • POST /api/v1/driver/auth/login
  • POST /api/v1/driver/auth/logout
  • POST /api/v1/driver/auth/refresh
  • PUT /api/v1/driver/availability
  • GET /api/v1/driver/me
Driver Finance 5
  • POST /api/v1/driver/cash/remittances
  • POST /api/v1/driver/cash/remittances/{ident}/confirm
  • GET /api/v1/driver/earnings/ledger
  • GET /api/v1/driver/earnings/summary
  • GET /api/v1/driver/warehouses
Driver Offers 4
  • POST /api/v1/driver/heartbeat
  • GET /api/v1/driver/offers/current
  • POST /api/v1/driver/offers/{ident}/accept
  • POST /api/v1/driver/offers/{ident}/reject
Driver Tasks 8
  • GET /api/v1/driver/tasks/active
  • GET /api/v1/driver/tasks/history
  • GET /api/v1/driver/tasks/{ident}
  • POST /api/v1/driver/tasks/{ident}/arrive-store
  • POST /api/v1/driver/tasks/{ident}/head-to-store
Notifications 1
  • POST /api/v1/devices
Order Dpay 6
  • POST /api/v1/orders/{ident}/payments
  • GET /api/v1/orders/{ident}/payments/{reference}
  • POST /api/v1/orders/{ident}/payments/{reference}/check
  • POST /api/v1/orders/{ident}/payments/{reference}/start
  • POST /api/v1/orders/{ident}/payments/{reference}/verify
Orders 5
  • GET /api/v1/orders
  • POST /api/v1/orders
  • GET /api/v1/orders/{ident}
  • POST /api/v1/orders/{ident}/cancel
  • POST /api/v1/orders/{ident}/reorder
Otp Testlog 2
  • POST /api/v1/auth/password/forgot
  • POST /api/v1/auth/password/reset
Profile Contract 1
  • PUT /api/v1/auth/profile
Tracking Grants 2
  • POST /api/v1/driver/tracking/grant
  • POST /api/v1/orders/{ident}/tracking/grant
Wallet 3
  • GET /api/v1/wallet
  • POST /api/v1/wallet/topups
  • GET /api/v1/wallet/transactions

الأمثلة الباقية موجودة داخل Collection. تأكد من HTTP Status وdata/error وtraceId عند الفشل. لا تستخدم Run Collection لتشغيل عمليات إنشاء أو دفع أو تسليم جماعيًا.

SMS note: The TEST environment currently uses SMS Debug mode. A real SMS provider is not part of this test flow yet.