{"openapi":"3.0.2","info":{"version":"0.6.0","title":"Platin360","contact":{"name":"Platin360 Development Team","email":"dev@platin360.com"},"termsOfService":"https://platin360.app/terms-of-service","description":"# Platin360 Public Api Documentation\nThis documentation is under active development, feedbacks, requests and questions are welcome."},"externalDocs":{"url":"https://docs.platin360.com","description":"Documentatin Reference"},"tags":[{"name":"product","description":"Product Service"},{"name":"inventory","description":"Inventory Service"},{"name":"order","description":"Order Service"},{"name":"invoice","description":"Invoice Service"}],"servers":[{"url":"https://platin360.test/api","description":"Development"},{"url":"https://platin360.app/api","description":"Production"}],"paths":{"/product/query":{"post":{"operationId":"GetProductsByQuery","tags":["product"],"description":"Product listing query\n","requestBody":{"$ref":"#/components/requestBodies/GetProductsByQuery"},"responses":{"200":{"$ref":"#/components/responses/GetProductsByQuery"}}}},"/product":{"post":{"operationId":"CreateProduct","tags":["product"],"description":"Create product\n","requestBody":{"$ref":"#/components/requestBodies/CreateProduct"},"responses":{"200":{"$ref":"#/components/responses/CreateProduct"}}}},"/product/save":{"put":{"operationId":"SaveProduct","tags":["product"],"description":"Updates or creates the specified product according to UUID\n","requestBody":{"$ref":"#/components/requestBodies/SaveProduct"},"responses":{"200":{"$ref":"#/components/responses/SaveProduct"}}}},"/product/{id}":{"get":{"operationId":"GetProductById","description":"Show product","tags":["product"],"parameters":[{"in":"path","name":"id","schema":{"type":"integer"},"required":true,"description":"Product identifier"}],"responses":{"200":{"$ref":"#/components/responses/CreateProduct"}}},"put":{"operationId":"UpdateProductById","description":"Update product","tags":["product"],"parameters":[{"in":"path","name":"id","schema":{"type":"integer"},"required":true,"description":"Product identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateProduct"}}}},"/inventory/query":{"post":{"operationId":"GetInventoriesByQuery","description":"GetInventoriesByQuery definition","tags":["inventory"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBuilderRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBuilderResponse"}}}}}}},"/inventory/updateBySkuBatch":{"put":{"operationId":"UpdateBySkuBatch","tags":["inventory"],"description":"Using this service, you can update up to 1000 inventory items at once.\n","requestBody":{"$ref":"#/components/requestBodies/UpdateBySkuBatch"},"responses":{"200":{"$ref":"#/components/responses/UpdateBySkuBatch"}}}},"/inventory/updateByBarcodeBatch":{"put":{"operationId":"UpdateByBarcodeBatch","tags":["inventory"],"description":"Using this service, you can update up to 1000 inventory items at once.\n","requestBody":{"$ref":"#/components/requestBodies/UpdateByBarcodeBatch"},"responses":{"200":{"$ref":"#/components/responses/UpdateBySkuBatch"}}}},"/inventory/updateBySkuOrBarcode":{"put":{"operationId":"UpdateBySkuOrBarcode","tags":["inventory"],"description":"Using this service, you can update a variant's stock quantity by either a sku or barcode.\n","requestBody":{"$ref":"#/components/requestBodies/UpdateInventoryBySkuOrBarcode"},"responses":{"201":{"$ref":"#/components/responses/UpdateInventoryBySkuOrBarcode"}}}},"/order/query":{"post":{"tags":["order"],"operationId":"GetOrdersByQuery","description":"Order query","requestBody":{"$ref":"#/components/requestBodies/GetOrdersByQuery"},"responses":{"200":{"$ref":"#/components/responses/GetOrdersByQuery"}}}},"/order/envelope/{id}":{"get":{"operationId":"GetOrderEnvelopeById","description":"GetOrderEnvelopeById definition","tags":["order"],"parameters":[{"in":"path","name":"id","schema":{"type":"integer"},"required":true,"description":"Order identifier"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEnvelope"}}}}}}},"/order/{id}":{"get":{"operationId":"GetOrderById","description":"GetOrderById definition","tags":["order"],"parameters":[{"in":"path","name":"id","schema":{"type":"integer"},"required":true,"description":"Order identifier"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}}}},"/invoice/query":{"post":{"tags":["invoice"],"operationId":"GetInvoicesByQuery","description":"Order query","requestBody":{"$ref":"#/components/requestBodies/GetInvoicesByQuery"},"responses":{"200":{"$ref":"#/components/responses/GetInvoicesByQuery"}}}}},"components":{"schemas":{"Currency":{"description":"Currency Model Definition\n","properties":{"code":{"type":"string","example":"TRY","description":"Currency code\n"},"name":{"type":"string","example":"Turkish Lira","description":"Currency name\n"}}},"Level":{"description":"Level Model Definition\n","properties":{"id":{"type":"integer","example":1,"description":"Level identifier\n"},"inventory_item_id":{"type":"integer","example":1,"description":"Related inventory item identifer\n"},"location_id":{"type":"integer","example":1,"description":"Related location identifier"},"quantity_sum":{"type":"integer","example":4,"description":"Current quantity of the variant at the location\n"}}},"Inventory":{"description":"Inventory Model Definition\n","properties":{"id":{"type":"integer","example":1,"description":"Inventory identifier\n"},"product_variant_id":{"type":"integer","example":1,"description":"Related product variant identifier\n"},"sku":{"type":"string","example":"SKU001","description":"Stock Keeping Unit\n"},"levels":{"type":"array","items":{"$ref":"#/components/schemas/Level"}},"created_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Create date of the object\n"},"updated_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Update date of the object\n"}}},"Integration":{"description":"Integration properties of the variant\n","properties":{"type":{"type":"string","enum":["TRENDYOL","HEPSIBURADA","CICEKSEPETI","PLATINMARKET","N11"],"example":"TRENDYOL"},"price":{"type":"number","description":"Integration special price\n","example":9999},"compare_price":{"type":"number","description":"Integration special compare price\n","example":10000},"quantity_min":{"type":"integer","description":"Minimum quantity as closing point\n","example":10},"quantity_max":{"type":"integer","description":"Maximum quantity as limit point\n","example":10}}},"VariantOption":{"description":"Generic properties of the variant\n","properties":{"name":{"type":"string","description":"property name\n","example":"color"},"value":{"type":"string","description":"property value\n","example":"blue"}}},"ProductVariant":{"description":"Variant Model Definition\n","properties":{"id":{"type":"integer","example":1,"description":"Variant identifier\n"},"uuid":{"type":"string","nullable":true,"default":null,"description":"Varyasyonun mağaza benzersiz kodu\n"},"product_id":{"type":"integer","example":1,"description":"Related product identifer\n"},"title":{"type":"string","nullable":true,"example":"API Test Product Variant","description":"Variant title\n"},"price":{"type":"number","nullable":true,"example":100.5,"description":"Variant price\n"},"compare_price":{"type":"number","nullable":true,"example":120.5,"description":"Variant compare price\n"},"barcode":{"type":"string","nullable":true,"example":"BARCODE001","description":"Variant barcode\n"},"sort":{"type":"integer","default":0,"description":"Variant sorting rank\n"},"inventory":{"$ref":"#/components/schemas/Inventory"},"options":{"type":"array","description":"Variant properties\n","items":{"$ref":"#/components/schemas/VariantOption"}},"integrations":{"type":"array","description":"Integrations of the product variant\n","items":{"$ref":"#/components/schemas/Integration"}},"created_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Create date of the object\n"},"updated_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Update date of the object\n"}}},"Product":{"description":"Product Model Definition\n","properties":{"id":{"type":"integer","example":1,"description":"Product identifier"},"uuid":{"type":"string","example":"91ccf111-56c9-5a10-8bf7-4353b23b98f3","description":"Product unique identifier\n"},"currency_code":{"type":"string","example":"TRY","description":"Product currency code\n"},"title":{"type":"string","example":"API Test Product","description":"Product title\n"},"status":{"type":"string","example":"draft","enum":["draft","passive","active"],"description":"Product listing status\n"},"created_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Create date of the object\n"},"updated_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Update date of the object\n"},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariant"}}}},"Order":{"description":"Order definition\n","properties":{"id":{"type":"integer","example":1001,"description":"Order identifier\n"},"uuid":{"type":"string","example":"e5cd2ce2-bc62-5470-b9a3-f323c0e2dc5d","description":"Order identifier\n"},"customer_id":{"type":"integer","example":1,"description":"Related customer identifier\n"},"amount":{"type":"number","example":1120.5,"description":"Order amount in Turkish Lira\n"},"ordered_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Order date of the object\n"},"created_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Create date of the object\n"},"updated_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Update date of the object\n"}}},"OrderEnvelope":{"description":"OrderEnvelope definition\n","properties":{"order":{"type":"object","properties":{"id":{"type":"integer","example":1},"uuid":{"type":"string","example":"00000000-0000-0000-0000-000000000000"},"identifier":{"type":"string","example":202604100001},"state":{"type":"integer","example":16},"status":{"type":"string","example":"Paketler Oluşturulmuş"},"ordered_at":{"type":"string","example":"2026-04-10T00:00:00.000000Z"}}},"environment":{"type":"object","properties":{"id":{"type":"number","description":"Environment identifier","example":1},"name":{"type":"string","description":"Environment name","example":"koctas@platin360.app"},"feature_key":{"type":"string","description":"Enironment Feature Key","example":"00000000-0000-0000-0000-000000000000"}}},"retracts":{"type":"array"},"receiver":{"type":"object","properties":{"id":{"type":"integer","example":1},"agency":{"type":"string","description":"Tax Office","example":"İstanbul Vergi Dairesi"},"identifer":{"type":"string","description":"Tax Number","example":"2222222222"},"name":{"type":"string","description":"Name","example":"John SMITH"},"first_name":{"type":"string","description":"Firstname","example":"John"},"lasr_name":{"type":"string","description":"Lastname","example":"SMITH"},"phone":{"type":"string","description":"Phone number","example":"5310000000"},"email":{"type":"string","description":"Email","example":"john@smith.com"},"address":{"type":"string","description":"Address","example":"Bağlar içi 4. sok No: 69 Çorlu / Tekirdağ"},"city":{"type":"string","description":"City","example":"Tekirdağ"},"province":{"type":"string","description":"Province","example":"Çorlu"},"country":{"type":"string","description":"Country","example":"Türkiye"},"country_code":{"type":"string","description":"Country code","example":"TR"},"postcode":{"type":"string","description":"Postcode","example":"59860"},"domestic":{"type":"boolean","description":"Domestic","example":true}}},"lines":{"type":"array","items":{"properties":{"order_item_id":{"type":"integer","example":1},"sku":{"type":"string","description":"stock keeping unit of the order item","example":"SKU00001"},"barcode":{"type":"string","description":"barcode of the order item","example":"BAR00001"},"name":{"type":"string","description":"product name","example":"Product name"},"quantity":{"type":"integer","description":"order quantity","example":2},"discount":{"type":"number","example":0},"vat_ratio":{"type":"number","description":"vat ratio of the order item","example":20},"vat_multiplier":{"type":"number","description":"vat multiplier of the order item","example":1.2},"unit_price_with_vat":{"type":"number","description":"vat included unit price of the order item","example":1200},"unit_price_without_vat":{"type":"number","description":"vat excluded unit price of the order item","example":1000},"total_price_with_vat":{"type":"number","description":"vat included total price of the order item","example":2400},"total_price_without_vat":{"type":"number","description":"vat excluded total price of the order item","example":2000},"unit_vat":{"type":"number","description":"computed unit vat price of the order item","example":200},"total_vat":{"type":"number","description":"computed total vat price of the order item","example":400},"currency":{"type":"string","description":"currency of the order item","example":"TRY"}}}}}},"Invoice":{"description":"Invoice definition\n","properties":{"id":{"type":"integer","example":1001,"description":"Invoice identifier\n"},"order_id":{"type":"integer","example":"1001","description":"Order identifier\n"},"package_identifier":{"type":"integer","example":"101","description":"Order Package identifier\n"},"identifier":{"type":"string","example":"00000000-0000-0000-0000-000000000000","description":"Invoice ETTN identifier\n"},"invoice_identifier":{"type":"string","example":"STO2025000000053","description":"Invoice identifier\n"},"scenario":{"type":"string","example":"EARSIVFATURA","oneOf":[{"enum":["EARSIVFATURA","EFATURA"]}],"description":"Invoice type\n"},"created_at":{"type":"string","example":"2023-02-13T10:53:53.000000Z","description":"Create date of the object\n"}}},"QueryBuilderRequest":{"description":"QueryBuilderRequest definition\n","properties":{"page":{"type":"integer","default":1,"minimum":0},"limit":{"type":"integer","default":25,"minimum":25,"maximum":100},"relation":{"type":"array","default":null,"nullable":true},"filter":{"type":"object","default":null,"nullable":true},"search":{"type":"object","default":null,"nullable":true}}},"QueryBuilderResponse":{"description":"QueryBuilderResponse definition\n","properties":{"data":{"type":"array","items":{"type":"object"}},"meta":{"type":"object","example":{"current_page":{"type":"integer","example":1},"last_page":{"type":"integer","example":4},"per_page":{"type":"integer","example":25},"total":{"type":"integer","example":100}}}}}},"requestBodies":{"GetProductsByQuery":{"required":false,"description":"Get products by query","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/QueryBuilderRequest"}],"properties":{"relation":{"type":"array","example":["variants","currency","images"]},"filter":{"type":"object","example":{"id":12,"variants":{"type":"object","example":{"barcode":{"type":"string","example":"like_%BARCODE%"}}}}}}}}}},"CreateProduct":{"required":true,"description":"Create Product","content":{"application/json":{"schema":{"description":"CreateProductRequest definition\n","required":["currency_code","variants"],"properties":{"currency_code":{"description":"Currency code of the product\n","type":"string","example":"TRY"},"variants":{"type":"array","minItems":1,"description":"Variants of the product\n","items":{"required":["inventory"],"properties":{"inventory":{"type":"object","description":"Inventory of the variant\n","required":["levels"],"properties":{"levels":{"minItems":1,"type":"array","description":"Inventory level connection\n","items":{"required":["location_id"],"properties":{"location":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":1,"description":"Location identifier\n"}},"description":"Depo\n"}}}}}}}}}}}}}},"SaveProduct":{"required":true,"description":"Updates or creates the specified product according to UUID","content":{"application/json":{"schema":{"description":"SaveProductRequest definition\n","required":["uuid","title"],"properties":{"uuid":{"description":"Unique identifier for Product\n","type":"string","maxLength":36,"example":"00000000-0000-0000-0000-000000000000"},"title":{"description":"Title of the product\n","type":"string","example":"Product"},"currency_code":{"description":"Currency code of the product\n","type":"string","example":"TRY"},"status":{"description":"Product status\n","type":"string","enum":["draft","passive","active"]},"images":{"description":"Product images\n","type":"array","items":{"type":"string","example":"https://picsum.photos/id/1/200/300"}},"information":{"type":"object","properties":{"description":{"description":"Product description\n","type":"string","example":"Product description"},"short_description":{"description":"Short product description\n","type":"string","example":"Product Description"}}},"variants":{"type":"array","description":"Variants of the product\n","items":{"required":["uuid"],"properties":{"uuid":{"type":"string","description":"Unqiue identifier for ProductVariant\n","maxLength":36,"example":"00000000-0000-0000-0000-000000000000"},"title":{"type":"string","description":"Title of the ProductVariant\n","maxLength":36,"example":"Variant Title"},"barcode":{"type":"string","description":"Barcode of the ProductVariant\n","maxLength":36,"example":"B0000001"},"price":{"type":"number","description":"Price of the ProductVariant\n","maxLength":36,"example":100},"compare_price":{"type":"number","description":"Compare price of the variant\n","maxLength":36,"example":120},"images":{"description":"ProductVariant images\n","type":"array","items":{"type":"string","example":"https://picsum.photos/id/1/200/300"}},"inventory":{"type":"object","description":"Inventory of the variant\n","properties":{"sku":{"type":"string","description":"Stock Keeping Unit\n","example":"S0000000001"},"cost":{"type":"number","description":"Cost of the ProductVariant\n","maxLength":36,"example":100},"levels":{"type":"array","description":"Inventory level connection\n","items":{"oneOf":[{"type":"object","properties":{"set":{"type":"integer","example":10,"description":"Set the stock quantity to specified amount\n"},"location":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":1,"description":"Location identifier\n"}},"description":"Depo\n"}}},{"type":"object","properties":{"adjustment":{"type":"integer","example":-5,"description":"Adjust the stock quantity by specified amount\n"},"location":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":1,"description":"Location identifier\n"}},"description":"Depo\n"}}}]}}}},"options":{"type":"array","description":"Variant properties\n","items":{"$ref":"#/components/schemas/VariantOption"}}}}}}}}}},"UpdateBySkuBatch":{"required":true,"description":"Update multiple inventory items by sku\n","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","required":["sku","value"],"properties":{"sku":{"type":"string","example":"S0000000000"},"method":{"type":"string","default":"set","enum":["adjust","set"],"description":"The update method, **set** will equalize the current stock to given value while **adjust** will append the given value to the current stock.\n"},"value":{"type":"integer","example":100},"location_id":{"type":"integer","example":null},"variant":{"$ref":"#/components/schemas/ProductVariant"}}}}}}}}},"UpdateByBarcodeBatch":{"required":true,"description":"Update multiple inventory items by barcode\n","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","required":["barcode","value"],"properties":{"barcode":{"type":"string","example":"B0000000000"},"method":{"type":"string","default":"set","enum":["adjust","set"],"description":"The update method, **set** will equalize the current stock to given value while **adjust** will append the given value to the current stock.\n"},"value":{"type":"integer","example":100},"location_id":{"type":"integer","example":null},"variant":{"$ref":"#/components/schemas/ProductVariant"}}}}}}}}},"UpdateInventoryBySkuOrBarcode":{"required":true,"description":"Update inventory stock by sku or barcode\n","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["sku","value"],"properties":{"sku":{"type":"string","example":"SKU1","description":"The Stock Keeping Unit of the inventory.\n"},"method":{"type":"string","default":"set","enum":["adjust","set"],"description":"The update method, **set** will equalize the current stock to given value while **adjust** will append the given value to the current stock.\n"},"value":{"type":"integer","example":1,"description":"Update value the stock will be manipulated according to.\n"},"location_id":{"type":"integer","default":null,"description":"Location identifier of the level, if not specified, default location will be used.\n"},"variant":{"$ref":"#/components/schemas/ProductVariant"}}},{"type":"object","required":["barcode","value"],"properties":{"barcode":{"type":"string","example":"BARCODE1","description":"The Barcode of the variant.\n"},"method":{"type":"string","default":"set","enum":["adjust","set"],"description":"The update method, **set** will equalize the current stock to given value while **adjust** will append the given value to the current stock.\n"},"value":{"type":"integer","example":1,"description":"Update value the stock will be manipulated according to.\n"},"location_id":{"type":"integer","default":null,"description":"Location identifier of the level, if not specified, default location will be used.\n"},"variant":{"$ref":"#/components/schemas/ProductVariant"}}}]}}}},"GetOrdersByQuery":{"required":false,"description":"GetOrdersByQuery definition\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBuilderRequest"}}}},"GetInvoicesByQuery":{"required":false,"description":"GetInvoicessByQuery definition\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBuilderRequest"}}}}},"responses":{"GetProductsByQuery":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/QueryBuilderResponse"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}},"CreateProduct":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"SaveProduct":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"UpdateBySkuBatch":{"description":"OK","content":{"application/json":{"schema":{"properties":{"S0000000000":{"type":"array","minItems":0,"items":{"type":"object","properties":{"adjustment":{"type":"integer","example":-5}}}}}}}}},"UpdateInventoryBySkuOrBarcode":{"description":"OK","content":{"application/json":{"schema":{"properties":{"id":{"type":"integer","description":"The transaction identifier for the stock activity.\n"},"adjustment":{"type":"integer","description":"The applied relative adjustment to the previous stock to eqaulize the current stock into desired value.\n"},"inventory_level_id":{"type":"integer","description":"The related inventory level identifer.\n"}}}}}},"GetOrdersByQuery":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/QueryBuilderResponse"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}}}},"GetInvoicesByQuery":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/QueryBuilderResponse"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Platin360","description":"Platin360 development token"}}},"security":[{"bearerAuth":[]}],"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}