انتقل إلى المحتوى

لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.

Start checkout

POST/store/v1/carts/{cart_id}/checkout
  • يدعم Idempotency-Key

Pay: holds the stock, freezes the prices and starts the payment. Offline methods and instant approvals return completed with the order; otherwise follow payment.next_action, then call POST /carts/{cart_id}/checkout/confirm.

معاملات المسار

  • cart_idstringمطلوب

    معرّف من نوع cart، مثل cart_01k8qs5s….

الترويسات

  • X-Cart-Tokenstringمطلوب

    The cart's token

  • Idempotency-Keystring

    أرسل المفتاح نفسه لإعادة المحاولة بأمان: تُعاد الإجابة الأولى لمدة ٢٤ ساعة.

  • shop-api-versionYYYY-MM

    الإصدار الذي تُكتب به الإجابة. بدونه يُستخدم الإصدار المثبّت لتطبيقك، وإلا الأحدث.

الجسم

  • payment_account_idstringمطلوب

    From GET /carts/{cart_id}/payment-methods.

  • methodenumمطلوب

    How the customer pays.

    • card
    • mada
    • apple_pay
    • google_pay
    • stc_pay
    • cash_on_delivery
    • bank_transfer
    • gift_card
    • cash
    • card_present
    • on_account
    • mobile_wallet
    • fawry
    • valu
    • sympl
    • souhoola
    • instapay
    • tabby
    • tamara
  • expected_totalobjectمطلوب

    The total the shopper saw and agreed to, required. When the cart now totals something else (a price changed, a code ran out), nothing is charged: 409 total_changed; reload the cart and show the new total.

  • return_urlstring · أو null

    Where the customer comes back after a redirect (3-D Secure, hosted pages). Call POST /carts/{cart_id}/checkout/confirm from there.

ما يُرجعه

200 Where checkout stands.

الأخطاء

  • 404not_foundNo such cart.
  • 409A payment is already in progress, or the cart changed.
  • 422validation_failedSomething is missing (email, address, delivery), an item is unavailable or out of stock, or the payment method isn't offered.