Skip to main content

Order Confirmation Endpoint

This endpoint handles the final step of the checkout process, confirming the order and processing the wallet payment for authenticated users.

Endpoint

POST /v1/mobile/cart/checkout

Request Parameters

ParameterTypeRequiredDescription
productsarrayYesArray of products to be processed
products.*.with_certificatebooleanNoWhether to include certificate with the product
products.*.with_summarybooleanNoWhether to include summary with the product
paymentbooleanYesMust be set to true for order confirmation
order_confirmedbooleanYesMust be set to true for order confirmation
couponstringNoCoupon code to apply discount
use_new_customer_discountbooleanNoWhether to apply new customer discount
payment_methodstringYesMust be set to wallet

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"cart_items": {
"id": "75fcbd50-0481-11f0-abeb-5f31b6df026e",
"status": "wallet-accepted",
"order_number": 2503202566,
"wallet_balance": 616.05,
},
"discounts": [],
"related_products": []
},
"status_code": 200
}

Implementation Details

Flow

  1. Validates the incoming request parameters
  2. Verifies cart items availability
  3. Validates wallet balance sufficiency
  4. Creates order record in the database
  5. Processes payment through wallet
  6. Returns order details and updated wallet balance

Wallet Payment

  • Wallet is the recommended payment method for mobile checkout
  • System verifies sufficient wallet balance before processing
  • Insufficient balance requires recharge through In-App Purchase
  • Successful payment updates wallet balance and records transaction in history
  • Updated wallet balance is returned in the response

Order Creation

  • Generates unique order number
  • Locks product inventory during order creation
  • Records all applied discounts

Common Error Cases

  • Insufficient wallet balance
  • Product became unavailable

Notes

  • Order confirmation is final and cannot be modified
  • All referral and promo calculations are finalized at this point