{"swagger":"2.0","info":{"version":"1","title":"A4R Api"},"host":"localhost:60123","schemes":["http"],"paths":{"/api/{version}/customer":{"post":{"tags":["Customer"],"operationId":"Customer_Post","consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"produces":["application/json","text/json","application/xml","text/xml"],"parameters":[{"name":"resource","in":"body","required":true,"schema":{"$ref":"#/definitions/CustomerDto"}},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"object"}},"201":{"description":"Creates a new customer and returns its representation.","schema":{"$ref":"#/definitions/CustomerDto"}},"400":{"description":"BadRequest"}}}},"/api/{version}/customer/{accountNumber}":{"get":{"tags":["Customer"],"operationId":"Customer_Get","consumes":[],"produces":["application/json","text/json"],"parameters":[{"name":"accountNumber","in":"path","required":true,"type":"string"},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Allows to search for a specific customer. At the moment the only available query parameter is the email.","schema":{"$ref":"#/definitions/CustomerDto"}},"404":{"description":"NotFound"}}},"delete":{"tags":["Customer"],"operationId":"Customer_Delete","consumes":[],"produces":["application/json"],"parameters":[{"name":"accountNumber","in":"path","required":true,"type":"string"},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Deletes the customer."},"404":{"description":"NotFound"}}},"patch":{"tags":["Customer"],"operationId":"Customer_Patch","consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"produces":["application/json","text/json","application/xml","text/xml"],"parameters":[{"name":"accountNumber","in":"path","required":true,"type":"string"},{"name":"resource","in":"body","required":true,"schema":{"$ref":"#/definitions/CustomerDto"}},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Patches the customer and returns an updated representation.","schema":{"$ref":"#/definitions/CustomerDto"}},"400":{"description":"BadRequest"}}}},"/api/{version}/voucher":{"post":{"tags":["Voucher"],"operationId":"Voucher_Post","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"resource","in":"body","required":true,"schema":{"$ref":"#/definitions/VoucherDto"}},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"object"}},"201":{"description":"Creates a new customer and returns its representation.","schema":{"$ref":"#/definitions/VoucherDto"}},"400":{"description":"BadRequest"}}}},"/api/{version}/voucher/{voucherGuid}":{"get":{"tags":["Voucher"],"operationId":"Voucher_Get","consumes":[],"produces":["application/json"],"parameters":[{"name":"voucherGuid","in":"path","required":true,"type":"string"},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Allows to search for a specific voucher. At the moment the only available query parameter is the email.","schema":{"$ref":"#/definitions/VoucherDto"}},"404":{"description":"NotFound"}}},"patch":{"tags":["Voucher"],"operationId":"Voucher_Patch","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"voucherGuid","in":"path","required":true,"type":"string"},{"name":"resource","in":"body","required":true,"schema":{"$ref":"#/definitions/VoucherDto"}},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Patches the customer and returns an updated representation.","schema":{"$ref":"#/definitions/VoucherDto"}},"400":{"description":"BadRequest"}}}},"/api/{version}/ticket":{"post":{"tags":["Ticket"],"operationId":"Ticket_Post","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"resource","in":"body","required":true,"schema":{"$ref":"#/definitions/TicketDto"}},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"object"}},"201":{"description":"Creates a new ticket.","schema":{"$ref":"#/definitions/TicketDto"}},"400":{"description":"BadRequest"}}}},"/api/{version}/Ticket/{ticketGuid}":{"get":{"tags":["Ticket"],"operationId":"Ticket_Get","consumes":[],"produces":["application/json"],"parameters":[{"name":"ticketGuid","in":"path","required":true,"type":"string"},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Allows to search for a specific Ticket.","schema":{"$ref":"#/definitions/TicketDto"}},"404":{"description":"NotFound"}}},"patch":{"tags":["Ticket"],"operationId":"Ticket_Patch","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"ticketGuid","in":"path","required":true,"type":"string"},{"name":"resource","in":"body","required":true,"schema":{"$ref":"#/definitions/TicketDto"}},{"name":"version","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Patches the ticket and returns an updated representation.","schema":{"$ref":"#/definitions/TicketDto"}},"400":{"description":"BadRequest"}}}}},"definitions":{"CustomerDto":{"type":"object","properties":{"accountNumber":{"format":"int64","description":"The identifier of the customer across the entire Cisalfa infrastructure.\r\nIt's a long int (BigInt on database).","type":"integer"},"status":{"description":"The status of the customer.","type":"string"},"firstName":{"description":"The first name of the customer.","type":"string"},"lastName":{"description":"The last name of the customer.","type":"string"},"birthPlace":{"description":"The place of birth of the customer.","type":"string"},"birthDate":{"format":"date","description":"The date of birth of the customer.\r\nIt will be treated like a date (eg: 11/10/1990); time and timezone are not important.","type":"string"},"gender":{"description":"The gender of the customer.","type":"string","maxLength":1},"email":{"description":"The email address of the customer.","type":"string"},"mobilePhone":{"description":"The mobile phone number of the customer.","type":"string"},"fiscalNumber":{"description":"The fiscal number of the customer.","type":"string"},"vatNumber":{"description":"The IVA number of the customer.","type":"string"},"street":{"description":"The street name and civic number the customer lives at (eg: Via Bionda, 1000).","type":"string"},"zip":{"description":"The postal code of the city the customer lives in (eg: 47822).","type":"string"},"city":{"description":"The city the customer lives in (eg: Lugo).","type":"string"},"province":{"description":"The province the customer lives in (eg: Ravenna).","type":"string"},"region":{"description":"The region the customer lives in (eg: Emilia Romagna).","type":"string"},"country":{"description":"The country the customer lives in (eg: Italy).","type":"string"},"privacyMarketing":{"description":"The preference of the customer in terms of marketing communications.","type":"boolean"},"privacyProfiling":{"description":"The preference of the customer in terms of profiling actions.","type":"boolean"},"posSysId":{"format":"uuid","description":"The identifier of the customer on the All4Retail system.","type":"string","example":"00000000-0000-0000-0000-000000000000"},"posSysCreatedDate":{"format":"date-time","description":"The date the customer was created on the All4Retail system.","type":"string"},"posSysModifiedDate":{"format":"date-time","description":"The most recent date the customer was modified on the All4Retail system.","type":"string"},"posSysRegistrationDate":{"format":"date-time","description":"The date the customer was registered on the All4Retail system.","type":"string"},"loyaltyPoint":{"description":"The date the customer was registered on the All4Retail system.","type":"string"}}},"VoucherDto":{"type":"object","properties":{"voucherEan13":{"description":"Voucher number (not unique)","type":"string"},"storeCode":{"format":"uuid","description":"Guid store code","type":"string"},"cashDeskCode":{"format":"uuid","description":"Guid Cash Desk code","type":"string"},"folderId":{"format":"uuid","description":"Promotion code that origin this Voucher","type":"string"},"accountNumber":{"description":"Master Customer number","type":"integer"},"cardNumber":{"description":"Master Card Number","type":"string"},"voucherAmount":{"description":"Total Amount of Voucher","type":"number","multipleOf":0.01},"usedAmount":{"description":"Used Amount of Voucher","type":"number","multipleOf":0.01},"voucherMaxAmount":{"description":"Voucher used on a ticket of maximun xxx","type":"number","multipleOf":0.01},"type":{"format":"uuid","description":"type of Voucher","type":"string","example":["00000000-0000-0001-0090-000000000001  Voucher Amount","00000000-0000-0001-0090-000000000002  Return ticket","00000000-0000-0001-0090-000000000004  Gift Card","00000000-0000-0001-0090-000000000005  Voucher Discount % With Maximum Amount","00000000-0000-0001-0090-000000000006  Voucher Discount % With Comparison","00000000-0000-0001-0090-000000000007  Payment Amount"]},"state":{"format":"uuid","description":"state of Voucher","type":"string","example":["00000000-0000-0001-0091-000000000001  Created at POS","00000000-0000-0001-0091-000000000002  Emitted, available","00000000-0000-0001-0091-000000000003  Used, terminated","00000000-0000-0001-0091-000000000004  Canceled, terminated","00000000-0000-0001-0091-000000000005  Expired, terminated"]},"creationDate":{"format":"date-time","type":"string"},"validityFrom":{"format":"date-time","type":"string"},"validityTo":{"format":"date-time","type":"string"}}},"TicketDto":{"type":"object","properties":{"ticketId":{"description":"ticket id","type":"string","format":"uuid"},"storeId":{"description":"store identifier","type":"string"},"terminalId":{"description":"terminal identifier","type":"integer"},"timeStamp":{"description":"timeStamp of the  emitted ticket,","format":"date-time","type":"string"},"operationType":{"description":"kind of ticket emitted 'SalesReturn' 'Suspended' 'Voided' 'Prepayment' 'PrepaymentBalance' 'ECommSales' 'ECommReturn' 'CatalogSales' 'Sales'","format":"string"},"amount":{"description":"total amount of ticket  taxes included","type":"number","multipleOf":0.01},"loyaltyCardId":{"description":"loyalty card id","type":"string"},"posSaleTransactions":{"description":"array of all the items in the ticket","type":"array","items":{"$ref":"#/definitions/TicketItemDto"}}}},"TicketItemDto":{"type":"object","properties":{"productCode":{"description":"item code has the saqme value of ProductId","type":"string"},"productName":{"description":"name of the item","type":"string"},"productId":{"description":"item id","type":"string"},"upc1":{"description":"item barcode (free code). Has Value only if ean1 is not present","type":"string"},"ean1":{"description":"item barcode (13 or 8 ean code). Has Value only if upc1 is not present","type":"string"},"quantity":{"description":"item quantity (it's not orderedQty, because this is a payment not an order)","type":"integer"},"priceEach":{"description":"price of the single item","type":"number","multipleOf":0.01},"amount":{"description":"total amount of the items (total of quantity)","type":"number","multipleOf":0.01},"macroCategory":{"description":"product hierarchy","type":"string"},"productType":{"description":"(to understand what kind of information put here)","type":"string"},"brand":{"description":"item brand","type":"string"},"isSubscription":{"description":"flag for subscription items","type":"boolean"}}}},"securityDefinitions":{"api-key":{"type":"apiKey","description":"API Key for accessing secure APIs","name":"Ocp-Apim-Subscription-Key","in":"header"}}}