{"openapi":"3.1.0","info":{"title":"API de integração com o ERP","version":"1","description":"Eventos de venda do caixa para o tablet integrado e consultas do ERP. Guia completo em docs/integracao-erp.md."},"servers":[{"url":"https://api.smiloo.io"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Chave de API da loja, criada no Portal em Integração com o ERP: `smk_live_{prefixo}_{segredo}`."}},"schemas":{"ErpEvent":{"anyOf":[{"oneOf":[{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.started"},"data":{"type":"object","properties":{"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"askSeller":{"type":"boolean"}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.snapshot"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"askSeller":{"type":"boolean"},"items":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":10},"unitPriceCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["itemId","name","quantity","unit","unitPriceCents","totalCents"]}}},"required":["subtotalCents","discountCents","totalCents","items"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.item_added"},"data":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":10},"unitPriceCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["itemId","name","quantity","unit","unitPriceCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.item_cancelled"},"data":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100}},"required":["itemId"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.totals_updated"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["subtotalCents","discountCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.totalized"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"ratingWaitSeconds":{"type":"integer","minimum":0,"maximum":120}},"required":["subtotalCents","discountCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.back_to_items"},"data":{"type":"object","properties":{}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.method_selected"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"amountCents":{"type":"integer","minimum":0,"maximum":2000000000}},"required":["method","amountCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.pix_requested"},"data":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":2000000000},"pixPayload":{"type":"string","minLength":1,"maxLength":1000},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["amountCents","pixPayload","expiresAt"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.confirmed"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"amountCents":{"type":"integer","minimum":0,"maximum":2000000000}},"required":["method","amountCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.failed"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"reason":{"type":"string","maxLength":200}},"required":["method"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.finished"},"data":{"type":"object","properties":{"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]},"sellers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"amountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["erpCode","name"]}},"operation":{"type":"string","enum":["sale","quote","credit_payment"]}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.cancelled"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["abandoned","quote","return"]}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"staff.ask"},"data":{"type":"object","properties":{"functionIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"staff.confirm"},"data":{"type":"object","properties":{"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]}},"required":["seller"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.customer_changed"},"data":{"type":"object","properties":{"customer":{"anyOf":[{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},{"type":"null"}]}},"required":["customer"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.parked"},"data":{"default":{},"type":"object","properties":{}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type"]}]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","const":"sale.voided"},"saleId":{"type":"string","minLength":1,"maxLength":100},"data":{"type":"object","properties":{"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]}}}},"required":["eventId","occurredAt","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","const":"sale.recorded"},"saleId":{"type":"string","minLength":1,"maxLength":100},"data":{"type":"object","properties":{"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"sellers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"amountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["erpCode","name"]}},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]}},"required":["operation","totalCents"]}},"required":["eventId","occurredAt","type","saleId","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["register.opened","register.closed"]},"deviceId":{"type":"string","minLength":1,"maxLength":100},"data":{"default":{},"type":"object","properties":{}}},"required":["eventId","occurredAt","type","deviceId"]}]},"ErpEventsRequest":{"anyOf":[{"anyOf":[{"oneOf":[{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.started"},"data":{"type":"object","properties":{"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"askSeller":{"type":"boolean"}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.snapshot"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"askSeller":{"type":"boolean"},"items":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":10},"unitPriceCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["itemId","name","quantity","unit","unitPriceCents","totalCents"]}}},"required":["subtotalCents","discountCents","totalCents","items"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.item_added"},"data":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":10},"unitPriceCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["itemId","name","quantity","unit","unitPriceCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.item_cancelled"},"data":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100}},"required":["itemId"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.totals_updated"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["subtotalCents","discountCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.totalized"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"ratingWaitSeconds":{"type":"integer","minimum":0,"maximum":120}},"required":["subtotalCents","discountCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.back_to_items"},"data":{"type":"object","properties":{}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.method_selected"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"amountCents":{"type":"integer","minimum":0,"maximum":2000000000}},"required":["method","amountCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.pix_requested"},"data":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":2000000000},"pixPayload":{"type":"string","minLength":1,"maxLength":1000},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["amountCents","pixPayload","expiresAt"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.confirmed"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"amountCents":{"type":"integer","minimum":0,"maximum":2000000000}},"required":["method","amountCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.failed"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"reason":{"type":"string","maxLength":200}},"required":["method"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.finished"},"data":{"type":"object","properties":{"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]},"sellers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"amountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["erpCode","name"]}},"operation":{"type":"string","enum":["sale","quote","credit_payment"]}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.cancelled"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["abandoned","quote","return"]}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"staff.ask"},"data":{"type":"object","properties":{"functionIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"staff.confirm"},"data":{"type":"object","properties":{"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]}},"required":["seller"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.customer_changed"},"data":{"type":"object","properties":{"customer":{"anyOf":[{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},{"type":"null"}]}},"required":["customer"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.parked"},"data":{"default":{},"type":"object","properties":{}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type"]}]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","const":"sale.voided"},"saleId":{"type":"string","minLength":1,"maxLength":100},"data":{"type":"object","properties":{"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]}}}},"required":["eventId","occurredAt","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","const":"sale.recorded"},"saleId":{"type":"string","minLength":1,"maxLength":100},"data":{"type":"object","properties":{"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"sellers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"amountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["erpCode","name"]}},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]}},"required":["operation","totalCents"]}},"required":["eventId","occurredAt","type","saleId","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["register.opened","register.closed"]},"deviceId":{"type":"string","minLength":1,"maxLength":100},"data":{"default":{},"type":"object","properties":{}}},"required":["eventId","occurredAt","type","deviceId"]}]},{"type":"object","properties":{"events":{"minItems":1,"maxItems":100,"type":"array","items":{"anyOf":[{"oneOf":[{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.started"},"data":{"type":"object","properties":{"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"askSeller":{"type":"boolean"}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.snapshot"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"askSeller":{"type":"boolean"},"items":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":10},"unitPriceCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["itemId","name","quantity","unit","unitPriceCents","totalCents"]}}},"required":["subtotalCents","discountCents","totalCents","items"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.item_added"},"data":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":10},"unitPriceCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["itemId","name","quantity","unit","unitPriceCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.item_cancelled"},"data":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100}},"required":["itemId"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.totals_updated"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["subtotalCents","discountCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.totalized"},"data":{"type":"object","properties":{"subtotalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"discountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"ratingWaitSeconds":{"type":"integer","minimum":0,"maximum":120}},"required":["subtotalCents","discountCents","totalCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.back_to_items"},"data":{"type":"object","properties":{}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.method_selected"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"amountCents":{"type":"integer","minimum":0,"maximum":2000000000}},"required":["method","amountCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.pix_requested"},"data":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":2000000000},"pixPayload":{"type":"string","minLength":1,"maxLength":1000},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["amountCents","pixPayload","expiresAt"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.confirmed"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"amountCents":{"type":"integer","minimum":0,"maximum":2000000000}},"required":["method","amountCents"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"payment.failed"},"data":{"type":"object","properties":{"method":{"type":"string","enum":["pix","credit","debit","cash","voucher","store_credit","other"]},"reason":{"type":"string","maxLength":200}},"required":["method"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.finished"},"data":{"type":"object","properties":{"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]},"sellers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"amountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["erpCode","name"]}},"operation":{"type":"string","enum":["sale","quote","credit_payment"]}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.cancelled"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["abandoned","quote","return"]}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"staff.ask"},"data":{"type":"object","properties":{"functionIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"staff.confirm"},"data":{"type":"object","properties":{"seller":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]}},"required":["seller"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.customer_changed"},"data":{"type":"object","properties":{"customer":{"anyOf":[{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},{"type":"null"}]}},"required":["customer"]}},"required":["eventId","occurredAt","deviceId","saleId","seq","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deviceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"saleId":{"type":"string","minLength":1,"maxLength":100},"seq":{"type":"integer","minimum":1,"maximum":1000000},"type":{"type":"string","const":"sale.parked"},"data":{"default":{},"type":"object","properties":{}}},"required":["eventId","occurredAt","deviceId","saleId","seq","type"]}]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","const":"sale.voided"},"saleId":{"type":"string","minLength":1,"maxLength":100},"data":{"type":"object","properties":{"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]}}}},"required":["eventId","occurredAt","type","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","const":"sale.recorded"},"saleId":{"type":"string","minLength":1,"maxLength":100},"data":{"type":"object","properties":{"operation":{"type":"string","enum":["sale","quote","credit_payment"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"totalCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000},"cashier":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]},"sellers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120},"amountCents":{"type":"integer","minimum":-2000000000,"maximum":2000000000}},"required":["erpCode","name"]}},"customer":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":60},"phone":{"type":"string","minLength":4,"maxLength":30},"locale":{"type":"string","minLength":2,"maxLength":10}}},"serviceType":{"type":"string","minLength":1,"maxLength":40},"document":{"type":"object","properties":{"kind":{"type":"string","enum":["order","nfce","nfe","other"]},"number":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","number"]}},"required":["operation","totalCents"]}},"required":["eventId","occurredAt","type","saleId","data"]},{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":100},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["register.opened","register.closed"]},"deviceId":{"type":"string","minLength":1,"maxLength":100},"data":{"default":{},"type":"object","properties":{}}},"required":["eventId","occurredAt","type","deviceId"]}]}}},"required":["events"]}]},"ErpEventsResult":{"type":"object","properties":{"accepted":{"type":"array","items":{"type":"string"}},"duplicates":{"type":"array","items":{"type":"string"}},"rejected":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":["string","null"]},"error":{"type":"string","enum":["VALIDATION_ERROR","DEVICE_NOT_FOUND","SALE_NOT_FOUND"]},"path":{"type":"string"}},"required":["eventId","error"],"additionalProperties":false}}},"required":["accepted","duplicates","rejected"],"additionalProperties":false},"ErpDeviceList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"place":{"type":["string","null"]},"online":{"type":"boolean"}},"required":["id","name","place","online"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ErpServiceTypeList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"main":{"type":"boolean"}},"required":["code","name","main"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ErpStaffList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"erpCode":{"type":["string","null"]},"status":{"type":"string","enum":["active","away","inactive"]},"functionIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","name","erpCode","status","functionIds"],"additionalProperties":false}},"functions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["items","functions"],"additionalProperties":false},"ErpCustomersRequest":{"type":"object","properties":{"customers":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":40},"name":{"type":"string","maxLength":120},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"birthDate":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"blocks":{"type":"object","properties":{"coupons":{"default":false,"type":"boolean"},"offers":{"default":false,"type":"boolean"},"notices":{"default":false,"type":"boolean"}}}},"required":["erpCode"]}}},"required":["customers"]},"ErpCustomersResult":{"type":"object","properties":{"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string"},"reason":{"type":"string","enum":["invalid_phone"]}},"required":["erpCode","reason"],"additionalProperties":false}}},"required":["received","saved","skipped"],"additionalProperties":false},"ErpUsersRequest":{"type":"object","properties":{"users":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"erpCode":{"type":"string","minLength":1,"maxLength":40},"name":{"type":"string","minLength":1,"maxLength":120},"login":{"type":"string","minLength":1,"maxLength":120}},"required":["erpCode","name"]}},"noSellerErpCode":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]}},"required":["users"]},"ErpUsersResult":{"type":"object","properties":{"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["received"],"additionalProperties":false},"ErpSaleRating":{"type":"object","properties":{"saleId":{"type":"string"},"voided":{"type":"boolean"},"rating":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"score":{"type":"integer","minimum":1,"maximum":5},"createdAt":{"type":"string"},"completed":{"type":"boolean"},"staff":{"type":"array","items":{"type":"object","properties":{"staffMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"erpCode":{"type":["string","null"]},"name":{"type":"string"},"stars":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]}},"required":["staffMemberId","erpCode","name","stars"],"additionalProperties":false}}},"required":["id","score","createdAt","completed","staff"],"additionalProperties":false},{"type":"null"}]}},"required":["saleId","voided","rating"],"additionalProperties":false},"ErpSaleChoice":{"type":"object","properties":{"saleId":{"type":"string"},"score":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"ratedAt":{"type":["string","null"]},"answer":{"anyOf":[{"type":"string","enum":["picked","confirmed","rejected","unknown"]},{"type":"null"}]},"seller":{"anyOf":[{"type":"object","properties":{"erpCode":{"type":["string","null"]},"name":{"type":"string"}},"required":["erpCode","name"],"additionalProperties":false},{"type":"null"}]},"answeredAt":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"answer":{"type":"string","enum":["picked","confirmed","rejected","unknown"]},"seller":{"anyOf":[{"type":"object","properties":{"erpCode":{"type":["string","null"]},"name":{"type":"string"}},"required":["erpCode","name"],"additionalProperties":false},{"type":"null"}]},"at":{"type":"string"}},"required":["answer","seller","at"],"additionalProperties":false}}},"required":["saleId","score","ratedAt","answer","seller","answeredAt","history"],"additionalProperties":false},"ErpSaleOutcomeList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"saleId":{"type":"string"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"rating":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"score":{"type":"integer","minimum":1,"maximum":5},"completed":{"type":"boolean"}},"required":["id","score","completed"],"additionalProperties":false},{"type":"null"}]},"seller":{"anyOf":[{"type":"object","properties":{"erpCode":{"type":["string","null"]},"name":{"type":"string"}},"required":["erpCode","name"],"additionalProperties":false},{"type":"null"}]}},"required":["saleId","version","rating","seller"],"additionalProperties":false}},"more":{"type":"boolean"}},"required":["items","more"],"additionalProperties":false},"ErpSaleOutcomeAckRequest":{"type":"object","properties":{"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"saleId":{"type":"string","minLength":1,"maxLength":100},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"sellerErpCode":{"type":"string","minLength":1,"maxLength":100}},"required":["saleId","version"]}}},"required":["items"]},"ErpSaleOutcomeAckResult":{"type":"object","properties":{"acked":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["acked"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}},"paths":{"/v1/erp/events":{"post":{"summary":"Envia eventos de venda","description":"Um evento ou `{ events: [...] }` com até 100. Cada evento é validado sozinho: a resposta separa aceitos, repetidos (mesmo `eventId`) e recusados. 600 por minuto por chave.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpEventsRequest"}}}},"responses":{"200":{"description":"Resultado de cada evento.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpEventsResult"}}}},"400":{"description":"Corpo inválido ou lote grande demais (`VALIDATION_ERROR`, `BATCH_TOO_LARGE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/devices":{"get":{"summary":"Lista os tablets integrados da loja","description":"O ERP escolhe em qual tablet cada caixa mostra a venda. 120 por minuto.","responses":{"200":{"description":"Tablets integrados pareados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpDeviceList"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/service-types":{"get":{"summary":"Lista os tipos de atendimento da loja","description":"Tipos ativos, com o código que vai em `serviceType` na venda (a venda e o recebimento do crediário podem usar tipos diferentes). Loja sem tipos: lista vazia. 120 por minuto.","responses":{"200":{"description":"Tipos de atendimento ativos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpServiceTypeList"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/staff":{"get":{"summary":"Lista a equipe e as funções","description":"Equipe sem os inativos, com o código do ERP, e as funções ativas (para o `staff.ask`). 120 por minuto.","responses":{"200":{"description":"Equipe e funções.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpStaffList"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/users":{"put":{"summary":"Envia os usuários do ERP","description":"Todos os usuários atuais da loja no ERP (até 1000); a lista inteira substitui a anterior. `erpCode` é o id que nunca muda no ERP e é o mesmo código usado no vendedor da venda. No Portal, o lojista liga cada pessoa da equipe a um usuário pelo nome. Envie quando um usuário for criado, renomeado ou apagado. `noSellerErpCode`: o usuário que a loja usa para \"venda sem vendedor\" (fica fora de `users`); as vendas dele entram como vendas sem vendedor e ficam fora do ranking. `null` quando a loja não usa; sem o campo, fica o que estava. 30 por minuto.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpUsersRequest"}}}},"responses":{"200":{"description":"Quantos usuários ficaram na lista.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpUsersResult"}}}},"400":{"description":"Corpo inválido, como um `erpCode` repetido (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/customers":{"post":{"summary":"Envia a base de clientes do ERP","description":"Clientes do ERP em lotes de até 1000. No começo da integração, mande a base inteira; depois, só quem foi criado ou mudou. Cada cliente é gravado pelo `erpCode` (o código que nunca muda): mandar de novo atualiza. `phone` vai como está no ERP; a API põe no formato internacional pelo país da loja, e quem fica sem celular válido volta em `skipped`. `active: false` é o cliente inativo no ERP: ele fica fora das campanhas, a menos que a loja inclua os inativos, e das automáticas. `blocks` são os bloqueios marcados no ERP (cupons, ofertas, comunicados). `birthDate` em AAAA-MM-DD; uma data inválida vale como vazia. 60 por minuto.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpCustomersRequest"}}}},"responses":{"200":{"description":"Quantos chegaram, quantos foram gravados e quem ficou de fora.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpCustomersResult"}}}},"400":{"description":"Corpo inválido, como um `erpCode` repetido ou mais clientes que o limite (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/sales/outcomes":{"get":{"summary":"Fila de resultados das vendas concluídas","description":"Para o ERP conciliar cada venda com a avaliação, sem prazo. Toda venda concluída entra na fila uma vez, mesmo sem avaliação (`rating: null`), e volta, com `version` maior, sempre que a avaliação ou o vendedor escolhido pelo cliente mudar, a qualquer tempo. `seller` é o vendedor que vale para o cliente (`null`: ele não escolheu, recusou ou não lembra; o ERP não mexe no vendedor). O item fica na fila até o ERP confirmar em `/v1/erp/sales/outcomes/ack`. Da concluída há mais tempo para a mais nova; `more` avisa que ficou item para a próxima consulta. 300 por minuto.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Os resultados que o ERP ainda não confirmou.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSaleOutcomeList"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/sales/outcomes/ack":{"post":{"summary":"Confirma os resultados que o ERP já gravou","description":"Até 100 por envio, cada um com a `version` recebida: se a venda mudou depois dela, continua na fila. `sellerErpCode` vai quando o ERP trocou o vendedor da venda para esse código por causa do resultado; o Portal passa a mostrar o mesmo vendedor do ERP. Venda desconhecida é ignorada. Pode repetir sem efeito. 300 por minuto.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSaleOutcomeAckRequest"}}}},"responses":{"200":{"description":"Quantas vendas saíram da fila.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSaleOutcomeAckResult"}}}},"400":{"description":"Corpo inválido (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/sales/{saleId}/rating":{"get":{"summary":"Avaliação de uma venda","description":"Pelo id da venda no ERP. Se o cliente refez a avaliação pelo QR do agradecimento, vem a que vale. `rating` é `null` quando a venda não teve avaliação. O `id` vem já no toque da carinha, com a venda em digitação; `completed` vira `true` quando o cliente termina, mesmo depois da conclusão, ou 10 minutos depois dela. 120 por minuto.","parameters":[{"name":"saleId","in":"path","required":true,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"A venda e a avaliação dela.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSaleRating"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Venda não encontrada nesta loja (`SALE_NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/erp/sales/{saleId}/choice":{"get":{"summary":"Quem atendeu, escolhido no tablet durante a venda","description":"O que o cliente já respondeu no tablet, na hora do toque: a nota e quem atendeu. `answer`: `null` (ainda não respondeu), `picked` (escolheu na lista), `confirmed` (disse \"Sim\" ao `staff.confirm`) ou `unknown` (não lembra; o operador digita). `seller.erpCode` é `null` quando a pessoa não tem código do ERP. Consulte a cada 1 s só durante a espera. 600 por minuto, separado das outras rotas.","parameters":[{"name":"saleId","in":"path","required":true,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"A resposta do cliente até agora.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSaleChoice"}}}},"401":{"description":"Chave ausente, fora do formato, revogada ou vencida (`API_KEY_INVALID`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Venda não encontrada nesta loja (`SALE_NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"O plano da loja não inclui o tablet integrado (`PLAN_FEATURE_LOCKED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de requisições por minuto da chave (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}