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

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

Complete sale

POST/admin/v1/stores/{store_id}/pos/sessions/{session_id}/sales
  • يدعم Idempotency-Key

Takes payment with any of the counter's tenders, places the order (paid, on account, or as a deposit), hands over what is sold here, and returns the receipt. The same sale_id again returns the sale already made. Requires the clerk's unlock.

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

  • store_idstringمطلوب

    معرّف من نوع store، مثل store_01k8qs5s…. يصل إلى التطبيق مع التثبيت، في رابط OAuth وفي رد رمز الوصول.

  • session_idstringمطلوب

    معرّف من نوع pses، مثل pses_01k8qs5s….

الترويسات

  • x-pos-clerkstringمطلوب

    The clerk's unlock

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • linesarray of objectsمطلوب
  • sale_idstringمطلوب

    The sale's own ID, from its first scan: a retry with it returns the sale already made.

  • paymentsarray of object | object | object | object | object | object | object | objectsمطلوب
  • expected_totalintegerمطلوب

    The total the customer was shown, minor units: refused if the price changed since.

  • customer_idstring · أو null

    TypeID with the cus prefix.

  • emailstring · أو null

    Sends the customer the order confirmation, their receipt by email.

  • phonestring · أو null

    The customer's phone, for a walk-in who gives one.

  • discount_codesarray of strings

ما يُرجعه

201 Sold.

الأخطاء

  • 409The session is closed, the total changed, an item can't be sold, a manager must approve (approval_required), or a payment isn't confirmed.
  • 422validation_failedPayments don't add up, or not enough stock here.