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

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

Create a cart (optionally with lines)

POST/store/v1/carts
  • يدعم Idempotency-Key

Create a cart (optionally with lines). Send X-Customer-Token to link a signed-in customer. The response carries the cart token: send it as X-Cart-Token on every cart request; and the cart's checkout_url, the hosted checkout to send the shopper to.

الترويسات

  • X-Customer-Tokenstring · أو null

    Customer session token

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • linesarray of objects
  • emailstring · أو null
  • localestring · أو null

    The shopper's language for emails, e.g. ar or en. Defaults to the store's.

  • countrystring · أو null

    The country the storefront shows, e.g. AE: the cart prices in its market (currency and prices) until it has a shipping address. Defaults to the primary market.

ما يُرجعه

201 Cart created.

الأخطاء

  • 401unauthenticatedInvalid customer session.
  • 422validation_failedInvalid lines, email or locale.