{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"End-to-End Invoice Workflow","description":"The operational transportation management API. Full access to planning, tracking, invoicing, and integrations — built on the OTM5 open data standard.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"end-to-end-invoice-workflow","__idx":0},"children":["End-to-End Invoice Workflow"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"objective","__idx":1},"children":["Objective"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Walk through the complete invoicing workflow — from creating a quote, to converting it to an invoice, sending it, and tracking payment."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-create-a-quote","__idx":2},"children":["Step 1: Create a Quote"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start by sending a quote to your customer for a transport job:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/quote \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"name\": \"Quote #Q-2026-015\",\n    \"direction\": \"OUT\",\n    \"date\": \"2026-03-22\",\n    \"dueAt\": \"2026-04-05T23:59:59Z\",\n    \"subjectBusiness\": { \"id\": \"your-business-uuid\" },\n    \"targetBusiness\": { \"id\": \"customer-business-uuid\" },\n    \"lines\": [\n      {\n        \"description\": \"FTL Transport Rotterdam → Berlin\",\n        \"quantity\": 1,\n        \"unitPrice\": 1200.00,\n        \"taxPercentage\": 21\n      },\n      {\n        \"description\": \"Fuel surcharge (15%)\",\n        \"quantity\": 1,\n        \"unitPrice\": 180.00,\n        \"taxPercentage\": 21\n      }\n    ]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": true,\n  \"message\": \"OK\",\n  \"quote\": {\n    \"id\": \"quote-uuid\",\n    \"number\": \"Q-2026-015\",\n    \"status\": \"concept\",\n    \"subTotal\": 1380.00,\n    \"tax\": 289.80,\n    \"total\": 1669.80\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-send-the-quote","__idx":3},"children":["Step 2: Send the Quote"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.otms.transportial.com/api/quote/{quote-uuid}/send\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The customer receives an email with a link to view, accept, or decline the quote."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-customer-accepts-via-public-link","__idx":4},"children":["Step 3: Customer Accepts (via Public Link)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The customer can accept without logging in using the shared link:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"POST /api/quote:public/{quote-uuid}/accept/{shareCode}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Or you can record acceptance manually:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.otms.transportial.com/api/quote/{quote-uuid}/accept\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-convert-quote-to-invoice","__idx":5},"children":["Step 4: Convert Quote to Invoice"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once accepted, convert the quote directly into an invoice:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.otms.transportial.com/api/quote/{quote-uuid}/create:invoice\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": true,\n  \"message\": \"OK\",\n  \"invoice\": {\n    \"id\": \"invoice-uuid\",\n    \"number\": \"2026-042\",\n    \"status\": \"concept\",\n    \"direction\": \"OUT\",\n    \"subTotal\": 1380.00,\n    \"tax\": 289.80,\n    \"total\": 1669.80,\n    \"totalOpen\": 1669.80\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-5-send-the-invoice","__idx":6},"children":["Step 5: Send the Invoice"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.otms.transportial.com/api/invoice/{invoice-uuid}/send\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-6-track-payment-status","__idx":7},"children":["Step 6: Track Payment Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check the invoice status:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/invoice/{invoice-uuid}\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Key fields to monitor:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," — concept, sent, paid, overdue, cancelled"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["totalOpen"]}," — remaining amount to be paid"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dueAt"]}," — payment due date"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reminderCount"]}," — number of reminders sent"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-7-send-a-payment-reminder","__idx":8},"children":["Step 7: Send a Payment Reminder"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If payment is overdue:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.otms.transportial.com/api/invoice/{invoice-uuid}/send:reminder\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-8-view-financial-overview","__idx":9},"children":["Step 8: View Financial Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Get a summary of all invoicing activity:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# List all outgoing invoices\ncurl -X POST \"https://api.otms.transportial.com/api/invoices/{administrationId}/0/20\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"direction\": \"OUT\",\n    \"status\": \"sent\"\n  }'\n\n# Financial management overview\ncurl -X GET \"https://api.otms.transportial.com/api/management/financial/{administrationId}/2026-03-01/2026-03-31\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"alternative-create-invoice-directly","__idx":10},"children":["Alternative: Create Invoice Directly"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also skip the quote step and create an invoice directly:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/invoice \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"name\": \"Invoice #2026-043\",\n    \"direction\": \"OUT\",\n    \"date\": \"2026-03-22\",\n    \"dueAt\": \"2026-04-22T23:59:59Z\",\n    \"subjectBusiness\": { \"id\": \"your-business-uuid\" },\n    \"targetBusiness\": { \"id\": \"customer-business-uuid\" },\n    \"lines\": [\n      {\n        \"description\": \"Transport Rotterdam → Amsterdam\",\n        \"quantity\": 1,\n        \"unitPrice\": 450.00,\n        \"taxPercentage\": 21\n      }\n    ]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"processing-incoming-invoices","__idx":11},"children":["Processing Incoming Invoices"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle invoices from your suppliers:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Create from email\ncurl -X PUT \"https://api.otms.transportial.com/api/invoice/mail/receiver\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"from\": \"billing@supplier.com\",\n    \"subject\": \"Invoice #SUP-2026-100\"\n  }'\n\n# Or create directly\ncurl -X POST https://api.otms.transportial.com/api/invoice \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"direction\": \"IN\",\n    \"subjectBusiness\": { \"id\": \"supplier-business-uuid\" },\n    \"targetBusiness\": { \"id\": \"your-business-uuid\" },\n    \"lines\": [...]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"key-takeaways","__idx":12},"children":["Key Takeaways"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The full workflow: Quote → Accept → Invoice → Send → Payment → Reminder"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Quotes support public sharing for customer self-service"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Invoices support both directions: outgoing (you bill) and incoming (you pay)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ledger entries provide a complete audit trail for all financial activity"]}]}]},"headings":[{"value":"End-to-End Invoice Workflow","id":"end-to-end-invoice-workflow","depth":1},{"value":"Objective","id":"objective","depth":2},{"value":"Step 1: Create a Quote","id":"step-1-create-a-quote","depth":2},{"value":"Step 2: Send the Quote","id":"step-2-send-the-quote","depth":2},{"value":"Step 3: Customer Accepts (via Public Link)","id":"step-3-customer-accepts-via-public-link","depth":2},{"value":"Step 4: Convert Quote to Invoice","id":"step-4-convert-quote-to-invoice","depth":2},{"value":"Step 5: Send the Invoice","id":"step-5-send-the-invoice","depth":2},{"value":"Step 6: Track Payment Status","id":"step-6-track-payment-status","depth":2},{"value":"Step 7: Send a Payment Reminder","id":"step-7-send-a-payment-reminder","depth":2},{"value":"Step 8: View Financial Overview","id":"step-8-view-financial-overview","depth":2},{"value":"Alternative: Create Invoice Directly","id":"alternative-create-invoice-directly","depth":2},{"value":"Processing Incoming Invoices","id":"processing-incoming-invoices","depth":2},{"value":"Key Takeaways","id":"key-takeaways","depth":2}],"frontmatter":{"seo":{"title":"End-to-End Invoice Workflow"}},"lastModified":"2026-03-22T21:04:26.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/examples/invoice-workflow","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}