لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.
Complete sale
/ 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 · أو nullTypeID with the
cusprefix.emailstring · أو nullSends the customer the order confirmation, their receipt by email.
phonestring · أو nullThe 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. - 422
validation_failedPayments don't add up, or not enough stock here.