{"openapi":"3.0.3","info":{"title":"Billgate API","version":"v1.14.1 — Developer Preview","description":"![Billgate](https://assets.billme.co.th/static/images/illustration-billgate.png)\n\nยินดีต้อนรับเข้าสู่หน้าเว็บไซต์ผลิตภัณฑ์ Billgate API คุณสามารถเข้าถึงข้อมูลต่าง ๆ ที่จำเป็นต้องใช้สำหรับการเชื่อมต่อระบบ และส่งบิลเรียกเก็บเงินลูกค้าของคุณผ่าน Billgate API\n\n---\n\n## เริ่มต้นเข้าใช้งาน\n1. ทำการสมัครสมาชิกบิลมีที่ [หน้าสมัครสมาชิก](https://register.billme.co.th)\n2. เริ่มต้นสร้างโปรไฟล์ธุรกิจผ่านระบบ Billbox หลังจากยืนยันอีเมลสำเร็จที่ [Billbox Website](https://billbox.billme.co.th)\n3. กรอกข้อมูลเพื่อขอสิทธิ์การเข้าใช้งาน Billgate API ที่ [Billgate API Application Form](https://forms.gle/emSo2jXAssXkPXKD8)\n4. รอการตอบกลับจากทีมงานภายใน 24 ชั่วโมง และเริ่มต้นใช้งาน \n\nหลังจากได้รับการติดต่อกลับจากทางทีมงานแล้วคุณสามารถ เข้าถึง API Token ได้ที่เมนู `การตั้งค่า/Billgate API`\n\n![API Token Page](https://assets.billme.co.th/static/images/api-token-page.png)","contact":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","email":"contact@billme.co.th","url":"https://m.me/billme.co.th"}},"servers":[{"url":"https://api.billme.co.th","description":"Production"},{"url":"https://staging-api.billme.co.th","description":"Preview"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Customers"},{"name":"Invoice Templates"},{"name":"Invoices"},{"name":"Receipts"},{"name":"Recurring Invoices"},{"name":"Tax Invoices"},{"name":"Tokens"}],"paths":{"/v1/tokens/authorized":{"get":{"summary":"Check Billgate API authorization","description":"ตรวจสอบว่าบัญชีผู้ใช้งานได้รับสิทธิ์ใช้งาน Billgate API แล้วหรือไม่","operationId":"checkBillgateAuthorization","tags":["Tokens"],"responses":{"204":{"description":"No Content"}}}},"/v1/tokens/access_token":{"post":{"summary":"Generate Billgate API access token","description":"สร้าง access token สำหรับใช้งาน Billgate API","operationId":"generateBillgateAccessToken","tags":["Tokens"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billgate-Token"},"examples":{"example":{"value":{"access_token":""}}}}}}}},"get":{"summary":"Get Billgate API access token","description":"ดึง access token ปัจจุบันสำหรับใช้งาน Billgate API","operationId":"getBillgateAccessToken","tags":["Tokens"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billgate-Token"},"examples":{"example":{"value":{"access_token":""}}}}}}}}},"/v1/tokens/access_token/revoke":{"post":{"summary":"Revoke Billgate API access token","description":"ยกเลิก access token ปัจจุบันของ Billgate API","operationId":"revokeBillgateAccessToken","tags":["Tokens"],"responses":{"204":{"description":"No Content"}}}},"/v1/invoices":{"post":{"summary":"Create a new Invoice","description":"สำหรับ`สร้างใบแจ้งหนี้` และส่งไปยังลูกค้าของคุณผ่านช่องทาง Email และ Line ลูกค้าของคุณสามารถเปิดดูรายละเอียด และแจ้งการชำระเงินเข้ามาได้ หากมีการใช้งานฟังก์ชัน Instant Payment ลูกค้าของคุณจะสามารถชำระเงินออนไลน์ได้ทันที","operationId":"createInvoice","tags":["Invoices"],"parameters":[{"$ref":"#/components/parameters/CreateInvoiceCustomerIdQuery"}],"requestBody":{"description":"ข้อมูล `JSON` ที่ได้รับกลับไปจะยังไม่สมบูรณ์ เนื่องจาก `pdf_url` จะทำการสร้างและอนุญาตให้ดาวน์โหลดได้ในเวลาต่อมา","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceRequest"},"examples":{"example":{"value":{"customer":{"customer_code":"BG-CUS-001","name":"สมชาย หมายปอง","tax_number":"1012670114029","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}},"number":"INV-000001","name":"ใบเรียกเก็บค่าบริการเดือน มกราคม 2564","issue_date":"2021-01-19","due_date":"2021-01-19","items":[{"description":"ค่าบริการ","quantity":1,"unit_price":1000,"vat_rate":7,"discount_amount":0}],"vat_included":true,"remark":null,"withholding_tax_rate":null,"attachments":["https://example.com/files/invoice-attachment.pdf"]}}}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"},"examples":{"example":{"value":{"id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"INV-000001","status":"pending_payment","issue_date":"2021-01-25","due_date":"2021-02-15","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.mock@gmail.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":1392.52,"total":1490,"withholding_tax":{"rate":0,"amount":0},"paid_amount":1490,"remark":null,"payment_methods":[{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","number":"1002012896","type":"BANK"}],"payment":null,"pdf_url":null,"shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"receipt_id":null,"tax_invoice_id":null},"qrcode":null}}}}}}}},"get":{"summary":"List existing Invoices","operationId":"listInvoices","tags":["Invoices"],"description":"เรียกดูรายการใบแจ้งหนี้ที่มีอยู่ในระบบ","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/status"},{"$ref":"#/components/parameters/start"},{"$ref":"#/components/parameters/end"},{"$ref":"#/components/parameters/payment_start"},{"$ref":"#/components/parameters/payment_end"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInvoices200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"","name":"","number":"","status":"created","issue_date":"","due_date":"","merchant":{"name":"","phone":"","email":"","address":""},"customer":{"name":"","tax_number":null,"phone":"","emails":[""],"address":""},"items":[{"description":"","quantity":0,"unit_price":0,"total_item_price":0,"vat_rate":0,"discount_amount":0}],"subtotal":0,"total_discount_amount":0,"vat":{"is_included":true,"rate":0,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment_methods":[{"name":"","number":"","type":""}],"payment":{"paid_date":"","amount":0},"pdf_url":null,"shareable_url":"https://example.com","attachments":[{"name":"","url":""}],"references":{"receipt_id":null,"tax_invoice_id":null},"qrcode":null}]}}}}}}}}},"/v1/invoices/{invoiceId}/paid":{"post":{"summary":"Confirm Paid Payment on an existing Invoice","description":"สำหรับอัปเดทสถานะของใบแจ้งหนี้เป็น`ชำระแล้ว`","operationId":"confirmPaidPaymentInvoice","tags":["Invoices"],"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"}],"requestBody":{"description":"","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPaidPaymentInvoiceRequest"},"examples":{"example":{"value":{"date_time":"2021-01-19 13:00:00","amount":1000}}}}}},"responses":{"201":{"description":"Created"}}}},"/v1/invoices/{invoiceId}/decline_payment":{"post":{"summary":"Decline Payment on an existing Invoice","description":"สำหรับปฏิเสธการแจ้งชำระเงินของใบแจ้งหนี้","operationId":"declinePaymentInvoice","tags":["Invoices"],"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath2"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclinePaymentInvoiceRequest"},"examples":{"example":{"value":{"reason":"ยอดเงินไม่ถูกต้อง","metadata":{}}}}}}},"responses":{"201":{"description":"Created"}}}},"/v1/invoices/{invoiceId}/transition_logs":{"get":{"summary":"List Invoice Transition Logs","description":"สำหรับเรียกดูประวัติการเปลี่ยนสถานะของใบแจ้งหนี้","operationId":"listInvoiceTransitionLogs","tags":["Invoices"],"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath3"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Transition-Logs"},"examples":{"example":{"value":{"data":[{"id":"","invoice_id":"","from_status":null,"to_status":"","transitioned_by_type":"","transitioned_by_id":null,"transitioned_by":{"id":null,"name":null},"reason":null,"metadata":{},"created_at":""}]}}}}}}}}},"/v1/invoices/{invoiceId}":{"get":{"summary":"Get an existing Invoice","description":"สำหรับดึงข้อมูลรายละเอียดใบแจ้งหนี้ที่ต้องการ","operationId":"getInvoiceById","tags":["Invoices"],"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath4"}],"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"},"examples":{"example":{"value":{"id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"INV-000001","status":"pending_payment","issue_date":"2021-01-25","due_date":"2021-02-15","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":1392.52,"total":1490,"withholding_tax":{"rate":0,"amount":0},"paid_amount":1490,"remark":null,"payment_methods":[{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","number":"1002012896","type":"BANK"}],"payment":{"paid_date":"2021-02-01 16:04:11","amount":1490},"pdf_url":"https://storage.googleapis.com/billhub/production/invoices/98FE9D3919179914713340F7A705A4F2/INV63000027.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"},"qrcode":null}}}}}}}},"delete":{"summary":"Delete an existing Invoice","operationId":"deleteInvoiceById","tags":["Invoices"],"description":"สำหรับ`ลบใบแจ้งหนี้`ที่ไม่ต้องการออกจากระบบ การลบใบแจ้งหนี้จะทำให้ลูกค้าไม่สามารถเข้าถึงหน้ารายละเอียดของใบแจ้งหนี้ได้","parameters":[{"$ref":"#/components/parameters/InvoiceIdPath5"}],"responses":{"204":{"description":"No Content"}}}},"/v1/recurring_invoices":{"get":{"summary":"List existing Recurring Invoices","tags":["Recurring Invoices"],"operationId":"listRecurringInvoices","description":"เรียกดูรายการ`ใบแจ้งหนี้อัตโนมัติ`ที่มีในระบบ","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/customer_id"},{"$ref":"#/components/parameters/template_id"},{"$ref":"#/components/parameters/ListRecurringInvoicesStatusQuery"}],"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecurringInvoices200ResponseBody"},"examples":{"recurring-invoices.json":{"value":{"total":1,"next":null,"previous":null,"recurring_invoices":[{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","status":"active","payment_policy":"fully_paid","installments":[],"invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":1,"cycle":3,"canceled_at":null,"created_at":"2021-08-05 16:55:00"}]}}}}}}}},"post":{"summary":"Create a new Recurring Invoice","operationId":"createRecurringInvoice","description":"สร้าง`ใบแจ้งหนี้อัตโนมัติ`ใหม่","security":[{"ApiKeyAuth":[]}],"tags":["Recurring Invoices"],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecurringInvoiceRequest"},"examples":{"fully-paid.json":{"value":{"invoice_template_id":"c6f3f207-169d-481c-882c-f50c5b85626d","customer_id":"1137d03a3ee24f1ca31dfae41a4cf600","number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","cycle":3,"payment_policy":"fully_paid","installments":[]}},"installment.json":{"value":{"invoice_template_id":"c6f3f207-169d-481c-882c-f50c5b85626d","customer_id":"1137d03a3ee24f1ca31dfae41a4cf600","number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","cycle":4,"payment_policy":"installment","installments":[{"installment":1,"amount":1500},{"installment":2,"amount":1500},{"installment":3,"amount":1500},{"installment":4,"amount":400}]}}}}},"required":false},"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recurring-Invoice"},"examples":{"fully-paid.json":{"value":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","payment_policy":"fully_paid","installments":[],"invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":1,"cycle":3,"canceled_at":null,"created_at":"2021-08-05 16:55:00"}},"installment.json":{"value":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","payment_policy":"fully_paid","cycle":4,"installments":[{"installment":1,"amount":1500},{"installment":2,"amount":1500},{"installment":3,"amount":1500},{"installment":4,"amount":400}],"invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"ผ่อนชำระสินค้าชิ้นใหญ่","number":"REC2021080001","amount":4900},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":1,"canceled_at":null,"created_at":"2021-08-05 16:55:00"}}}}}}}}},"/v1/recurring_invoices/{recurringInvoiceId}":{"get":{"summary":"Get an existing Recurring Invoice","tags":["Recurring Invoices"],"operationId":"getRecurringInvoiceById","description":"เรียกดู`ใบแจ้งหนี้อัตโนมัติ`ที่สร้างไว้","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/RecurringInvoiceIdPath"}],"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recurring-Invoice"},"examples":{"recurring-invoice.json":{"value":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","status":"active","invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","payment_policy":"fully_paid","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":0,"cycle":3,"installments":[],"canceled_at":null,"created_at":"2021-08-05 16:55:00"}}}}}}}},"delete":{"summary":"Cancel an existing Recurring Invoice","operationId":"cancelRecurringInvoiceById","description":"ยกเลิกการส่ง`ใบแจ้งหนี้อัตโนัมัติ`","security":[{"ApiKeyAuth":[]}],"tags":["Recurring Invoices"],"parameters":[{"$ref":"#/components/parameters/RecurringInvoiceIdPath2"}],"responses":{"204":{"description":"No Content"}}}},"/v1/receipts":{"post":{"summary":"Create a new Receipt","description":"สำหรับ`สร้างใบเสร็จ` และส่งหาลูกค้าผ่านช่องทาง Email และ Line","operationId":"createReceipt","tags":["Receipts"],"parameters":[{"$ref":"#/components/parameters/CreateReceiptCustomerIdQuery"}],"requestBody":{"description":"","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReceiptRequest"},"examples":{"example":{"value":{"invoice_id":null,"number":"RCP-000001","data":{"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}},"issue_date":"2021-01-19","name":"ใบเรียกเก็บค่าบริการเดือน มกราคม 2564","items":[{"description":"ค่าบริการ","quantity":1,"unit_price":1000,"vat_rate":7,"discount_amount":0}],"vat_included":true,"remark":null,"withholding_tax_rate":null}}},"example-2":{"value":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","number":"RCP-000001","data":null}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReceipt200ResponseBody"},"examples":{"example-1":{"value":{"receipt_id":"string"}}}}}}}},"get":{"summary":"List existing Receipts","operationId":"listReceipts","security":[{"ApiKeyAuth":[]}],"tags":["Receipts"],"description":"เรียกดูรายการใบเสร็จที่มีอยู่ในระบบ","parameters":[{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListReceipts200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"b4d611db-3980-44ef-a64c-22410c3fde46","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"REC-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/1012670114029/5b8408_Receipt_RCP63000005.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"}}]}}}}}}}}},"/v1/receipts/{receiptId}":{"get":{"summary":"Get an existing Receipt","description":"สำหรับดึงรายละเอียดข้อมูลของใบเสร็จที่ต้องการ","operationId":"getReceiptById","tags":["Receipts"],"parameters":[{"$ref":"#/components/parameters/ReceiptIdPath"}],"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"},"examples":{"example":{"value":{"id":"b4d611db-3980-44ef-a64c-22410c3fde46","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"REC-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/1012670114029/5b8408_Receipt_RCP63000005.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"}}}}}}}}},"delete":{"summary":"Delete an existing Receipt","operationId":"deleteReceiptById","tags":["Receipts"],"description":"สำหรับ`ลบใบเสร็จ`ที่ไม่ต้องการออกจากระบบ การลบใบเสร็จจะทำให้ลูกค้าไม่สามารถเข้าถึงหน้ารายละเอียดของใบเสร็จได้","parameters":[{"$ref":"#/components/parameters/ReceiptIdPath2"}],"responses":{"204":{"description":"No Content"}}}},"/v1/tax_invoices":{"post":{"summary":"Create a new Tax Invoice","description":"สำหรับ`สร้างใบกำกับภาษี` และส่งหาลูกค้าผ่านช่องทาง Email และ Line","operationId":"createTaxInvoice","tags":["Tax Invoices"],"parameters":[{"$ref":"#/components/parameters/CreateTaxInvoiceCustomerIdQuery"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaxInvoiceRequest"},"examples":{"example":{"value":{"number":"TAX-000001","invoice_id":null,"receipt_id":null,"data":{"customer":{"customer_code":"BG-CUS-001","name":"สมชาย หมายปอง","tax_number":"1012670114029","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}},"issue_date":"2021-01-19","items":[{"description":"ค่าบริการ","quantity":1,"unit_price":1,"vat_rate":7,"discount_amount":0}],"vat_included":true,"remark":null,"withholding_tax_rate":null},"attachments":["https://example.com/files/tax-invoice-attachment.pdf"]}},"example-2":{"value":{"number":"TAX-000001","invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":null,"data":null}},"example-3":{"value":{"number":"TAX-000001","invoice_id":null,"receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46","data":null}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaxInvoice200ResponseBody"},"examples":{"example":{"value":{"tax_invoice_id":""}}}}}}}},"get":{"summary":"List existing Tax Invoices","operationId":"listTaxInvoices","description":"เรียกดูรายการใบแจ้งหนี้/ใบกำกับภาษี","security":[{"ApiKeyAuth":[]}],"tags":["Tax Invoices"],"parameters":[{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTaxInvoices200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"a5873c97-7c21-407d-b561-c2ece8de6389","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"TAX-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/tax_invoices/fa0da2a9ba3bcc08e6d2b785ba4ecaac/TAX63000001.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46"}}]}}}}}}}}},"/v1/tax_invoices/{taxInvoiceId}":{"get":{"summary":"Get an existing Tax Invoice","description":"สำหรับดึงข้อมูลของใบกำกับภาษีที่ต้องการ","operationId":"getTaxInvoiceById","tags":["Tax Invoices"],"parameters":[{"$ref":"#/components/parameters/TaxInvoiceIdPath"}],"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tax-Invoice"},"examples":{"example":{"value":{"id":"a5873c97-7c21-407d-b561-c2ece8de6389","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"TAX-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/tax_invoices/fa0da2a9ba3bcc08e6d2b785ba4ecaac/TAX63000001.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46"}}}}}}}}},"delete":{"summary":"Delete an existing Tax Invoice","operationId":"deleteTaxInvoiceById","tags":["Tax Invoices"],"description":"สำหรับลบใบกำกับภาษีที่ไม่ต้องการออกจากระบบ การลบใบกำกับภาษีจะทำให้ลูกค้าไม่สามารถเข้าถึงหน้ารายละเอียดของใบกำกับภาษีได้","parameters":[{"$ref":"#/components/parameters/TaxInvoiceIdPath2"}],"responses":{"204":{"description":"No Content"}}}},"/v1/customers":{"get":{"summary":"List existing Customers","tags":["Customers"],"operationId":"listCustomers","security":[{"ApiKeyAuth":[]}],"description":"สำหรับเรียกดู`รายการลูกค้า`ที่มีในบริษัททั้งหมด","parameters":[{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/CustomerCodeQuery"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCustomers200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"","alias":"","tax_number":"0000000000000","branch_number":"00000","phone_number":"0800000000,0900000000","emails":"contact@example.com","address":{"house_number":"","sub_district":"","district":"","province":"","post_code":""}}]}}}}}}}},"post":{"tags":["Customers"],"summary":"Create a new Customer","operationId":"createCustomer","description":"สำหรับ`สร้างรายชื่อลูกค้าใหม่`","security":[{"ApiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Request"},"examples":{"example":{"value":{"type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","customer_code":"BG-CUS-001","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}},"required":false},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Response"},"examples":{"example":{"value":{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}}}}},"/v1/customers/{customerId}":{"get":{"summary":"Get an existing Customer","tags":["Customers"],"operationId":"getCustomerById","description":"สำหรับดึงข้อมูลลูกค้าตาม`id` ที่ระบุ","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/CustomerIdPath"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Response"},"examples":{"example":{"value":{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}}}},"put":{"summary":"Update an existing Customer","operationId":"updateCustomerById","description":"`แก้ไขข้อมูลลูกค้า`รายบุคคล","security":[{"ApiKeyAuth":[]}],"tags":["Customers"],"parameters":[{"$ref":"#/components/parameters/CustomerIdPath2"}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Request"},"examples":{"example":{"value":{"type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","customer_code":"BG-CUS-001","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}},"required":false},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Response"},"examples":{"example":{"value":{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}}}},"delete":{"summary":"Delete an existing Customer","operationId":"deleteCustomerById","description":"`ลบข้อมูลลูกค้า`ที่ไม่ต้องการ","tags":["Customers"],"parameters":[{"$ref":"#/components/parameters/CustomerIdPath3"}],"responses":{"204":{"description":"No Content"}}}},"/v1/templates/invoices":{"get":{"summary":"List existing Invoice Templates","tags":["Invoice Templates"],"operationId":"listInvoiceTemplates","description":"เรียกดูรายการ`รูปแบบใบแจ้งหนี้`ที่สร้างไว้","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInvoiceTemplates200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"invoice_templates":[{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}]}}}}}}}},"post":{"summary":"Create a new Invoice Template","operationId":"createInvoiceTemplate","description":"สร้าง`รูปแบบใบแจ้งหนี้`ใหม่","security":[{"ApiKeyAuth":[]}],"tags":["Invoice Templates"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceTemplateRequest"},"examples":{"request.json":{"value":{"name":"ค่าบริการสำนักงานรายเดือน","number":"TEM202108001","items":[{"description":"บริการทำความสะอาดรายสัปดาห์","quantity":1,"price_per_item":399,"vat_rate":0.07,"discount":{"type":"money","total":50}},{"description":"ค่าบริการตู้จดหมาย","quantity":1,"price_per_item":99,"vat_rate":0.07,"discount":null}],"remark":"กรุณาชำระภายใน 30 วันหลังจากได้รับใบแจ้งหนี้","withholding_tax":{"on":true,"rate":0.03},"is_vat_included":false,"due_date_term":30}}}}},"required":false},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Template-Response"},"examples":{"response.json":{"value":{"id":"44cf6f8f-77f9-4a3d-9d4f-ba7d2c3126a5","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"TEM202108001","template":{"name":"ค่าบริการสำนักงานรายเดือน","items":[{"description":"บริการทำความสะอาดรายสัปดาห์","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":22.83177570093458},"discount":{"rate":null,"amount":50}},{"description":"ค่าบริการตู้จดหมาย","quantity":1,"price_per_item":99,"vat":{"rate":7,"amount":6.4766355140186915},"discount":null}],"remark":"กรุณาชำระภายใน 30 วันหลังจากได้รับใบแจ้งหนี้","due_date_term":30,"discount":{"on":true,"percentage":0,"amount":50},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":29.31},"withholding_tax":{"on":true,"rate":0.03,"amount":12.56},"vat_exempted_amount":0,"taxable_sales_amount":418.69,"net_amount":418.69,"items_amount":498,"total_amount":448,"gross_amount":435.44},"created_at":"2021-08-06 09:24:04","updated_at":"2021-08-06 09:24:04"}}}}}}}}},"/v1/templates/invoices/{invoiceTemplateId}":{"get":{"summary":"Get an existing Invoice Template","tags":["Invoice Templates"],"operationId":"getInvoiceTemplate","description":"เรียกดู`รูปแบบใบแจ้งหนี้`","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/InvoiceTemplateIdPath"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Template-Response"},"examples":{"invoice-template.json":{"value":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}}}}}}}},"put":{"summary":"Update an existing Invoice Template","operationId":"updateInvoiceTemplate","tags":["Invoice Templates"],"description":"อัพเดทโครงสร้าง`รูปแบบใบแจ้งหนี้`","security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/InvoiceTemplateIdPath2"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceTemplateRequest"},"examples":{"example":{"value":{"name":"ค่าบริการสำนักงานรายเดือน","number":"TEM202108001","items":[{"description":"บริการทำความสะอาดรายสัปดาห์","quantity":1,"price_per_item":399,"vat_rate":0.07,"discount":{"type":"money","total":50}},{"description":"ค่าบริการตู้จดหมาย","quantity":1,"price_per_item":99,"vat_rate":0.07,"discount":null}],"remark":"กรุณาชำระภายใน 30 วันหลังจากได้รับใบแจ้งหนี้","withholding_tax":{"on":true,"rate":0.03},"is_vat_included":false,"due_date_term":30}}}}},"required":false},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Template-Response"},"examples":{"invoice-template.json":{"value":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}}}}}}}},"delete":{"summary":"Delete an existing Invoice Template","operationId":"deleteInvoiceTemplate","description":"ลบ`รูปแบบใบแจ้งหนี้`","security":[{"ApiKeyAuth":[]}],"tags":["Invoice Templates"],"parameters":[{"$ref":"#/components/parameters/InvoiceTemplateIdPath3"}],"responses":{"204":{"description":"No Content"}}}}},"components":{"schemas":{"Billgate-Token":{"title":"Billgate Token","type":"object","x-tags":["Tokens"],"properties":{"access_token":{"type":"string","description":"access token สำหรับใช้งาน Billgate API"}},"required":["access_token"]},"Invoice-Transition-Logs":{"title":"Invoice Transition Logs","type":"object","x-tags":["Invoices"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"id ของ transition log"},"invoice_id":{"type":"string","description":"id ของใบแจ้งหนี้"},"from_status":{"type":"string","description":"สถานะก่อนหน้า","nullable":true},"to_status":{"type":"string","description":"สถานะหลังการเปลี่ยนแปลง"},"transitioned_by_type":{"type":"string","description":"ประเภทผู้เปลี่ยนสถานะ"},"transitioned_by_id":{"type":"string","description":"id ของผู้เปลี่ยนสถานะ","nullable":true},"transitioned_by":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}}},"reason":{"type":"string","description":"เหตุผลของการเปลี่ยนสถานะ","nullable":true},"metadata":{"type":"object","description":"ข้อมูลเพิ่มเติมของการเปลี่ยนสถานะ"},"created_at":{"type":"string","description":"วันที่สร้าง transition log"}},"required":["id","invoice_id","to_status","transitioned_by_type","transitioned_by","metadata","created_at"]}}},"required":["data"]},"Customer-Response":{"title":"Customer Response","type":"object","description":"ข้อมูลลูกค้าสำหรับส่งใบแจ้งหนี้และเอกสารอื่น ๆ","x-examples":{},"x-tags":["Customers"],"properties":{"id":{"type":"string","description":"id ของลูกค้า","maxLength":32,"example":"2bd61a952455483583b89dd53a937ef6"},"type":{"type":"string","description":"ประเภทของลูกค้า (บุคคลธรรมดา, นิติบุคคล)","enum":["individual","corporate"]},"name":{"type":"string","description":"ชื่อสำหรับออกเอกสาร","maxLength":140},"alias":{"type":"string","description":"ชื่อเรียกแทน/ชื่อย่อ","maxLength":140},"tax_number":{"type":"string","description":"เลขรหัสประชาชน/เลขนิติบุคคล","minLength":13,"maxLength":13,"example":"0000000000000"},"branch_number":{"type":"string","description":"รหัสสาขา 5 หลัก (หากเป็นบุคคลธรรมดาจะเป็น 00000)","example":"00000","minLength":5,"maxLength":5},"phone_number":{"type":"string","maxLength":30,"description":"หมายเลขโทรศัพท์ (หากมีมากกว่า 1 หมายเลข ให้ใส่ `,` คั่น)","example":"0800000000,0900000000"},"emails":{"type":"string","pattern":"^[a-zA-Z0-9\\.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$","description":"อีเมล","format":"email"},"address":{"$ref":"#/components/schemas/Address"}},"required":["id","type","name","emails","address"]},"Address":{"title":"Address","type":"object","description":"ข้อมูลประเภทที่อยู่ หากไม่มีข้อมูลในแต่ละ field ให้ใส่มาเป็น empty string","x-tags":["Customers"],"properties":{"house_number":{"type":"string","description":"เลขที่","maxLength":140},"sub_district":{"type":"string","description":"ตำบล/แขวง","maxLength":30},"district":{"type":"string","description":"อำเภอ/เขต","maxLength":30},"province":{"type":"string","description":"จังหวัด","maxLength":30},"post_code":{"type":"string","description":"รหัสไปรษณีย์","maxLength":5,"minLength":5}},"required":["house_number","sub_district","district","province","post_code"]},"Customer-Request":{"title":"Customer Request","type":"object","x-tags":["Customers"],"description":"ข้อมูลประเภท `JSON` เมื่อทำ operation `POST` หรือ `PUT`","properties":{"type":{"type":"string","description":"ประเภทของลูกค้า (บุคคลธรรมดา, นิติบุคคล)","enum":["individual","corporate"]},"name":{"type":"string","description":"ชื่อสำหรับออกเอกสาร","maxLength":140},"alias":{"type":"string","description":"ชื่อเรียกแทน/ชื่อย่อ","maxLength":140,"nullable":true},"tax_number":{"type":"string","description":"เลขรหัสประชาชน/เลขนิติบุคคล","minLength":13,"maxLength":13,"example":"0000000000000","nullable":true},"branch_number":{"type":"string","description":"รหัสสาขา 5 หลัก (หากเป็นบุคคลธรรมดาจะเป็น 00000)","example":"00000","minLength":5,"maxLength":5,"nullable":true},"phone_number":{"type":"string","maxLength":30,"description":"หมายเลขโทรศัพท์ (หากมีมากกว่า 1 หมายเลข ให้ใส่ `,` คั่น)","example":"0800000000,0900000000","nullable":true},"customer_code":{"type":"string","description":"รหัสลูกค้าสำหรับอ้างอิงและค้นหาลูกค้า","maxLength":64,"example":"BG-CUS-001","nullable":true},"emails":{"type":"array","description":"อีเมล","format":"email","items":{"type":"string"}},"address":{"$ref":"#/components/schemas/Address"}},"required":["type","name","emails","address"]},"Invoice":{"description":"โครงสร้างข้อมูล `JSON` สำหรับข้อมูลประเภท`ใบแจ้งหนี้`","type":"object","x-tags":["Invoices"],"title":"Invoice","properties":{"id":{"type":"string","description":"invoice id ของใบแจ้งหนี้"},"name":{"type":"string","description":"อ้างอิง / โปรเจค"},"number":{"type":"string","description":"เลขที่ใบแจ้งหนี้"},"status":{"type":"string","enum":["created","pending_payment","pending_approval","paid"],"description":"สถานะการชำระเงิน"},"issue_date":{"type":"string","description":"วันที่ออกเอกสาร"},"due_date":{"type":"string","description":"วันที่ครบกำหนดชำระ"},"merchant":{"type":"object","description":"ข้อมูลธุรกิจของคุณ","required":["name","phone","email","address"],"properties":{"name":{"type":"string","description":"ชื่อธุรกิจ"},"phone":{"type":"string","description":"เบอรโทรศัพท์"},"email":{"type":"string","description":"Email ของธุรกิจ"},"address":{"type":"string","description":"ที่อยู่ธุรกิจ"}}},"customer":{"type":"object","description":"ข้อมูลลูกค้า","required":["name","tax_number","phone","emails","address"],"properties":{"name":{"type":"string","description":"ชื่อลูกค้า"},"tax_number":{"type":"string","description":"เลขที่ผู้เสียภาษี","nullable":true},"phone":{"type":"string","description":"เบอร์โทรศัพท์"},"emails":{"type":"array","description":"Email ของลูกค้า","items":{"type":"string"}},"address":{"type":"string","description":"ที่อยู่ลูกค้า"}}},"items":{"type":"array","uniqueItems":true,"minItems":1,"description":"รายการสินค้า","items":{"type":"object","properties":{"description":{"type":"string","description":"ชื่อสินค้า"},"quantity":{"type":"number","description":"จำนวน"},"unit_price":{"type":"number","description":"ราคา/หน่วย"},"total_item_price":{"type":"number","description":"สรุปราคาสินค้า"},"vat_rate":{"type":"number","description":"อัตราภาษีมูลค่าเพิ่ม"},"discount_amount":{"type":"number","description":"มูลค่าส่วนลด"}},"required":["description","quantity","unit_price","total_item_price","discount_amount"]}},"subtotal":{"type":"number","description":"รวมราคาสินค้าทั้งหมด"},"total_discount_amount":{"type":"number","description":"มูลค่าส่วนลดทั้งหมด"},"vat":{"type":"object","description":"ภาษีมูลค่าเพิ่ม","required":["is_included","rate","amount"],"properties":{"is_included":{"type":"boolean","description":"การรวมภาษีมูลค่าเพิ่มลงไปในราคาสินค้า"},"rate":{"type":"number","description":"อัตราภาษีมูลค่าเพิ่ม"},"amount":{"type":"number","description":"มูลค่าภาษี"}}},"vat_exempted_amount":{"type":"number","description":"มูลค่าสินค้าที่ไม่ต้องเสียภาษี"},"taxable_sales_amount":{"type":"number","description":"มูลค่าสินค้าที่เสียภาษี"},"total":{"type":"number","description":"ราคาหลังรวมภาษี"},"withholding_tax":{"type":"object","description":"ภาษีหัก ณ ที่จ่าย","required":["rate","amount"],"properties":{"rate":{"type":"number","description":"อัตราภาษีหัก ณ ที่จ่าย"},"amount":{"type":"number","description":"มูลค่าภาษีหัก ณ ที่จ่าย"}}},"paid_amount":{"type":"number","description":"จำนวนเงินที่ต้องชำระ (ราคาหลังรวมภาษี - ภาษีหัก ณ ที่จ่าย)"},"remark":{"type":"string","description":"หมายเหตุ","nullable":true},"payment_methods":{"type":"array","uniqueItems":true,"description":"ช่องทางการชำระเงิน","items":{"type":"object","properties":{"name":{"type":"string","description":"ชื่อบัญชีที่รับชำระ"},"number":{"type":"string","description":"เลขที่บัญชี"},"type":{"type":"string"}},"required":["name","number","type"]}},"payment":{"type":"object","description":"การชำระเงิน","required":["paid_date","amount"],"properties":{"paid_date":{"type":"string","description":"วันที่ชำระเงิน"},"amount":{"type":"number","description":"จำนวนเงินที่ชำระ"}},"nullable":true},"pdf_url":{"type":"string","description":"ลิงก์ PDF ของใบแจ้งหนี้","format":"uri","nullable":true},"shareable_url":{"type":"string","description":"ลิงก์สำหรับให้ลูกค้าหรือบุคคลภายนอกเข้าดูข้อมูลเอกสาร","format":"uri"},"attachments":{"type":"array","uniqueItems":true,"description":"รายการไฟล์แนบ","items":{"type":"object","properties":{"name":{"type":"string","description":"ชื่อไฟล์แนบ"},"url":{"type":"string","description":"ลิงก์สำหรับดาวน์โหลดไฟล์แนบ"}},"required":["name","url"]}},"references":{"type":"object","description":"เอกสารที่เกี่ยวข้อง","required":["receipt_id","tax_invoice_id"],"properties":{"receipt_id":{"type":"string","minLength":1,"description":"receipt id ของใบเสร็จที่เกี่ยวข้องกับใบแจ้งหนี้ฉบับนี้","nullable":true},"tax_invoice_id":{"type":"string","minLength":1,"description":"tax invoice id ของใบกำกับภาษีที่เกี่ยวข้องกับใบแจ้งหนี้ฉบับนี้","nullable":true}}},"qrcode":{"type":"string","description":"พร้อมเพย์ QR Code ในรูปแบบของ Base64 Image","nullable":true}},"required":["id","name","number","status","issue_date","due_date","merchant","customer","items","subtotal","total_discount_amount","vat","vat_exempted_amount","taxable_sales_amount","total","withholding_tax","paid_amount","payment_methods","payment","pdf_url","shareable_url","attachments","references","qrcode"]},"Receipt":{"title":"Receipt","type":"object","x-tags":["Receipts"],"description":"โครงสร้างข้อมูล `JSON` สำหรับข้อมูลประเภท`ใบเสร็จ`","x-examples":{"example":{"id":"b4d611db-3980-44ef-a64c-22410c3fde46","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"REC-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/1012670114029/5b8408_Receipt_RCP63000005.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"}}},"properties":{"id":{"type":"string","minLength":1,"description":"id ของใบเสร็จที่ต้องการดึงข้อมูล"},"name":{"type":"string","minLength":1,"description":"อ้างอิง / โปรเจค"},"number":{"type":"string","minLength":1,"description":"เลขที่ใบเสร็จ"},"issue_date":{"type":"string","minLength":1,"description":"วันที่ออกเอกสาร"},"merchant":{"type":"object","description":"รายละเอียดธุรกิจของคุณ","required":["name","phone","email","address"],"properties":{"name":{"type":"string","minLength":1,"description":"ชื่อธุรกิจ"},"phone":{"type":"string","minLength":1,"description":"เบอร์โทรศัพท์"},"email":{"type":"string","minLength":1,"description":"Email ของธุรกิจ"},"address":{"type":"string","minLength":1,"description":"ที่อยู่ธุรกิจ"}}},"customer":{"type":"object","description":"รายละเอียดลูกค้า","required":["name","tax_number","phone","emails","address"],"properties":{"name":{"type":"string","minLength":1,"description":"ชื่อลูกค้า"},"tax_number":{"type":"string","minLength":1,"description":"เลขที่ผู้เสียภาษี"},"phone":{"type":"string","minLength":1,"description":"เบอร์โทรศัพท์"},"emails":{"type":"array","description":"Email ของลูกค้า","items":{"type":"string"}},"address":{"type":"string","minLength":1,"description":"ที่อยู่"}}},"items":{"type":"array","uniqueItems":true,"minItems":1,"description":"รายการสินค้า / บริการ","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"description":"ชื่อสินค้า / บริการ"},"quantity":{"type":"number","description":"จำนวน"},"unit_price":{"type":"number","description":"ราคาสินค้า/หน่วย"},"total_item_price":{"type":"number","description":"สรุปราคาสินค้า"},"vat_rate":{"type":"number","description":"อัตราษีมูลค่าเพิ่ม"},"discount_amount":{"type":"number","description":"มูลค่าส่วนลดของสินค้า"}},"required":["description","quantity","unit_price","total_item_price","vat_rate","discount_amount"]}},"subtotal":{"type":"number","description":"รวมราคาสินค้าทั้งหมด"},"total_discount_amount":{"type":"number","description":"รวมมูลค่าส่วนลดทั้งหมด"},"vat":{"type":"object","description":"ภาษีมูลค่าเพิ่ม","required":["is_included","rate","amount"],"properties":{"is_included":{"type":"boolean","description":"การรวมภาษีมูลค่าเพิ่มลงไปในราคาสินค้า"},"rate":{"type":"number","description":"อัตราภาษีมูลค่าเพิ่ม"},"amount":{"type":"number","description":"มูลค่าภาษี"}}},"vat_exempted_amount":{"type":"number","description":"มูลค่าสินค้า/บริการที่ได้รับการยกเว้นภาษี"},"taxable_sales_amount":{"type":"number","description":"มูลค่าสินค้า/บริการที่เสียภาษี"},"total":{"type":"number","description":"ราคาหลังรวมภาษี"},"withholding_tax":{"type":"object","description":"ภาษีหัก ณ ที่จ่าย","required":["rate","amount"],"properties":{"rate":{"type":"number","description":"อัตราภาษีหัก ณ ที่จ่าย"},"amount":{"type":"number","description":"มูลค่าภาษีหัก ณ ที่จ่าย"}}},"paid_amount":{"type":"number","description":"จำนวนเงินที่ต้องชำระ (ราคาหลังรวมภาษี - ภาษีหัก ณ ที่จ่าย)"},"remark":{"type":"string","description":"หมายเหตุ","nullable":true},"payment":{"type":"object","description":"การชำระเงิน","properties":{"paid_date":{"type":"string","description":"วันที่ชำระเงิน"},"amount":{"type":"number","description":"จำนวนเงินที่ชำระ"}},"required":["paid_date","amount"],"nullable":true},"pdf_url":{"type":"string","minLength":1,"description":"ลิงก์สำหรับดาวน์โหลด PDF ใบเสร็จ","nullable":true},"shareable_url":{"type":"string","description":"ลิงก์สำหรับให้ลูกค้าหรือบุคคลภายนอกเข้าดูข้อมูลเอกสาร","format":"uri"},"attachments":{"type":"array","description":"ไฟล์แนบ","items":{"type":"object","properties":{"name":{"type":"string","description":"ชื่อไฟล์แนบ"},"url":{"type":"string","description":"ลิงก์สำหรับดาวน์โหลดไฟล์แนบ"}}}},"references":{"type":"object","description":"เอกสารที่เกี่ยวข้อง","required":["invoice_id","tax_invoice_id"],"properties":{"invoice_id":{"type":"string","minLength":1,"description":"id ของใบแจ้งหนี้ที่เกี่ยวข้องกับใบเสร็จฉบับนี้"},"tax_invoice_id":{"type":"string","minLength":1,"description":"id ใบกำกับภาษีที่เกี่ยวข้องกับใบเสร็จรายการนี้"}}}},"required":["id","name","number","issue_date","merchant","customer","items","subtotal","total_discount_amount","vat","vat_exempted_amount","taxable_sales_amount","total","withholding_tax","paid_amount","pdf_url","shareable_url","attachments","references"]},"Tax-Invoice":{"title":"Tax Invoice","type":"object","x-tags":["Tax Invoices"],"x-examples":{"example":{"id":"a5873c97-7c21-407d-b561-c2ece8de6389","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"TAX-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/tax_invoices/fa0da2a9ba3bcc08e6d2b785ba4ecaac/TAX63000001.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46"}}},"properties":{"id":{"type":"string","minLength":1,"description":"id ใบกำกับภาษี"},"name":{"type":"string","minLength":1,"description":"ชื่ออ้างอิง / โปรเจค"},"number":{"type":"string","minLength":1,"description":"เลขที่ใบกำกับภาษี"},"issue_date":{"type":"string","minLength":1,"description":"วันที่ออกเอกสาร"},"merchant":{"type":"object","description":"ข้อมูลธุรกิจของคุณ","required":["name","phone","email","address"],"properties":{"name":{"type":"string","minLength":1,"description":"ชื่อธุรกิจ"},"phone":{"type":"string","minLength":1,"description":"เบอร์โทรศัพท์"},"email":{"type":"string","minLength":1,"description":"Email ของธุรกิจ"},"address":{"type":"string","minLength":1,"description":"ที่อยู่"}}},"customer":{"type":"object","description":"ข้อมูลลูกค้า","required":["name","tax_number","phone","emails","address"],"properties":{"name":{"type":"string","minLength":1,"description":"ชื่อลูกค้า"},"tax_number":{"type":"string","minLength":1,"description":"เลขที่ผู้เสียภาษี"},"phone":{"type":"string","minLength":1,"description":"เบอร์โทรศัพท์"},"emails":{"type":"array","description":"Email ของลูกค้า","items":{"type":"string"}},"address":{"type":"string","minLength":1,"description":"ที่อยู่"}}},"items":{"type":"array","uniqueItems":true,"minItems":1,"description":"รายการสินค้า","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"description":"ชื่อสินค้า / บริการ"},"quantity":{"type":"number","description":"จำนวน"},"unit_price":{"type":"number","description":"ราคา/หน่วย"},"total_item_price":{"type":"number","description":"สรุปราคาสินค้า"},"vat_rate":{"type":"number","description":"อัตราภาษีมูลค่าเพิ่ม"},"discount_amount":{"type":"number","description":"มูลค่าส่วนลดสินค้า / บริการ"}},"required":["description","quantity","unit_price","total_item_price","vat_rate","discount_amount"]}},"subtotal":{"type":"number","description":"รวมราคาสินค้าทั้งหมด"},"total_discount_amount":{"type":"number","description":"รวมมูลค่าส่วนลดทั้งหมด"},"vat":{"type":"object","description":"ภาษีมูลค่าเพิ่ม","required":["is_included","rate","amount"],"properties":{"is_included":{"type":"boolean","description":"การรวมภาษีมูลค่าเพิ่มลงไปในราคาสินค้า"},"rate":{"type":"number","description":"อัตราภาษีมูลค่าเพิ่ม"},"amount":{"type":"number","description":"มูลค่าภาษี"}}},"vat_exempted_amount":{"type":"number","description":"มูลค่าสินค้า/บริการที่ได้รับการยกเว้นภาษี"},"taxable_sales_amount":{"type":"number","description":"มูลค่าสินค้า/บริการที่เสียภาษี"},"total":{"type":"number","description":"ราคาหลังรวมภาษี"},"withholding_tax":{"type":"object","description":"ภาษีหัก ณ ที่จ่าย","required":["rate","amount"],"properties":{"rate":{"type":"number","description":"อัตราภาษีหัก ณ ที่จ่าย"},"amount":{"type":"number","description":"มูลค่าภาษีหัก ณ ที่จ่าย"}}},"paid_amount":{"type":"number","description":"จำนวนเงินที่ต้องชำระ (ราคาหลังรวมภาษี - ภาษีหัก ณ ที่จ่าย)"},"remark":{"type":"string","description":"หมายเหตุ","nullable":true},"payment":{"type":"object","description":"การชำระเงิน","properties":{"paid_date":{"type":"string","description":"วันที่ชำระเงิน"},"amount":{"type":"number","description":"จำนวนเงินที่ชำระ"}},"required":["paid_date","amount"],"nullable":true},"pdf_url":{"type":"string","minLength":1,"description":"ลิงก์สำหรับดาวน์โหลด PDF ใบกำกับภาษี","nullable":true},"shareable_url":{"type":"string","description":"ลิงก์สำหรับให้ลูกค้าหรือบุคคลภายนอกเข้าดูข้อมูลเอกสาร","format":"uri"},"attachments":{"type":"array","description":"รายการเอกสารแนบ","items":{"type":"object","properties":{"name":{"type":"string","description":"ชื่อเอกสารแนบ"},"url":{"type":"string","description":"ลิงก์สำหรับดาวน์โหลดเอกสารแนบ"}}}},"references":{"type":"object","description":"รายการเอกสารอ้างอิง","required":["invoice_id","receipt_id"],"properties":{"invoice_id":{"type":"string","minLength":1,"description":"id ใบแจ้งหนี่ที่เกี่ยวข้อง"},"receipt_id":{"type":"string","minLength":1,"description":"id ใบเสร็จที่เกี่ยวข้อง"}}}},"required":["id","name","number","issue_date","merchant","customer","items","subtotal","total_discount_amount","vat","vat_exempted_amount","taxable_sales_amount","total","withholding_tax","paid_amount","pdf_url","shareable_url","attachments","references"],"description":"โครงสร้างข้อมูล `JSON` สำหรับข้อมูลประเภท`ใบแจ้งหนี้/ใบกำกับภาษี`"},"Recurring-Invoice":{"title":"Recurring Invoice","type":"object","description":"โครงสร้างข้อมูล `JSON` สำหรับข้อมูลประเภท`ใบแจ้งหนี้อัตโนัมัติ`","x-tags":["Recurring Invoices"],"x-examples":{"recurring-invoice.json":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","status":"active","invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","payment_policy":"fully_paid","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":0,"cycle":3,"installments":[],"canceled_at":null,"created_at":"2021-08-05 16:55:00"}},"properties":{"id":{"type":"string","description":"`id` ของใบแจ้งหนี้อันโนัมัติ","format":"uuid","example":"8a4b0613-8a53-4774-b8f0-87bce6ccc547"},"status":{"type":"string","description":"สถานะจะถูกตั้งค่าเป็น `canceled` เมื่อมีการลบใบแจ้งหนี้อัตโนมัติ โดยจะมี timestamp บอกเวลาที่ยกเลิกใบแจ้งหนี้อัตโนมัติที่ฟิล์ด `deleted_at`","enum":["active","canceled"]},"payment_policy":{"type":"string","description":"รูปแบบการชำระเงิน ชำระเต็มจำนวน (`fully_paid`) หรือ ผ่อนชำระ (`installment`)","default":"fully_paid","example":"fully_paid","enum":["fully_paid","installment"]},"installments":{"description":"ข้อมูลเรียกชำระเงินจากลูกค้าในแต่ละงวด (เริ่มตั้งแต่งวดที่ 1)","example":[],"default":[],"type":"array","items":{"type":"object","properties":{"installment":{"type":"integer","description":"งวดที่"},"amount":{"type":"number","format":"double","description":"จำนวนที่ต้องชำระ"}}}},"invoice_template":{"type":"object","format":"uuid","description":"`id` ของรูปแบบใบแจ้งหนี้","properties":{"id":{"type":"string","format":"uuid","description":"`id` ของรูปแบบใบแจ้งหนี้","example":"c6f3f207-169d-481c-882c-f50c5b85626d"},"name":{"type":"string","description":"ชื่อใบแจ้งหนี้","example":"สมัครสมาชิกนิตยสารรายเดือน"},"number":{"type":"string","description":"เลขที่อ้างอิงของรูปแบบใบแจ้งหนี้","example":"REC2021080001","minLength":1,"maxLength":24},"amount":{"type":"number","format":"double","example":399,"description":"จำนวนที่เรียกเก็บ / รอบ"}}},"customer":{"type":"object","description":"ข้อมูลลูกค้าแบบย่อ","properties":{"id":{"type":"string","description":"`id` ของลูกค้าตามสมุดรายชื่อลูกค้า","example":"1137d03a3ee24f1ca31dfae41a4cf600"},"name":{"type":"string","description":"ชื่อลูกค้า","example":"บริษัท บิลมีเวนเจอร์ จำกัด"}}},"number":{"type":"string","description":"เลขที่สัญญาของใบแจ้งหนี้อัตโนมัติ","example":"MAG2021080001","minLength":1,"maxLength":24},"frequency":{"type":"string","enum":["monthly"],"description":"ความถี่ในการส่งใบแจ้งหนี้รอบถัดไป"},"start_date":{"type":"string","description":"วันที่เริ่มส่งใบแจ้งหนี้รอบแรก","format":"date","example":"2021-08-30","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","description":"วันที่ส่งใบแจ้งหนี้ครั้งสุดท้าย","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2021-10-30","nullable":true},"next_sending_date":{"type":"string","description":"วันที่สำหรับส่งใบแจ้งหนี้ครั้งถัดไป","format":"date","example":"2021-09-30","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true},"sent_count":{"type":"integer","description":"จำนวนรอบใบแจ้งหนี้ที่ส่งไปแล้ว","example":1,"default":0},"cycle":{"type":"integer","description":"จำนวนรอบส่งทั้งหมด","example":3,"nullable":true},"canceled_at":{"type":"string","description":"วันเวลาที่ยกเลิกการส่งใบแจ้งหนี้อัตโนมัติ","format":"date-time","example":null,"pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$","nullable":true},"created_at":{"type":"string","description":"วันเวลาที่เริ่มสร้างใบแจ้งหนี้อัตโนมัติ","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$","example":"2021-08-05 16:55:00"}}},"Invoice-Template-Response":{"title":"Invoice Template Response","type":"object","description":"โครงสร้างข้อมูล `JSON` สำหรับข้อมูลประเภท`รูปแบบใบแจ้งหนี้`","x-tags":["Invoice Templates"],"x-examples":{"invoice-template.json":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}},"properties":{"id":{"type":"string","format":"uuid","description":"`id`ของรูปแบบใบแจ้งหนี้","example":"c6f3f207-169d-481c-882c-f50c5b85626d"},"seller_id":{"type":"string","description":"`id` ของบริษัทที่ออกใบแจ้งหนี้","format":"uuid","example":"1d1295bf-f6f8-4473-9b95-33e889f301b1"},"number":{"type":"string","description":"ชื่อรูปแบบใบแจ้งหนี้","example":"REC2021080001"},"template":{"type":"object","description":"โครงของ`ใบแจ้งหนี้`","properties":{"name":{"type":"string","description":"ชื่อใบแจ้งหนี้","example":"สมัครสมาชิกนิตยสารรายเดือน"},"items":{"type":"array","description":"รายการเรียกชำระเงิน","items":{"type":"object","properties":{"description":{"type":"string","description":"รายละเอียดสินค้า/บริการ","example":"ค่าทำความสะอาด"},"quantity":{"type":"number","description":"จำนวน/หน่วย","format":"double","minimum":0,"example":1},"price_per_item":{"type":"number","description":"ราคาต่อหน่วย","format":"double","minimum":0,"example":100},"vat":{"description":"ภาษีมูลค่าเพิ่ม","type":"object","nullable":true,"properties":{"rate":{"type":"number","format":"double","default":0,"description":"อัตราภาษีมูลค่าเพิ่ม","example":7},"amount":{"type":"number","description":"มูลค่า","format":"double","example":0}}},"discount":{"type":"object","description":"ส่วนลด","nullable":true,"properties":{"rate":{"type":"number","description":"อัตราส่วนลด (%)","example":10,"nullable":true},"amount":{"type":"number","format":"double","description":"มูลค่าส่วนลดเงินสด","example":0}}}}}},"remark":{"type":"string","description":"หมายเหตุ","example":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์"},"due_date_term":{"type":"integer","description":"ชำระภายในจำนวนวัน","example":15},"discount":{"type":"object","description":"มูลค่าส่วนลดรวมทั้งใบแจ้งหนี้","properties":{"on":{"type":"boolean","description":"มีหรือไม่มีส่วนลด","default":false},"percentage":{"type":"number","description":"อัตราร้อยละของส่วนลด","format":"double","example":0.07},"amount":{"type":"number","format":"double","example":0,"description":"มูลค่าส่วนลดรวม"}}},"vat":{"type":"object","description":"ภาษีมูลค่าเพิ่มทั้งใบแจ้งหนี้","properties":{"on":{"type":"boolean","description":"มี/ไม่มีการคิดภาษีมูลค่าเพิ่ม","default":true},"is_included":{"type":"boolean","description":"ภาษีมูลค่าเพิ่มคิดรวมหรือแยกจากราคาสินค้า","default":true},"rate":{"type":"number","description":"อัตราภาษี (%)","format":"double","example":0.07},"amount":{"type":"number","description":"มูลค่ารวมภาษีมูลค่าเพิ่ม","format":"double","example":26.1}}},"withholding_tax":{"type":"object","description":"ภาษีหัก ณ ที่จ่ายทั้งใบแจ้งหนี้","properties":{"on":{"type":"boolean","description":"มี/ไม่มีการคิดภาษีแบบหัก ณ ที่จ่าย"},"rate":{"type":"number","description":"อัตราภาษี (%)","format":"double","example":0.03},"amount":{"type":"number","description":"มูลค่าภาษีมูลค่าเพิ่มหัก ณ​ ที่จ่าย","example":0,"format":"double"}}},"vat_exempted_amount":{"type":"number","format":"double","example":0,"description":"มูลค่าสินค้าที่ได้รับการยกเว้นภาษี","default":0,"minimum":0},"taxable_sales_amount":{"type":"number","format":"double","example":372.9,"description":"มูลค่าสินค้าที่นำมาคิดภาษี","default":0,"minimum":0},"net_amount":{"type":"number","description":"ราคาก่อนรวมภาษี","minimum":0,"example":372.9,"default":0},"items_amount":{"type":"number","description":"มูลค่ารวมสินค้า","format":"double","default":0,"example":399},"total_amount":{"type":"number","description":"ราคาหลังรวมภาษี","format":"double","example":399},"gross_amount":{"type":"number","description":"ราคาสุทธิที่ต้องชำระ","format":"double","example":399}}},"created_at":{"type":"string","description":"วันที่สร้างรูปแบบใบแจ้งหนี้","format":"date-time","example":"2021-08-05 16:30:01","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"},"updated_at":{"type":"string","description":"วันที่ปรับปรุงข้อมูลรูปแบบใบแจ้งหนี้","format":"date-time","example":"2021-08-05 16:39:02","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"}}},"Invoice-Template-Request":{"title":"Invoice Template Request","type":"object","x-tags":["Invoice Templates"],"description":"โครงสร้างข้อมูล JSON สำหรับ `สร้าง` และ `อัพเดท` `รูปแบบใบแจ้งหนี้`","properties":{"name":{"type":"string","description":"ชื่ออ้างอิงของเทมเพลตใบแจ้งหนี้"},"number":{"type":"string","description":"เลขที่อ้างอิงของเทมเพลตใบแจ้งหนี้","minLength":1,"maxLength":24},"items":{"type":"array","description":"รายการสินค้า/บริการ","items":{"type":"object","properties":{"description":{"type":"string","description":"รายละเอียดของสินค้า/บริการ"},"quantity":{"type":"number","description":"จำนวนของสินค้า/บริการ","minimum":0,"example":0,"format":"double"},"price_per_item":{"type":"number","description":"ราคาต่อหน่วยของสินค้า/บริการ","format":"double","minimum":0},"vat_rate":{"type":"number","description":"ภาษีมูลค่าเพิ่มของสินค้า/บริการ หน่วยเป็น % เช่น 7","example":7,"format":"double","minimum":0,"maximum":100},"discount":{"type":"object","description":"ส่วนลดของสินค้า/บริการ","properties":{"type":{"type":"string","description":"ประเภทของส่วนลด (เปอร์เซ็นต์หรือเงินสด)","enum":["percentage","money"]},"total":{"type":"number","format":"double","description":"มูลค่าส่วนลด เช่น 10% หรือ 1000 บาท"}}}}}},"remark":{"type":"string","description":"หมายเหตุสำหรับแนบท้ายใบแจ้งหนี้"},"withholding_tax":{"type":"object","description":"รูปแบบการคิดภาษีหัก ณ​ ที่จ่าย","properties":{"on":{"type":"boolean","description":"มีการคิดภาษีหัก ณ​ ที่จ่ายหรือไม่","default":true},"rate":{"type":"number","description":"% สำหรับคิดภาษีหัก ณ​ ที่จ่าย (หน่วยเป็นทศนิยม) เช่น 3% = 0.03","default":0}}},"is_vat_included":{"type":"boolean","description":"รูปแบบการคิดภาษีในรายการสินค้า/บริการ (แยกภาษีหรือรวมภาษี)","default":false},"due_date_term":{"type":"integer","minimum":1,"maximum":365,"format":"int64","description":"จำนวนวันที่ผู้รับใบแจ้งหนี้ต้องทำการชำระเงินนับจากวันที่ออกใบแจ้งหนี้ในแต่ละรอบ"}},"required":["number","due_date_term"]},"CreateInvoiceRequest":{"description":"","type":"object","properties":{"customer":{"type":"object","description":"ข้อมูลลูกค้า","required":["name","tax_number","phone_number","emails","address"],"properties":{"customer_code":{"type":"string","minLength":1,"example":"BG-CUS-001","description":"รหัสลูกค้าสำหรับค้นหาลูกค้าเดิมบนระบบ หากพบและไม่ได้ส่ง customer_id ระบบจะผูกใบแจ้งหนี้กับลูกค้ารายนั้น"},"name":{"type":"string","minLength":1,"example":"สมชาย หมายปอง","description":"ชื่อลูกค้า"},"tax_number":{"type":"string","minLength":1,"example":"1012670114029","description":"เลขที่ผู้เสียภาษี"},"phone_number":{"type":"string","minLength":1,"example":"0850601111","description":"เบอร์โทรศัพท์\n"},"emails":{"type":"array","description":"อีเมลลูกค้าสำหรับรับการแจ้งเตือนการส่งบิล","items":{"type":"string","example":"somchai.h@mockcustomer.com"}},"address":{"type":"object","description":"ที่อยู่ของลูกค้า","required":["house_number","sub_district","district","province","post_code"],"properties":{"house_number":{"type":"string","minLength":1,"example":"598/610","description":"เลขที่"},"sub_district":{"type":"string","minLength":1,"example":"บางกะปิ","description":"แขวง / ตำบล"},"district":{"type":"string","minLength":1,"example":"ห้วยขวาง","description":"เขต / อำเภอ"},"province":{"type":"string","minLength":1,"example":"กรุงเทพมหานคร","description":"จังหวัด"},"post_code":{"type":"string","minLength":1,"example":"10310","description":"รหัสไปรษณีย์"}}}}},"number":{"type":"string","minLength":1,"example":"INV-000001","description":"เลขที่ใบแจ้งหนี้"},"issue_date":{"type":"string","minLength":1,"example":"2021-01-19","description":"วันที่ออกเอกสาร"},"due_date":{"type":"string","minLength":1,"example":"2021-01-19","description":"วันที่ครบกำหนดชำระ"},"items":{"type":"array","uniqueItems":true,"minItems":1,"description":"รายการสินค้า","items":{"type":"object","description":"สินค้า","properties":{"description":{"type":"string","minLength":1,"example":"ค่าบริการ","description":"ชื่อสินค้า"},"quantity":{"type":"number","example":1,"description":"จำนวน"},"unit_price":{"type":"number","example":1000,"description":"ราคา/หน่วย"},"vat_rate":{"type":"number","example":7,"description":"อัตราภาษีมูลค่าเพิ่ม","minimum":0,"maximum":7,"nullable":true},"discount_amount":{"type":"number","example":0,"description":"ส่วนลด","nullable":true}},"required":["description","quantity","unit_price"]}},"vat_included":{"type":"boolean","description":"กำหนดว่ารายการสินค้ารวมภาษีแล้ว หรือยังไม่ได้รวมภาษี"},"remark":{"type":"string","description":"หมายเหตุ","nullable":true},"withholding_tax_rate":{"type":"number","description":"อัตราภาษีหัก ณ ที่จ่าย","nullable":true},"attachments":{"type":"array","description":"รายการไฟล์แนบ สามารถส่งเป็น document id ที่มีอยู่แล้ว หรือ URL แบบ http/https","items":{"type":"string","example":"https://example.com/files/invoice-attachment.pdf"}},"name":{"type":"string","description":"อ้างอิง/โปรเจค"}},"required":["customer","number","issue_date","due_date","items","vat_included","remark"]},"ListInvoices200ResponseBody":{"type":"object","properties":{"total":{"type":"integer","description":"จำนวนข้อมูลใบแจ้งหนี้ที่มีในระบบ","default":0},"next":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าถัดไป ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าสุดท้าย ให้นำจำนวนไปรวมกับค่า `offset` เพื่อเรียกข้อมูลหน้าถัดไป","nullable":true},"previous":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าที่แล้ว ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าแรก ให้นำจำนวนไปหักออกจากค่า `offset` เพื่อเรียกข้อมูลหน้าที่แล้ว","nullable":true},"data":{"type":"array","description":"รายการใบแจ้งหนี้","items":{"$ref":"#/components/schemas/Invoice"}}},"required":["total","next","previous","data"]},"ConfirmPaidPaymentInvoiceRequest":{"description":"","type":"object","properties":{"date_time":{"type":"string","minLength":1,"example":"2021-01-19 13:00:00","description":"วันที่ชำระเงิน"},"amount":{"type":"number","example":1000,"description":"จำนวนเงินที่ชำระ"}},"required":["date_time","amount"]},"DeclinePaymentInvoiceRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"example":"ยอดเงินไม่ถูกต้อง","description":"เหตุผลที่ปฏิเสธการแจ้งชำระเงิน"},"metadata":{"type":"object","description":"ข้อมูลเพิ่มเติมสำหรับการปฏิเสธการชำระเงิน"}},"required":["reason"]},"ListRecurringInvoices200ResponseBody":{"type":"object","properties":{"total":{"type":"number"},"next":{"type":"number","nullable":true},"previous":{"type":"number","nullable":true},"recurring_invoices":{"type":"array","items":{"$ref":"#/components/schemas/Recurring-Invoice"}}}},"CreateRecurringInvoiceRequest":{"type":"object","properties":{"invoice_template_id":{"type":"string","format":"uuid","description":"`id`ของ`รูปแบบใบแจ้งหนี้`","example":"c6f3f207-169d-481c-882c-f50c5b85626d"},"customer_id":{"type":"string","description":"`id`ของลูกค้าจากสมุดรายชื่อลูกค้า","example":"1137d03a3ee24f1ca31dfae41a4cf600"},"number":{"type":"string","description":"เลขที่อ้างอิงของใบแจ้งหนี้อัตโนมัติ","minLength":1,"maxLength":24,"example":"MAG2021080001"},"frequency":{"type":"string","description":"ความถี่ในการส่งใบแจ้งหนี้","enum":["monthly"],"example":"monthly"},"start_date":{"type":"string","format":"date","description":"วันที่เริ่มส่งใบแจ้งหนี้ครั้งแรก","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2021-08-30"},"cycle":{"type":"integer","description":"จำนวนรอบที่ต้องการส่งใบแจ้งหนี้","example":3,"minimum":0,"maximum":1200,"nullable":true},"payment_policy":{"type":"string","description":"รูปแบบการชำระเงิน ได้แก่\n- ชำระเต็มจำนวน (`fully_paid`)\n- ผ่อนชำระ (`installment`)","default":"fully_paid","example":"fully_paid","enum":["fully_paid","installment"],"nullable":true},"installments":{"type":"array","description":"งวดและยอดที่ลูกค้าต้องชำระ\n\n- กรณีที่ `payment_policy` เป็น `fully_paid`\nไม่ต้องส่งค่า `installments` มา\n\n- กรณีที่ `payment_policy` เป็น `installment`\n  - งวดที่ใส่ต้องมีจำนวนเท่ากับ `cycle` ที่ใส่มา\n  - งวดที่ (installment) และ ยอดที่ต้องชำระในแต่ละงวด (amount) โดยผลรวมของยอดชำระต้องเท่ากับมูลค่า `gross_amount` ของ `invoice_template_id` ที่เลือก","uniqueItems":true,"minItems":0,"nullable":true,"items":{"type":"object","properties":{"installment":{"description":"งวดที่","type":"integer"},"amount":{"type":"number","description":"มูลค่าที่ต้องชำระ","format":"double"}}}}},"required":["invoice_template_id","customer_id","number","frequency","start_date","cycle"]},"CreateReceiptRequest":{"description":"","type":"object","properties":{"invoice_id":{"type":"string","minLength":1,"description":"id ของใบแจ้งหนี้ที่ต้องการสร้างใบเสร็จ","nullable":true},"data":{"type":"object","required":["customer","issue_date","items","vat_included","remark"],"description":"ข้อมูลในใบเสร็จ","properties":{"customer":{"type":"object","required":["name","tax_number","phone_number","emails","address"],"description":"ข้อมูลลูกค้า","properties":{"customer_code":{"type":"string","minLength":1,"example":"BG-CUS-001","description":"รหัสลูกค้าสำหรับค้นหาลูกค้าเดิมบนระบบ หากพบและไม่ได้ส่ง customer_id ระบบจะผูกใบกำกับภาษีกับลูกค้ารายนั้น"},"name":{"type":"string","minLength":1,"example":"สมชาย หมายปอง","description":"ชื่อลูกค้า"},"tax_number":{"type":"string","minLength":1,"example":"1012670114029","description":"เลขที่ผู้เสียภาษี"},"phone_number":{"type":"string","minLength":1,"example":"0850601111","description":"เบอร์โทรศัพท์"},"emails":{"type":"array","description":"Email ลูกค้า","items":{"type":"string","example":"somchai.h@mockcustomer.com"}},"address":{"type":"object","required":["house_number","sub_district","district","province","post_code"],"description":"ที่อยู่ลูกค้า","properties":{"house_number":{"type":"string","minLength":1,"example":"598/610","description":"เลขที่"},"sub_district":{"type":"string","minLength":1,"example":"บางกะปิ","description":"แขวง / ตำบล"},"district":{"type":"string","minLength":1,"example":"ห้วยขวาง","description":"เขต / อำเภอ"},"province":{"type":"string","minLength":1,"example":"กรุงเทพมหานคร","description":"จังหวัด"},"post_code":{"type":"string","minLength":1,"example":"10310","description":"รหัสไปรษณีย์"}}}}},"issue_date":{"type":"string","minLength":1,"example":"2021-01-19","description":"วันที่ออกเอกสาร"},"items":{"type":"array","uniqueItems":true,"minItems":1,"description":"รายการสินค้า / บริการ","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"example":"ค่าบริการ","description":"ชื่อสินค้า / บริการ"},"quantity":{"type":"number","example":1,"description":"จำนวน"},"unit_price":{"type":"number","example":1,"description":"ราคา/หน่วย"},"vat_rate":{"type":"number","example":1000,"description":"อัตราภาษีมูลค่าเพิ่ม","nullable":true},"discount_amount":{"type":"number","example":0,"description":"มูลค่าส่วนลดของสินค้า","nullable":true}},"required":["description","quantity","unit_price"]}},"vat_included":{"type":"boolean","description":"การคิดภาษีมูลค่าเพิ่มรวมลงไปในราคาสินค้า"},"remark":{"type":"string","description":"หมายเหตุ","nullable":true},"withholding_tax_rate":{"type":"number","description":"อัตราภาษีหัก ณ ที่จ่าย","nullable":true},"name":{"type":"string","description":"อ้างอิง / โปรเจค"}},"nullable":true},"number":{"type":"string","example":"RCP-000001","minLength":1,"description":"เลขที่ใบเสร็จ"}},"required":["invoice_id","data","number"]},"CreateReceipt200ResponseBody":{"type":"object","properties":{"receipt_id":{"type":"string","description":"id ของใบเสร็จ"}}},"ListReceipts200ResponseBody":{"type":"object","properties":{"total":{"type":"integer","description":"จำนวนใบเสร็จทั้งหมดในระบบ","default":0},"next":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าถัดไป ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าสุดท้าย ให้นำจำนวนไปรวมกับค่า `offset` เพื่อเรียกข้อมูลหน้าถัดไป","nullable":true},"previous":{"description":"จำนวนข้อมูลสำหรับหน้าที่แล้ว ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าแรก ให้นำจำนวนไปหักออกจากค่า `offset` เพื่อเรียกข้อมูลหน้าที่แล้ว","type":"number","nullable":true},"data":{"type":"array","description":"รายการใบเสร็จ","items":{"$ref":"#/components/schemas/Receipt"}}},"required":["total","next","previous","data"]},"CreateTaxInvoiceRequest":{"description":"","type":"object","properties":{"number":{"type":"string","example":"TAX-000001","minLength":1,"description":"เลขที่ใบกำกับภาษี"},"invoice_id":{"type":"string","minLength":1,"description":"id ของใบแจ้งหนี่ที่ต้องการสร้างใบกำกับภาษี","nullable":true},"receipt_id":{"type":"string","description":"id ของใบเสร็จที่ต้องการสร้างใบกำกับภาษี","nullable":true},"data":{"type":"object","description":"ข้อมูลในใบกำกับภาษี","required":["customer","issue_date","items","vat_included","remark"],"properties":{"customer":{"type":"object","required":["name","tax_number","phone_number","emails","address"],"description":"ข้อมูลลูกค้า","properties":{"customer_code":{"type":"string","minLength":1,"example":"BG-CUS-001","description":"รหัสลูกค้าสำหรับค้นหาลูกค้าเดิมบนระบบ หากพบและไม่ได้ส่ง customer_id ระบบจะผูกใบกำกับภาษีกับลูกค้ารายนั้น"},"name":{"type":"string","minLength":1,"example":"สมชาย หมายปอง","description":"ชื่อลูกค้า"},"tax_number":{"type":"string","minLength":1,"example":"1012670114029","description":"เลขที่ผู้เสียภาษี"},"phone_number":{"type":"string","minLength":1,"example":"0850601111","description":"เบอร์โทรศัพท์"},"emails":{"type":"array","description":"Email ลูกค้าสำหรับรับเอกสารผ่านอีเมล","items":{"type":"string","example":"somchai.h@mockcustomer.com"}},"address":{"type":"object","required":["house_number","sub_district","district","province","post_code"],"description":"ที่อยู่ลูกค้า","properties":{"house_number":{"type":"string","minLength":1,"example":"598/610","description":"เลขที่"},"sub_district":{"type":"string","minLength":1,"example":"บางกะปิ","description":"แขวง / ตำบล"},"district":{"type":"string","minLength":1,"example":"ห้วยขวาง","description":"เขต / อำเภอ"},"province":{"type":"string","minLength":1,"example":"กรุงเทพมหานคร","description":"จังหวัด"},"post_code":{"type":"string","minLength":1,"example":"10310","description":"รหัสไปรษณีย์"}}}}},"issue_date":{"type":"string","minLength":1,"example":"2021-01-19","description":"วันที่ออกเอกสาร"},"items":{"type":"array","uniqueItems":true,"minItems":1,"description":"รายการสินค้า / บริการ","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"example":"ค่าบริการ","description":"ชื่อสินค้า / บริการ"},"quantity":{"type":"number","example":1,"description":"จำนวน"},"unit_price":{"type":"number","example":1,"description":"ราคา/หน่วย"},"vat_rate":{"type":"number","example":7,"description":"อัตราภาษีมูลค่าเพิ่ม","nullable":true},"discount_amount":{"type":"number","example":0,"description":"มูลค่าส่วนลดสินค้า / บริการ","nullable":true}},"required":["description","quantity","unit_price"]}},"vat_included":{"type":"boolean","description":"กำหนดว่ารายการสินค้ารวมภาษีแล้ว หรือยังไม่ได้รวมภาษี"},"remark":{"type":"string","description":"หมายเหตุ","nullable":true},"withholding_tax_rate":{"type":"number","description":"อัตราภาษีหัก ณ ที่จ่าย","nullable":true}},"nullable":true},"attachments":{"type":"array","description":"รายการไฟล์แนบ สามารถส่งเป็น document id ที่มีอยู่แล้ว หรือ URL แบบ http/https","items":{"type":"string","example":"https://example.com/files/tax-invoice-attachment.pdf"}}},"required":["number"]},"CreateTaxInvoice200ResponseBody":{"type":"object","properties":{"tax_invoice_id":{"type":"string"}}},"ListTaxInvoices200ResponseBody":{"type":"object","properties":{"total":{"type":"integer","default":0,"description":"จำนวนใบแจ้งหนี้/ใบกำกับภาษีทั้งหมดในระบบ"},"next":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าถัดไป ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าสุดท้าย ให้นำจำนวนไปรวมกับค่า `offset` เพื่อเรียกข้อมูลหน้าถัดไป","nullable":true},"previous":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าที่แล้ว ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าแรก ให้นำจำนวนไปหักออกจากค่า `offset` เพื่อเรียกข้อมูลหน้าที่แล้ว","nullable":true},"data":{"type":"array","description":"รายการใบแจ้งหนี้/ใบกำกับภาษี","items":{"$ref":"#/components/schemas/Tax-Invoice"}}},"required":["total","next","previous","data"]},"ListCustomers200ResponseBody":{"type":"object","properties":{"total":{"type":"integer","description":"จำนวนลูกค้าทั้งหมดที่มีบนระบบ"},"next":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าถัดไป ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าสุดท้าย ให้นำจำนวนไปรวมกับค่า `offset` เพื่อเรียกข้อมูลหน้าถัดไป","nullable":true},"previous":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าที่แล้ว ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าแรก ให้นำจำนวนไปหักออกจากค่า `offset` เพื่อเรียกข้อมูลหน้าที่แล้ว","nullable":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer-Response"}}},"required":["total","data"]},"ListInvoiceTemplates200ResponseBody":{"type":"object","properties":{"total":{"type":"integer","default":0,"minimum":0,"description":"จำนวน`รูปแบบใบแจ้งหนี้`ทั้งหมดที่มีในระบบ"},"next":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าถัดไป ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าสุดท้าย ให้นำจำนวนไปรวมกับค่า `offset` เพื่อเรียกข้อมูลหน้าถัดไป","nullable":true},"previous":{"type":"integer","description":"จำนวนข้อมูลสำหรับหน้าที่แล้ว ถ้าหากไม่ใช่ค่า null แสดงว่าไม่ใช่หน้าแรก ให้นำจำนวนไปหักออกจากค่า `offset` เพื่อเรียกข้อมูลหน้าที่แล้ว","nullable":true},"invoice_templates":{"type":"array","description":"รายการ`รูปแบบใบแจ้งหนี้`","items":{"$ref":"#/components/schemas/Invoice-Template-Response"}}}},"CreateInvoiceTemplateRequest":{"type":"object","properties":{"name":{"type":"string","description":"ชื่อ`ใบแจ้งหนี้`","example":"สมัครสมาชิกนิตยสารรายเดือน","nullable":true},"number":{"type":"string","description":"เลขที่อ้างอิง`รูปแบบใบแจ้งหนี้`","example":"REC2021080001"},"items":{"type":"array","description":"รายการสินค้า/บริการ","items":{"type":"object","properties":{"description":{"type":"string","description":"รายละเอียดสินค้า/บริการ","example":"ค่าบริการทำความสะอาดรายเดือน"},"quantity":{"type":"number","description":"จำนวน/หน่วย","format":"double","example":1},"price_per_item":{"type":"number","format":"double","description":"ราคาสินค้า/บริการต่อหน่วย","example":399},"vat_rate":{"type":"number","format":"double","example":0.07,"description":"ภาษีมูลค่าเพิ่ม (หากไม่มีให้ใส่ null)","nullable":true},"discount":{"type":"object","description":"ส่วนลด (หากไม่มีให้ใส่ null)","nullable":true,"properties":{"type":{"type":"string","enum":["percentage","money"],"description":"ประเภทส่วนลด"},"total":{"type":"number","description":"มูลค่าส่วนลดอ้างอิงจากประเภท","format":"double"}}}},"required":["description","quantity","price_per_item"]}},"remark":{"type":"string","description":"หมายเหตุ","example":"กรุณาชำระภายในวันที่กำหนดเท่านั้น"},"withholding_tax":{"description":"มูลค่าภาษีหัก ณ ที่จ่าย","type":"object","properties":{"on":{"type":"boolean","default":true,"description":"มีการคิดภาษีหัก ณ​ ที่จ่ายหรือไม่"},"rate":{"type":"number","format":"double","default":0,"example":0.03,"description":"อัตราภาษีหัก ณ​ ที่จ่าย"}}},"is_vat_included":{"type":"boolean","description":"มีการคิดภาษีมูลค่าเพิ่มแบบรวมไปในรายการสินค้าหรือไม่","default":false},"due_date_term":{"type":"integer","description":"จำนวนวันที่ต้องชำระหลังออกใบแจ้งหนี้","example":30}},"required":["name","number","items","due_date_term"]},"UpdateInvoiceTemplateRequest":{"type":"object","properties":{}}},"parameters":{"offset":{"name":"offset","in":"query","required":false,"description":"จำนวนข้อมูลที่ต้องการข้าม","schema":{"type":"number","minimum":0,"default":0}},"limit":{"name":"limit","in":"query","description":"จำนวนข้อมูลที่ต้องการผลลัพธ์","schema":{"type":"number","minimum":0,"maximum":100,"default":50}},"status":{"name":"status","in":"query","required":false,"description":"สถานะของใบแจ้งหนี้","schema":{"type":"string","enum":["pending","overdue","paid","unpaid","sent","rejected"]}},"start":{"name":"start","in":"query","required":false,"description":"วันที่เริ่มต้นช่วงเวลาออกใบแจ้งหนี้ รูปแบบ yyyy-MM-dd HH:mm:ss","example":"2026-04-01 00:00:00","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"}},"end":{"name":"end","in":"query","required":false,"description":"วันที่สิ้นสุดช่วงเวลาออกใบแจ้งหนี้ รูปแบบ yyyy-MM-dd HH:mm:ss","example":"2026-04-30 23:59:59","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"}},"payment_start":{"name":"payment_start","in":"query","required":false,"description":"วันที่เริ่มต้นช่วงเวลาการชำระเงิน รูปแบบ yyyy-MM-dd HH:mm:ss","example":"2026-04-01 00:00:00","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"}},"payment_end":{"name":"payment_end","in":"query","required":false,"description":"วันที่สิ้นสุดช่วงเวลาการชำระเงิน รูปแบบ yyyy-MM-dd HH:mm:ss","example":"2026-04-30 23:59:59","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"}},"customer_id":{"name":"customer_id","in":"query","description":"`id` ลูกค้าจากสมุดรายชื่อลูกค้า","schema":{"type":"string","minLength":0,"maxLength":32,"pattern":".?[A-Za-z0-9]"}},"template_id":{"name":"template_id","in":"query","required":false,"description":"`id` ของ template ในรูปแบบของ UUID","schema":{"type":"string","pattern":"[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}"}},"CreateInvoiceCustomerIdQuery":{"in":"query","name":"customer_id","description":"`id` สำหรับออกใบแจ้งหนี้ให้กับลูกค้า","schema":{"type":"string"}},"InvoiceIdPath":{"name":"invoiceId","in":"path","required":true,"description":"`id` ของใบแจ้งหนี้","schema":{"type":"string"}},"InvoiceIdPath2":{"name":"invoiceId","in":"path","required":true,"description":"`id` ของใบแจ้งหนี้","schema":{"type":"string"}},"InvoiceIdPath3":{"name":"invoiceId","in":"path","required":true,"description":"`id` ของใบแจ้งหนี้","schema":{"type":"string"}},"InvoiceIdPath4":{"name":"invoiceId","in":"path","required":true,"description":"`id` ของใบแจ้งหนี้","schema":{"type":"string"}},"InvoiceIdPath5":{"name":"invoiceId","in":"path","required":true,"description":"`id` ของใบแจ้งหนี้","schema":{"type":"string"}},"ListRecurringInvoicesStatusQuery":{"in":"query","name":"status","description":"สถานะของใบแจ้งหนี้อัตโนมัติ หากยกเลิกแล้วจะมีสถานะเป็น `canceled`","schema":{"type":"string","pattern":"(active|canceled)"}},"RecurringInvoiceIdPath":{"name":"recurringInvoiceId","in":"path","required":true,"description":"`id`ของ`ใบแจ้งหนี้อัตโนมัติ`","schema":{"type":"string","format":"uuid"}},"RecurringInvoiceIdPath2":{"name":"recurringInvoiceId","in":"path","required":true,"description":"`id`ของ`ใบแจ้งหนี้อัตโนมัติ`","schema":{"type":"string","format":"uuid"}},"CreateReceiptCustomerIdQuery":{"in":"query","name":"customer_id","description":"`id`ลูกค้าบนระบบบิลมี","schema":{"type":"string"}},"ReceiptIdPath":{"name":"receiptId","in":"path","required":true,"description":"`id` ของใบเสร็จ","schema":{"type":"string"}},"ReceiptIdPath2":{"name":"receiptId","in":"path","required":true,"description":"`id` ของใบเสร็จ","schema":{"type":"string"}},"CreateTaxInvoiceCustomerIdQuery":{"in":"query","name":"customer_id","description":"`id`ลูกค้าบนระบบบิลมี","schema":{"type":"string"}},"TaxInvoiceIdPath":{"name":"taxInvoiceId","in":"path","required":true,"description":"`id` ของใบกำกับภาษี","schema":{"type":"string"}},"TaxInvoiceIdPath2":{"name":"taxInvoiceId","in":"path","required":true,"description":"`id` ของใบกำกับภาษี","schema":{"type":"string"}},"CustomerCodeQuery":{"in":"query","name":"customer_code","description":"กรองรายการลูกค้าด้วยรหัสลูกค้า","schema":{"type":"string"}},"CustomerIdPath":{"name":"customerId","in":"path","required":true,"description":"`id`ของลูกค้า","schema":{"type":"string"}},"CustomerIdPath2":{"name":"customerId","in":"path","required":true,"description":"`id`ของลูกค้า","schema":{"type":"string"}},"CustomerIdPath3":{"name":"customerId","in":"path","required":true,"description":"`id`ของลูกค้า","schema":{"type":"string"}},"InvoiceTemplateIdPath":{"name":"invoiceTemplateId","in":"path","required":true,"description":"`id`ของ`รูปแบบใบแจ้งหนี้`","schema":{"type":"string","format":"uuid"}},"InvoiceTemplateIdPath2":{"name":"invoiceTemplateId","in":"path","required":true,"description":"`id`ของ`รูปแบบใบแจ้งหนี้`","schema":{"type":"string","format":"uuid"}},"InvoiceTemplateIdPath3":{"name":"invoiceTemplateId","in":"path","required":true,"description":"`id`ของ`รูปแบบใบแจ้งหนี้`","schema":{"type":"string","format":"uuid"}}},"securitySchemes":{"ApiKeyAuth":{"name":"X-API-Key","type":"apiKey","in":"header","description":"สามารถขอ API Key ได้ที่หน้า `Billgate API` ในเมนู `การตั้งค่าข้อมูล` ผ่านทางเว็บไซต์ https://billbox.billme.co.th\n\nหลังจากนั้นเมื่อต้องการเรียกใช้งาน Billgate API ให้ทำการแนบ HTTP Header `X-API-Key` มาใน request ที่เรียกใช้งาน API"}},"requestBodies":{"CreateInvoiceRequestBody":{"description":"ข้อมูล `JSON` ที่ได้รับกลับไปจะยังไม่สมบูรณ์ เนื่องจาก `pdf_url` จะทำการสร้างและอนุญาตให้ดาวน์โหลดได้ในเวลาต่อมา","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceRequest"},"examples":{"example":{"value":{"customer":{"customer_code":"BG-CUS-001","name":"สมชาย หมายปอง","tax_number":"1012670114029","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}},"number":"INV-000001","name":"ใบเรียกเก็บค่าบริการเดือน มกราคม 2564","issue_date":"2021-01-19","due_date":"2021-01-19","items":[{"description":"ค่าบริการ","quantity":1,"unit_price":1000,"vat_rate":7,"discount_amount":0}],"vat_included":true,"remark":null,"withholding_tax_rate":null,"attachments":["https://example.com/files/invoice-attachment.pdf"]}}}}}},"ConfirmPaidPaymentInvoiceRequestBody":{"description":"","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPaidPaymentInvoiceRequest"},"examples":{"example":{"value":{"date_time":"2021-01-19 13:00:00","amount":1000}}}}}},"DeclinePaymentInvoiceRequestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclinePaymentInvoiceRequest"},"examples":{"example":{"value":{"reason":"ยอดเงินไม่ถูกต้อง","metadata":{}}}}}}},"CreateRecurringInvoiceRequestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecurringInvoiceRequest"},"examples":{"fully-paid.json":{"value":{"invoice_template_id":"c6f3f207-169d-481c-882c-f50c5b85626d","customer_id":"1137d03a3ee24f1ca31dfae41a4cf600","number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","cycle":3,"payment_policy":"fully_paid","installments":[]}},"installment.json":{"value":{"invoice_template_id":"c6f3f207-169d-481c-882c-f50c5b85626d","customer_id":"1137d03a3ee24f1ca31dfae41a4cf600","number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","cycle":4,"payment_policy":"installment","installments":[{"installment":1,"amount":1500},{"installment":2,"amount":1500},{"installment":3,"amount":1500},{"installment":4,"amount":400}]}}}}}},"CreateReceiptRequestBody":{"description":"","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReceiptRequest"},"examples":{"example":{"value":{"invoice_id":null,"number":"RCP-000001","data":{"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}},"issue_date":"2021-01-19","name":"ใบเรียกเก็บค่าบริการเดือน มกราคม 2564","items":[{"description":"ค่าบริการ","quantity":1,"unit_price":1000,"vat_rate":7,"discount_amount":0}],"vat_included":true,"remark":null,"withholding_tax_rate":null}}},"example-2":{"value":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","number":"RCP-000001","data":null}}}}}},"CreateTaxInvoiceRequestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaxInvoiceRequest"},"examples":{"example":{"value":{"number":"TAX-000001","invoice_id":null,"receipt_id":null,"data":{"customer":{"customer_code":"BG-CUS-001","name":"สมชาย หมายปอง","tax_number":"1012670114029","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}},"issue_date":"2021-01-19","items":[{"description":"ค่าบริการ","quantity":1,"unit_price":1,"vat_rate":7,"discount_amount":0}],"vat_included":true,"remark":null,"withholding_tax_rate":null},"attachments":["https://example.com/files/tax-invoice-attachment.pdf"]}},"example-2":{"value":{"number":"TAX-000001","invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":null,"data":null}},"example-3":{"value":{"number":"TAX-000001","invoice_id":null,"receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46","data":null}}}}}},"CreateCustomerRequestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Request"},"examples":{"example":{"value":{"type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","customer_code":"BG-CUS-001","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}},"UpdateCustomerByIdRequestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Request"},"examples":{"example":{"value":{"type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","customer_code":"BG-CUS-001","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}},"CreateInvoiceTemplateRequestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceTemplateRequest"},"examples":{"request.json":{"value":{"name":"ค่าบริการสำนักงานรายเดือน","number":"TEM202108001","items":[{"description":"บริการทำความสะอาดรายสัปดาห์","quantity":1,"price_per_item":399,"vat_rate":0.07,"discount":{"type":"money","total":50}},{"description":"ค่าบริการตู้จดหมาย","quantity":1,"price_per_item":99,"vat_rate":0.07,"discount":null}],"remark":"กรุณาชำระภายใน 30 วันหลังจากได้รับใบแจ้งหนี้","withholding_tax":{"on":true,"rate":0.03},"is_vat_included":false,"due_date_term":30}}}}}},"UpdateInvoiceTemplateRequestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceTemplateRequest"},"examples":{"example":{"value":{"name":"ค่าบริการสำนักงานรายเดือน","number":"TEM202108001","items":[{"description":"บริการทำความสะอาดรายสัปดาห์","quantity":1,"price_per_item":399,"vat_rate":0.07,"discount":{"type":"money","total":50}},{"description":"ค่าบริการตู้จดหมาย","quantity":1,"price_per_item":99,"vat_rate":0.07,"discount":null}],"remark":"กรุณาชำระภายใน 30 วันหลังจากได้รับใบแจ้งหนี้","withholding_tax":{"on":true,"rate":0.03},"is_vat_included":false,"due_date_term":30}}}}}}},"responses":{"CheckBillgateAuthorization204Response":{"description":"No Content"},"GenerateBillgateAccessToken200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billgate-Token"},"examples":{"example":{"value":{"access_token":""}}}}}},"GetBillgateAccessToken200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billgate-Token"},"examples":{"example":{"value":{"access_token":""}}}}}},"RevokeBillgateAccessToken204Response":{"description":"No Content"},"CreateInvoice202Response":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"},"examples":{"example":{"value":{"id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"INV-000001","status":"pending_payment","issue_date":"2021-01-25","due_date":"2021-02-15","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.mock@gmail.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":1392.52,"total":1490,"withholding_tax":{"rate":0,"amount":0},"paid_amount":1490,"remark":null,"payment_methods":[{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","number":"1002012896","type":"BANK"}],"payment":null,"pdf_url":null,"shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"receipt_id":null,"tax_invoice_id":null},"qrcode":null}}}}}},"ListInvoices200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInvoices200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"","name":"","number":"","status":"created","issue_date":"","due_date":"","merchant":{"name":"","phone":"","email":"","address":""},"customer":{"name":"","tax_number":null,"phone":"","emails":[""],"address":""},"items":[{"description":"","quantity":0,"unit_price":0,"total_item_price":0,"vat_rate":0,"discount_amount":0}],"subtotal":0,"total_discount_amount":0,"vat":{"is_included":true,"rate":0,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment_methods":[{"name":"","number":"","type":""}],"payment":{"paid_date":"","amount":0},"pdf_url":null,"shareable_url":"https://example.com","attachments":[{"name":"","url":""}],"references":{"receipt_id":null,"tax_invoice_id":null},"qrcode":null}]}}}}}},"ConfirmPaidPaymentInvoice201Response":{"description":"Created"},"DeclinePaymentInvoice201Response":{"description":"Created"},"ListInvoiceTransitionLogs200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Transition-Logs"},"examples":{"example":{"value":{"data":[{"id":"","invoice_id":"","from_status":null,"to_status":"","transitioned_by_type":"","transitioned_by_id":null,"transitioned_by":{"id":null,"name":null},"reason":null,"metadata":{},"created_at":""}]}}}}}},"GetInvoiceById200Response":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"},"examples":{"example":{"value":{"id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"INV-000001","status":"pending_payment","issue_date":"2021-01-25","due_date":"2021-02-15","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":1392.52,"total":1490,"withholding_tax":{"rate":0,"amount":0},"paid_amount":1490,"remark":null,"payment_methods":[{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","number":"1002012896","type":"BANK"}],"payment":{"paid_date":"2021-02-01 16:04:11","amount":1490},"pdf_url":"https://storage.googleapis.com/billhub/production/invoices/98FE9D3919179914713340F7A705A4F2/INV63000027.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"},"qrcode":null}}}}}},"DeleteInvoiceById204Response":{"description":"No Content"},"ListRecurringInvoices200Response":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecurringInvoices200ResponseBody"},"examples":{"recurring-invoices.json":{"value":{"total":1,"next":null,"previous":null,"recurring_invoices":[{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","status":"active","payment_policy":"fully_paid","installments":[],"invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":1,"cycle":3,"canceled_at":null,"created_at":"2021-08-05 16:55:00"}]}}}}}},"CreateRecurringInvoice200Response":{"description":"OK","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recurring-Invoice"},"examples":{"fully-paid.json":{"value":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","payment_policy":"fully_paid","installments":[],"invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":1,"cycle":3,"canceled_at":null,"created_at":"2021-08-05 16:55:00"}},"installment.json":{"value":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","payment_policy":"fully_paid","cycle":4,"installments":[{"installment":1,"amount":1500},{"installment":2,"amount":1500},{"installment":3,"amount":1500},{"installment":4,"amount":400}],"invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"ผ่อนชำระสินค้าชิ้นใหญ่","number":"REC2021080001","amount":4900},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":1,"canceled_at":null,"created_at":"2021-08-05 16:55:00"}}}}}},"GetRecurringInvoiceById200Response":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recurring-Invoice"},"examples":{"recurring-invoice.json":{"value":{"id":"8a4b0613-8a53-4774-b8f0-87bce6ccc547","status":"active","invoice_template":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","name":"สมัครสมาชิกนิตยสารรายเดือน","number":"REC2021080001","amount":399},"customer":{"id":"1137d03a3ee24f1ca31dfae41a4cf600","name":"บริษัท บิลมีเวนเจอร์ จำกัด"},"number":"MAG2021080001","frequency":"monthly","payment_policy":"fully_paid","start_date":"2021-08-30","end_date":"2021-10-30","next_sending_date":"2021-09-30","sent_count":0,"cycle":3,"installments":[],"canceled_at":null,"created_at":"2021-08-05 16:55:00"}}}}}},"CancelRecurringInvoiceById204Response":{"description":"No Content"},"CreateReceipt200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReceipt200ResponseBody"},"examples":{"example-1":{"value":{"receipt_id":"string"}}}}}},"ListReceipts200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListReceipts200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"b4d611db-3980-44ef-a64c-22410c3fde46","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"REC-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/1012670114029/5b8408_Receipt_RCP63000005.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"}}]}}}}}},"GetReceiptById200Response":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"},"examples":{"example":{"value":{"id":"b4d611db-3980-44ef-a64c-22410c3fde46","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"REC-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/1012670114029/5b8408_Receipt_RCP63000005.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","tax_invoice_id":"a5873c97-7c21-407d-b561-c2ece8de6389"}}}}}}},"DeleteReceiptById204Response":{"description":"No Content"},"CreateTaxInvoice200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaxInvoice200ResponseBody"},"examples":{"example":{"value":{"tax_invoice_id":""}}}}}},"ListTaxInvoices200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTaxInvoices200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"a5873c97-7c21-407d-b561-c2ece8de6389","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"TAX-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/tax_invoices/fa0da2a9ba3bcc08e6d2b785ba4ecaac/TAX63000001.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46"}}]}}}}}},"GetTaxInvoiceById200Response":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string","default":"application/json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tax-Invoice"},"examples":{"example":{"value":{"id":"a5873c97-7c21-407d-b561-c2ece8de6389","name":"ค่าบริการรายเดือน มกราคม พ.ศ. 2564","number":"TAX-000001","issue_date":"2021-01-25","merchant":{"name":"บริษัท บิลมีเวนเจอร์ จำกัด","phone":"0900900099","email":"noreply@billme.co.th","address":"เลขที่ 129 ถนนพระราม 9 แขวงห้วยขวาง เขตห้วยขวาง กรุงเทพมหานคร 10310"},"customer":{"name":"สมชาย หมายปอง","tax_number":"1012670114029","phone":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":"เลขที่ 598/610 ถนนพระราม 9 แขวงบางกะปิ เขตห้วยขวาง กรุงเทพมหานคร 10310"},"items":[{"description":"ค่าบริการระบบรับวางบิล","quantity":1,"unit_price":1490,"total_item_price":1490,"vat_rate":7,"discount_amount":0}],"subtotal":1490,"total_discount_amount":0,"vat":{"is_included":true,"rate":7,"amount":97.48},"vat_exempted_amount":0,"taxable_sales_amount":0,"total":0,"withholding_tax":{"rate":0,"amount":0},"paid_amount":0,"remark":null,"payment":{"payment_method_id":"dbde3da4-476b-4339-87cb-26b53e7bbea3","paid_date":"2021-01-25","amount":1490,"slip":null},"pdf_url":"https://storage.googleapis.com/billhub/production/tax_invoices/fa0da2a9ba3bcc08e6d2b785ba4ecaac/TAX63000001.pdf","shareable_url":"https://billpouch.billme.co.th/136b24c1b79db1a01337c0bc7880c905368d679fc4b73ad5acdb91914411cbc9","attachments":[],"references":{"invoice_id":"cf47a508-43e6-449c-aab8-68cabdcc3b41","receipt_id":"b4d611db-3980-44ef-a64c-22410c3fde46"}}}}}}},"DeleteTaxInvoiceById204Response":{"description":"No Content"},"ListCustomers200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCustomers200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"data":[{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"","alias":"","tax_number":"0000000000000","branch_number":"00000","phone_number":"0800000000,0900000000","emails":"contact@example.com","address":{"house_number":"","sub_district":"","district":"","province":"","post_code":""}}]}}}}}},"CreateCustomer200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Response"},"examples":{"example":{"value":{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}},"GetCustomerById200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Response"},"examples":{"example":{"value":{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}},"UpdateCustomerById200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer-Response"},"examples":{"example":{"value":{"id":"2bd61a952455483583b89dd53a937ef6","type":"individual","name":"สมชาย หมายปอง","alias":"สมชาย","tax_number":"1012670114029","branch_number":"00000","phone_number":"0850601111","emails":["somchai.h@mockcustomer.com"],"address":{"house_number":"598/610","sub_district":"บางกะปิ","district":"ห้วยขวาง","province":"กรุงเทพมหานคร","post_code":"10310"}}}}}}},"DeleteCustomerById204Response":{"description":"No Content"},"ListInvoiceTemplates200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInvoiceTemplates200ResponseBody"},"examples":{"example":{"value":{"total":0,"next":0,"previous":0,"invoice_templates":[{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}]}}}}}},"CreateInvoiceTemplate200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Template-Response"},"examples":{"response.json":{"value":{"id":"44cf6f8f-77f9-4a3d-9d4f-ba7d2c3126a5","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"TEM202108001","template":{"name":"ค่าบริการสำนักงานรายเดือน","items":[{"description":"บริการทำความสะอาดรายสัปดาห์","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":22.83177570093458},"discount":{"rate":null,"amount":50}},{"description":"ค่าบริการตู้จดหมาย","quantity":1,"price_per_item":99,"vat":{"rate":7,"amount":6.4766355140186915},"discount":null}],"remark":"กรุณาชำระภายใน 30 วันหลังจากได้รับใบแจ้งหนี้","due_date_term":30,"discount":{"on":true,"percentage":0,"amount":50},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":29.31},"withholding_tax":{"on":true,"rate":0.03,"amount":12.56},"vat_exempted_amount":0,"taxable_sales_amount":418.69,"net_amount":418.69,"items_amount":498,"total_amount":448,"gross_amount":435.44},"created_at":"2021-08-06 09:24:04","updated_at":"2021-08-06 09:24:04"}}}}}},"GetInvoiceTemplate200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Template-Response"},"examples":{"invoice-template.json":{"value":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}}}}}},"UpdateInvoiceTemplate200Response":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice-Template-Response"},"examples":{"invoice-template.json":{"value":{"id":"c6f3f207-169d-481c-882c-f50c5b85626d","seller_id":"1d1295bf-f6f8-4473-9b95-33e889f301b1","number":"REC2021080001","template":{"name":"สมัครสมาชิกนิตยสารรายเดือน","items":[{"description":"นิตยสาร The Great Financial Advise ฉบับรายเดือน","quantity":1,"price_per_item":399,"vat":{"rate":7,"amount":26.1},"discount":null}],"remark":"รับชำระทั้งบัตรเครดิตและพร้อมเพย์","due_date_term":15,"discount":{"on":true,"percentage":0,"amount":0},"vat":{"on":true,"is_included":true,"rate":0.07,"amount":26.1},"withholding_tax":{"on":false,"rate":0.03,"amount":0},"vat_exempted_amount":0,"taxable_sales_amount":372.9,"net_amount":372.9,"items_amount":399,"total_amount":399,"gross_amount":399},"created_at":"2021-08-05 16:30:01","updated_at":"2021-08-05 16:39:02"}}}}}},"DeleteInvoiceTemplate204Response":{"description":"No Content"}}}}