{"openapi":"3.0.2","info":{"title":"3rd Party Microservice API","description":"The Third-Party-MS API facilitates third-party integrations by connecting internal systems with external APIs. It manages communication and data exchange, supporting loyalty point systems, app integrations, and interactions with external platforms. This API streamlines operations, enhances customer experiences, and extends business capabilities through seamless integration with third-party services.","contact":{"email":"support@biztory.com.my"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"version":"1.0.11"},"servers":[{"url":"http://bs.testtory.com:8088/api/third-party-ms","description":"Local"},{"url":"https://bzapi.testtory.com/api/third-party-ms","description":"Staging"},{"url":"https://bzapi-beta.biztoryapp.com/api/third-party-ms","description":"Beta"},{"url":"https://bzapi-live-hf.biztoryapp.com/api/third-party-ms","description":"Live Hotfix"},{"url":"https://bzapi.biztoryapp.com/api/third-party-ms","description":"Production"}],"tags":[{"name":"storefront","description":"Shopping cart for guest"}],"paths":{"/storefront/gateways":{"get":{"tags":["storefront"],"summary":"List payment gateways","description":"List payment gateways","operationId":"listPaymentGateways","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Gateway"}}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"parameters":[{"$ref":"#/components/parameters/SubdomainHeader"}],"security":[{"BearerAuth":[]}]}},"/storefront/gateways/manual":{"get":{"tags":["storefront"],"summary":"getManualGateway manual gateway settings","description":"getManualGateway manual gateway settings","operationId":"getManualGateway","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ManualGateway"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]},"post":{"tags":["storefront"],"summary":"Update manual gateway settings","description":"Update manual gateway settings","operationId":"updateManualGateway","requestBody":{"$ref":"#/components/requestBodies/ManualGateway"},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ManualGateway"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]}},"/storefront/gateways/manual/callback":{"post":{"tags":["storefront"],"summary":"Update manual gateway settings","description":"Update manual gateway settings","operationId":"callbackManualGateway","requestBody":{"$ref":"#/components/requestBodies/ManualGatewayCallback"},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]}},"/storefront/order":{"post":{"tags":["storefront"],"summary":"Place order with cart items","description":"Place order with cart items","operationId":"storeOrder","requestBody":{"$ref":"#/components/requestBodies/StoreOrder"},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreOrder"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]}},"/storefront/cart":{"get":{"tags":["storefront"],"summary":"get cart items","description":"get cart items","operationId":"getCart","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]},"post":{"tags":["storefront"],"summary":"update cart items","description":"update cart items","operationId":"updateCart","requestBody":{"$ref":"#/components/requestBodies/Cart"},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]}},"/storefront/settings":{"get":{"tags":["storefront"],"summary":"get store settings","description":"get store settings","operationId":"getStoreSettings","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreSettings"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]},"patch":{"tags":["storefront"],"summary":"update store settings","description":"update store settings","operationId":"updateStoreSettings","requestBody":{"$ref":"#/components/requestBodies/StoreSettings"},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreSettings"}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]}},"/storefront/coupons":{"get":{"tags":["storefront"],"summary":"list coupons","description":"list coupons","operationId":"listCoupons","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}}}}]}}}},"400":{"description":"Invalid input"},"422":{"description":"Validation exception"}},"security":[{"BearerAuth":[]}]}}},"components":{"parameters":{"SubdomainHeader":{"name":"x-subdomain","in":"header","schema":{"type":"string"},"description":"Subdomain identifier","required":true}},"schemas":{"ApiResponse":{"type":"object","properties":{"code":{"type":"integer","example":200},"message":{"type":"string","example":"Success"}}},"Gateway":{"type":"object","properties":{"id":{"type":"string","example":"manual"},"display_name":{"type":"string","example":"Bank Transfer"}}},"ManualGateway":{"required":["payment_methods","display_name"],"type":"object","properties":{"id":{"type":"string","example":"manual"},"display_name":{"type":"string","example":"Bank Transfer"},"payment_methods":{"type":"array","items":{"type":"object","properties":{"payment_method_id":{"type":"integer","example":1},"display_name":{"type":"string","example":"Bank Transfer"},"description":{"type":"string","example":"Acc No: 123455869"}}}},"meta":{"type":"object","properties":{"enable_approval":{"type":"boolean","example":true}}}}},"StoreOrder":{"type":"object","properties":{"id":{"type":"integer","example":1},"type":{"type":"string","example":"sale_order"},"ref_num":{"type":"string","example":"SO0010"},"invoice_date":{"type":"string","format":"date-time","example":"2023-06-21 00:00:00"},"gst_supply_date":{"type":"string","format":"date-time","example":"2023-06-21 00:00:00"},"payee":{"type":"string","example":"cus"},"payee_id":{"type":"integer","example":1},"total":{"type":"number","example":10},"currency":{"type":"string","example":"MYR"},"currency_total":{"type":"number","example":10},"billing_addr":{"type":"string","example":"-, -, - -"},"billing_addr_1":{"type":"string","example":"-"},"billing_addr_2":{"type":"string"},"billing_addr_3":{"type":"string"},"billing_zip":{"type":"string","example":"-"},"billing_city":{"type":"string","example":"-"},"billing_state":{"type":"string","example":"-"},"shipping_addr":{"type":"string","example":"-, -, - -"},"shipping_addr_1":{"type":"string","example":"-"},"shipping_addr_2":{"type":"string"},"shipping_addr_3":{"type":"string"},"shipping_zip":{"type":"string","example":"-"},"shipping_city":{"type":"string","example":"-"},"shipping_state":{"type":"string","example":"-"},"attn":{"type":"string"},"shipping_attn":{"type":"string"},"payment_term":{"type":"string"},"status":{"type":"integer"},"meta":{"type":"object"}}},"StoreOrderRequest":{"required":["invoice_date","payee","payee_id","email","phone","billing_addr","billing_city","billing_state","billing_zip","shipping_addr","shipping_city","shipping_state","shipping_zip","total","items"],"type":"object","properties":{"invoice_date":{"type":"string","format":"date"},"payee":{"type":"string","description":"Payee name"},"payee_id":{"type":"integer","description":"Payee ID","example":1000},"email":{"type":"string"},"phone":{"type":"string"},"staff_id":{"type":"integer","example":1},"billing_attn":{"type":"string"},"billing_addr":{"type":"string"},"billing_addr_2":{"type":"string"},"billing_addr_3":{"type":"string"},"billing_city":{"type":"string"},"billing_state":{"type":"string"},"billing_zip":{"type":"string"},"shipping_attn":{"type":"string"},"shipping_addr":{"type":"string"},"shipping_addr_2":{"type":"string"},"shipping_addr_3":{"type":"string"},"shipping_city":{"type":"string"},"shipping_state":{"type":"string"},"shipping_zip":{"type":"string"},"rounding":{"type":"number"},"total":{"type":"number"},"tax_inclusive":{"type":"integer"},"payment_term_id":{"type":"integer"},"terms":{"type":"array","items":{"$ref":"#/components/schemas/PaymentTerm"}},"currency":{"$ref":"#/components/schemas/Currency"},"discount":{"$ref":"#/components/schemas/Discount"},"service_charge":{"$ref":"#/components/schemas/ServiceCharge"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Item"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}}}},"PaymentTerm":{"type":"object","properties":{"percent":{"type":"integer"},"due_unit":{"$ref":"#/components/schemas/DueUnit"},"due_num":{"type":"integer"}}},"DueUnit":{"type":"object","properties":{"text":{"type":"string"},"group":{"type":"string"}}},"Currency":{"type":"object","properties":{"iso":{"type":"string"},"exchange_rate":{"type":"number"}}},"ServiceCharge":{"type":"object","properties":{"label":{"type":"string"},"tax":{"type":"number"},"value":{"type":"string"},"tax_amt":{"type":"number"},"total":{"type":"number"}}},"Item":{"required":["item_id","quantity","price","total"],"type":"object","properties":{"item_id":{"type":"integer"},"code":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"string"},"price":{"type":"number"},"unit":{"type":"string"},"tax_label":{"type":"string"},"tax_value":{"type":"string"},"total_tax":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"},"tagging":{"type":"array","items":{"type":"string"}}}},"CustomField":{"required":["key","value"],"type":"object","properties":{"key":{"type":"string"},"printable":{"type":"boolean"},"type":{"type":"string"},"options":{"type":"string"},"value":{"type":"string"}}},"Transaction":{"type":"object","properties":{"id":{"type":"integer","example":1},"ref_num":{"type":"string","example":"OR0001"},"payment_date":{"type":"string","format":"date"},"payment_method":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Bank Transfer"}}},"description":{"type":"string","example":"TRX09819212"},"amount":{"type":"number","example":2000},"currency":{"type":"string","example":"MYR"},"currency_total":{"type":"number","example":2000},"entry":{"type":"string","example":"debit","enum":["debit","credit"]},"status":{"type":"string","example":"pending","enum":["active","pending","approved","reject"]},"payee":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Customer A"}}},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}}},"Cart":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItem"}}}},"CartItem":{"type":"object","properties":{"id":{"type":"integer","description":"product ID"},"name":{"type":"string","description":"product Name"},"quantity":{"type":"number"},"price":{"type":"number"}}},"Coupon":{"type":"object","properties":{"id":{"type":"string","description":"coupon UUID","example":"123e4567-e89b-12d3-a456-426614174000"},"name":{"type":"string","example":"10OFF"},"description":{"type":"string","example":"10% off for all items"},"discount":{"$ref":"#/components/schemas/Discount"}}},"Discount":{"type":"object","properties":{"amount":{"type":"number","example":10},"type":{"type":"string","enum":["percentage","fixed"],"example":"percentage"}}},"StoreSettings":{"type":"object","properties":{"name":{"type":"string","description":"Store name to be displayed","example":"Biztory"},"email":{"type":"string","description":"Store email to be used for sending out email to customers","example":"admin@mystore.com"},"logo":{"type":"string","example":"path/to/file/img.png"},"default_branch_id":{"description":"Default branch ID to be used when creating orders if not specified","type":"integer","example":1},"default_gateway":{"type":"string","example":"manual","description":"Default payment gateway to be selected if not specified"},"default_currency":{"type":"string","example":"MYR","description":"Default currency to be used if not specified"},"default_document_type":{"type":"string","example":"SaleOrder","description":"Default document type to be used when creating orders"},"default_payment_term":{"type":"string","example":"Cash","description":"Default payment term to be used when creating orders if not specified"},"default_staff_id":{"type":"integer","example":1,"description":"Default PIC or staff ID to be used when creating orders if not specified"},"default_author_id":{"type":"integer","example":1,"description":"Default owner or author ID to be used when creating orders if not specified"},"default_source_custom_field":{"type":"object","description":"Default custom field to be used when creating orders if not specified","properties":{"key":{"type":"string","example":"source"},"value":{"type":"string","example":"online"}}},"enable_guest_checkout":{"type":"boolean","example":true,"description":"Enable guest checkout for customers without an account"},"enable_postpaid":{"type":"boolean","example":true,"description":"Allow customers to place orders without payment"},"notifications":{"type":"object","properties":{"order_created":{"description":"List of roles to be sent when order is created","type":"array","items":{"type":"string"},"example":["Admin","Staff"]},"payment_received":{"description":"List of roles to be sent when payment is received","type":"array","items":{"type":"string"},"example":["Admin","Staff"]}}}}},"Attachment":{"type":"object","properties":{"name":{"type":"string","example":"437 Lytton"},"path":{"type":"string","example":"path/to/file/img.png"},"mime_type":{"type":"string","example":"image/png"},"size":{"type":"integer","format":"int64","example":94301}}}},"requestBodies":{"Cart":{"description":"Cart object that needs to be added to the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"}}}},"StoreSettings":{"description":"StoreSettings object that needs to be added to the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreSettings"}}}},"ManualGateway":{"description":"ManualGateway object that needs to be added to the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualGateway"}}}},"StoreOrder":{"description":"StoreOrder object that needs to be added to the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreOrderRequest"}}}},"ManualGatewayCallback":{"description":"Callback object that needs to be added to the store","content":{"application/json":{"schema":{"required":["order_id","ref_num","attachment","payment_method_id","amount","entry","payee_id","payee_type"],"type":"object","properties":{"order_id":{"description":"Order ID associated with this payment","type":"integer","example":2000},"ref_num":{"description":"Ref no. of the order","type":"string","example":"SO0001"},"created_at":{"description":"timestamp of the transaction","type":"string","format":"date-time"},"description":{"type":"string","description":"remark of the transaction","example":"TRX108293"},"attachment":{"$ref":"#/components/schemas/Attachment"},"payment_method_id":{"type":"integer","example":1},"amount":{"type":"number","example":2000},"currency":{"type":"string","example":"MYR"},"currency_total":{"type":"number","example":2000},"entry":{"type":"string","example":"debit","enum":["debit","credit"]},"payee_id":{"type":"integer","example":1},"payee_type":{"type":"string","example":"Customer","enum":["Customer","Vendor"]}}}}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}}