{"openapi":"3.0.0","servers":[{"description":"3pluk API sandbox server for testing","url":"https://apisandbox.3pluk.co.uk/api/v2"},{"description":"Main 3pluk API server","url":"https://api.3pluk.co.uk/api/v2"}],"info":{"description":"This is used for creating Sales Orders in the 3pluk Core system. It uses REST protocol","version":"1.0.0","title":"3pluk Sales Order API","contact":{"email":"paul.riley@3pluk.co.uk","url":"https://developer.3pluk.co.uk"}},"paths":{"/Order":{"post":{"summary":"Creates a new sales order in the 3pluk system","operationId":"postOrder","description":"This method allows a calling application to create a new order record via a series of elements. The api will respond to a new order request with either a success message or error messages where an order request has failed.","parameters":[{"in":"header","name":"X-AUTH-CLIENT","description":"base64 encoded username. The username will be supplied by 3pluk which must be base64 encoded before being sent","schema":{"type":"string"},"required":true},{"in":"header","name":"X-AUTH-PSW","description":"base64 encoded password. The password will be supplied by 3pluk which must be base64 encode before being sent","schema":{"type":"string"},"required":true},{"in":"header","name":"X-AUTH-TOKEN","description":"base64 encoded token. The token will be supplied by 3pluk which must be base64 encode before being sent","schema":{"type":"string"},"required":true},{"in":"header","name":"X-AUTH-PLATFORM","description":"lowercase parameter that indicates the platform the call should be made against. Use 'sandbox' for testing. 'production' only available on the live url. NB this parameter is not base64 encoded.","required":true,"schema":{"type":"string","enum":["production","sandbox"]}}],"responses":{"200":{"description":"Create a sales order on the 3pluk Core system","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderObjectResponse"}}}},"400":{"description":"invalid input, object invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"example":{"DeliveryDetails":{"DeliveryCompany":"ACME","DeliveryName":"Joe AnyName","DeliveryAddress1":"1 Station Road","DeliveryAddress2":"Any Place","DeliveryTown":"NewTown","DeliveryCounty":"AnyShire","DeliveryPostcode":"AB1 2XY","DeliveryCountry":"GB","DeliveryTel":11111111111,"DeliveryTel2":22222222222,"DeliveryEmail":"joe@example.com","DeliveryMethod":{"DMType":"C","DMValue":"2049"},"DeliveryInstruction":"Leave behind gate","InternalPickNotes":"These are test notes","CustomsDetails":{"CustomsContent":"Goods","TotalCustomsValue":9099,"CustomsCurrency":"GBP","CommercialInvoiceNumber":"x999","Duties":"Paid","RecipientEori":"Test","ExportReason":"Goods","ExportStatement":"Export Statement"}},"OrderDetails":[{"SKU":99999,"ProductName":"test 1","Quantity":1,"Price":1.5},{"SKU":888888,"ProductName":"test 2","Quantity":2,"Price":2.5}],"OrderInserts":[{"OrderInsert":"https://www.example.com/my_doc.pdf"},{"OrderInsert":"https://www.example.com/my_doc.pdf"}]},"schema":{"$ref":"#/components/schemas/Order"}}},"description":"This is an Order object containing information about the Sales Order to add to 3pluk Core system."}}}},"components":{"schemas":{"Order":{"description":"This data element contains all of the information required to create a sales order on the 3pluk system.","type":"object","required":["OrderId","DeliveryDetails","OrderDetails"],"properties":{"OrderId":{"type":"integer","format":"integer","example":1234567,"writeOnly":true,"description":"This data element contains your own unique order id or order reference"},"DeliveryDetails":{"$ref":"#/components/schemas/DeliveryDetails"},"OrderDetails":{"type":"array","items":{"$ref":"#/components/schemas/OrderLine"}},"OrderInserts":{"type":"array","items":{"type":"object","properties":{"OrderInsert":{"description":"This data element contains the URL to any documents, which must be in PDF format, that need to be printed and inserted into any order. Each item to be printed (an Insert) should be located on a publicly accessible web server which allows for 3pluk core to copy the file to the primary 3pluk web server. The full URL to each item including the http:// must be provided and contained within its own 'OrderInsert' element within the 'OrderInserts' element. There is no limit on the number of 'OrderInsert' elements that can be submitted.","type":"string","maxLength":50}}}}}},"DeliveryDetails":{"description":"This data element contains all of the details required for the recipient of the order","type":"object","required":["DeliveryName","DeliveryAddress1","DeliveryTown","DeliveryPostCode","DeliveryCountry","DeliveryTel","DeliveryEmail","DeliveryMethod"],"properties":{"DeliveryCompany":{"type":"string","maxLength":10,"description":"Indicates company name for delivery"},"DeliveryName":{"type":"string","maxLength":50,"description":"Indicates name of person for delivery"},"DeliveryAddress1":{"type":"string","maxLength":50,"description":"Indicates first line of delivery address"},"DeliveryAddress2":{"type":"string","maxLength":50,"description":"Additional line for delivery address"},"DeliveryAddress3":{"type":"string","maxLength":50,"description":"Additional line for delivery address"},"DeliveryTown":{"type":"string","maxLength":50,"description":"Indicates delivery town"},"DeliveryCounty":{"type":"string","maxLength":50,"description":"Indicates delivery address county. 2 Digit State Code must be provided for Australia, Canada and the US."},"DeliveryPostCode":{"type":"string","maxLength":10,"description":"Indicates delivery post code"},"DeliveryCountry":{"type":"string","maxLength":2,"description":"Indicates delivery country. ISO2 Alpha Code"},"DeliveryTel":{"type":"integer","format":"integer","maxLength":20,"description":"Indicates delivery telephone"},"DeliveryTel2":{"type":"integer","format":"integer","maxLength":20,"description":"Indicates additional delivery telephone"},"DeliveryEmail":{"type":"string","maxLength":50,"description":"Indicates delivery email. Must be a valid email"},"DeliveryMethod":{"$ref":"#/components/schemas/Delivery"},"DeliveryInstructions":{"type":"string","maxLength":50,"description":"Indicates any delivery instructions for courier"},"InternalPicknotes":{"type":"string","description":"Indicates any internal pick notes, not seen by courier or recipient"},"CustomsDetails":{"$ref":"#/components/schemas/CustomsDetail"}}},"Delivery":{"description":"Contains details of the delivery method required for the order","properties":{"DMType":{"description":"Indicates the type of delivery method. D -Default C -CoreID M -Mapped R -Rules","type":"string","enum":["D","C","M","R"]},"DMValue":{"description":"Indicates the applicable delivery method value. Required if DMType = C or M. M can only be used if available delivery methods are mapped within 3pluk core","type":"string"}}},"OrderLine":{"description":"This data element contains all the details required for each order line","required":["SKU","ProductName","Quantity","Price"],"properties":{"SKU":{"type":"string","description":"Indicates Product SKU. Must already be created within 3pluk core","maxLength":50},"ProductName":{"type":"string","description":"Indicates Product Name","maxLength":50},"Quantity":{"type":"integer","format":"integer","description":"Indicates the QTY to pick","maxLength":10},"Price":{"type":"number","format":"float","example":9.99,"description":"Indicates the unit sale price for each of the items sold"}}},"CustomsDetail":{"description":"This data element contains all the customs information required for the order. *Required if the delivery county code (DeliveryDetails.DeliveryCountry) is not GB","properties":{"CustomsContent":{"type":"string","maxLength":50,"description":"Indicates description of goods for none UK countries. Required for all deliveries going outside of the UK. *Required for all deliveries going outside of the UK"},"TotalCustomsValue":{"type":"number","format":"float","description":"Indicates total order value for none UK countries. Must be value declared for customs via Commercial Invoice. *Required for all deliveries going outside of the UK","example":9.99},"CustomsCurrency":{"type":"string","maxLength":3,"description":"Indicates Currency used for none UK orders. Must be standard ISO Currency Code ie GBP, USD, EUR. *Required for all deliveries going outside of the UK","example":"GBP"},"CommercialInvoiceNumber":{"type":"string","description":"Indicates the Commercial Invoice Number use for none UK Orders. Should default to Order Id if a different Commercial Invoice Number is not available. *Required for all deliveries going outside of the UK"},"Duties":{"type":"string","description":"Indicates whether recipient must pay duties and taxes upon receipt (Owed) or if duties and taxes were paid at point of purchase (Paid). *Required for all deliveries going outside of the UK","enum":["Paid","Owed"]},"RecipientEori":{"type":"string","description":"If available Recipients VAT or EORI number should be provided"},"ExportReason":{"type":"string","enum":["Other","Documents","Commercial","Sample","Merchandise","Gift","Goods"],"description":"Indicates reason for exporting goods. Must be one of options provided. *Required for all deliveries going outside of the UK"},"ExportStatement":{"type":"string","description":"Brief description of Examples would be Clothing, Makeup, Promotional Items goods being exported. *Required for all deliveries going outside of the UK"}}},"OrderObjectResponse":{"description":"This object will be returned from a call , if the call has been successful. A Status object, Data object and a Pagination object will be returned. The data object will contain details of the sales order.","required":["Status"],"properties":{"Data":{"$ref":"#/components/schemas/Order"},"Status":{"$ref":"#/components/schemas/Status"}}},"Status":{"type":"object","properties":{"Code":{"type":"integer","format":"integer","description":"HTTP Response Codes","example":200},"Messages":{"type":"array","items":{"type":"string"},"description":"Errors or messages return by the system"}}},"ErrorResponse":{"type":"object","properties":{"Status":{"$ref":"#/components/schemas/Status"}}}}}}