{"openapi":"3.0.0","paths":{"/v2/order":{"post":{"operationId":"OrderController_store","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDto"},"examples":{"Full":{"value":{"order_number":"136411778","external_id":"pedido_524","amount":600,"invoice_created_timestamp":"2020-08-14T19:43:09.4740645+03:00","invoice_number":"5467203","access_key":"51080701212344000127550010000000981364117781","volumes":[{"weight":1570,"height":20,"length":30,"width":10,"items":[{"name":"Vinho Miolo Rose","sku":"VMR_001","thumb_url":"www.thumb.com/thumb.png","quantity":7,"amount":550,"weight":250}]}],"customer":{"name":"João","email":"joao@gmail.com","phone":"5511999999999","document_type":"cpf","document_number":"21903118026"},"destination_address":{"zip_code":"01412100","country":"Brasil","state":"SP","city":"São Paulo","neighborhood":"Cerqueira César","street":"Rua Augusta","street_number":"2840","complement":"sala comercial, 13º andar"},"delivery_info":{"starting_time":"10:00","ending_time":"19:00","expected_delivery_date":"2020-08-14"}}},"Minimal":{"value":{"order_number":"136411778","volumes":[{"items":[{"name":"Vinho Miolo Rose"}]}],"customer":{"name":"João","document_type":"cpf","document_number":"21903118026"},"destination_address":{"zip_code":"01412100","state":"SP","city":"São Paulo","neighborhood":"Cerqueira César","street":"Rua Augusta","street_number":"2840"}}}}}}},"responses":{"201":{"description":"The order has been successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse201Dto"}}}},"400":{"description":"The request body has some schema errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse400Dto"}}}}},"security":[{"x-abbiamo-seller-key":[]}],"tags":["order"]}}},"info":{"title":"Abbiamo Api","description":"Abbiamo public sellers endpoints require a seller-key, notify the abbiamo team for one","version":"2.1","contact":{}},"tags":[],"servers":[{"url":"https://api.abbiamo.io","description":"Abbiamo's production environment"}],"components":{"securitySchemes":{"x-abbiamo-seller-key":{"type":"apiKey","in":"header","name":"x-abbiamo-seller-key","description":"Abbiamo public sellers endpoints require a seller-key, notify the abbiamo team for one"}},"schemas":{"ItemDto":{"type":"object","properties":{"name":{"type":"string","description":"Item name","example":"Vinho Miolo Rose","maxLength":255},"sku":{"type":"string","description":"Item unique key/code","example":"VMR_001"},"thumb_url":{"type":"string","description":"Single item url picture to be displayed on tracking","example":"www.thumb.com/thumb.png"},"quantity":{"type":"number","description":"Item quantity","example":7,"default":1,"minimum":1},"amount":{"type":"number","description":"Single item selling price in reais cents, this field is required if you didn't inform invoice_amount","example":550,"default":0,"minimum":0},"weight":{"type":"number","description":"Single item total weight in grams, this field is required if you didn't inform volume weight and have a digital type abbiamo account","example":250,"minimum":0}},"required":["name"]},"VolumeDto":{"type":"object","properties":{"weight":{"type":"number","description":"Total Volume weight in grams, this field is required if you didn't inform each item weight and have a digital type abbiamo account","example":1570,"minimum":0},"height":{"type":"number","description":"Volume height in cm","example":20,"minimum":1},"length":{"type":"number","description":"Volume length in cm","example":30,"minimum":1},"width":{"type":"number","description":"Volume width in cm","example":10,"minimum":1},"items":{"type":"array","items":{"$ref":"#/components/schemas/ItemDto"}}},"required":["items"]},"CustomerDto":{"type":"object","properties":{"email":{"type":"string","description":"a contact e-mail","example":"joaosilva@gmail.com"},"phone":{"type":"string","description":"phone number containing country and state code","example":"+5521989452221"},"document_type":{"type":"string","description":"document type","enum":["CPF","CNPJ","PASSPORT"],"default":"CPF"},"document_number":{"type":"string","description":"document identification number","example":"04926877189","maxLength":20},"name":{"type":"string","description":"Customer's or company's name","example":"João Ferreira","maxLength":255}},"required":["name"]},"DeliveryInfoDto":{"type":"object","properties":{"starting_time":{"type":"string","description":"Time window for customer service in hh:mm format - minimum 4 hours gap","example":"09:00"},"ending_time":{"type":"string","description":"Time window for customer service in hh:mm format - minimum 4 hours gap","example":"17:00"},"expected_delivery_date":{"type":"string","description":"Expected date to deliver order/package","example":"2020-08-14"}},"required":["starting_time","ending_time"]},"AddressDto":{"type":"object","properties":{"zip_code":{"type":"string","description":"Address postal code","example":"22270000"},"country":{"type":"string","description":"Address country","example":"Brasil","default":"Brasil","maxLength":10},"state":{"type":"string","description":"Address state","example":"SP","maxLength":25},"city":{"type":"string","description":"Address city","example":"Sao Paulo","maxLength":255},"neighborhood":{"type":"string","description":"Address neighborhood","example":"Jardim Paulista","maxLength":255},"street":{"type":"string","description":"Address street","example":"Voluntários da Pátria","maxLength":255},"street_number":{"type":"string","description":"Establishment's number in it's street, values with length bigger than 10 will be truncated to exactly 10 characters.","example":"10"},"complement":{"type":"string","description":"Address complement to complete the delivery information","example":"Apartamento 402","maxLength":255},"reference":{"type":"string","description":"Any additional information capable of helping the delivery process","example":"Blue and white gate","maxLength":255}},"required":["zip_code","city","neighborhood","street","street_number"]},"CarrierDto":{"type":"object","properties":{"type":{"type":"string","description":"Used carrier for delivery","example":"TRANSPORTADORA_ABBIAMO"},"collection_warehouse_id":{"type":"string","description":"Warehouse_id used to provide collection address. Provided by abbiamo team or warehouse api endpoint","example":"a346a416-db91-11ec-9d64-0242ac120002"}},"required":["type","collection_warehouse_id"]},"OrderDto":{"type":"object","properties":{"order_number":{"type":"string","description":"your order_number identifier","example":"136411778"},"external_id":{"type":"string","description":"external service/integration order id - for analytics purposes","example":"pedido_524"},"amount":{"type":"number","description":"Invoice total amount in reais cents, this field is required if you didn't inform each item amount","example":600,"minimum":0,"default":0},"invoice_created_timestamp":{"type":"string","description":"Invoice creation timestamp","example":"2020-08-14T19:43:09.4740645+03:00"},"invoice_number":{"type":"string","description":"Invoice number identification","example":"5467203"},"access_key":{"type":"string","description":"44 digits string of the electronic invoice","example":"51080701212344000127550010000000981364117781"},"volumes":{"type":"array","items":{"$ref":"#/components/schemas/VolumeDto"}},"customer":{"example":{"name":"João Ferreira","email":"joao@gmail.com","phone":"5511999999999","document_type":"cpf","document_number":"21903118026"},"allOf":[{"$ref":"#/components/schemas/CustomerDto"}]},"destination_address":{"example":{"zip_code":"01412100","country":"Brasil","state":"SP","city":"São Paulo","neighborhood":"Cerqueira César","street":"Rua Augusta","street_number":"2840","complement":"sala comercial, 13º andar"},"allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"delivery_info":{"example":{"starting_time":"10:00","ending_time":"19:00","expected_delivery_date":"2020-08-14"},"allOf":[{"$ref":"#/components/schemas/DeliveryInfoDto"}]},"carrier":{"example":{"type":"TRANSPORTADORA_ABBIAMO","collection_warehouse_id":"a346a416-db91-11ec-9d64-0242ac120002"},"allOf":[{"$ref":"#/components/schemas/CarrierDto"}]}},"required":["order_number","volumes","customer","destination_address"]},"OrderResponse201Dto":{"type":"object","properties":{"status":{"type":"string","example":"success"},"tracking":{"type":"string","description":"The order tracking identifier","example":"abc123d"},"tracking_link":{"type":"string","description":"A link that can be accessed by the customer to check the current status of the order","example":"http://meupedido.abbiamolog.com/abc123d"}},"required":["status","tracking","tracking_link"]},"OrderResponse400Dto":{"type":"object","properties":{"statusCode":{"type":"string","example":"400"},"message":{"description":"The response error messages","example":["order_number must be a string","volumes must contain at least 1 elements","volumes must be an array","customer must be a non-empty object","customer must be an object","destination_address must be a non-empty object","destination_address must be an object"],"type":"array","items":{"type":"string"}},"error":{"type":"string","description":"The type of error","example":"Bad Request"}},"required":["statusCode","message","error"]}}}}