Journal Lines API GTK Custom usage instructions - kannanmdu/GTK GitHub Wiki
Journal Lines API GTK Custom
Overview
This custom API provides a RESTful interface for managing general journal lines in Business Central. It's designed to handle financial journal entries with comprehensive field support and automated line number management.
API Specifications
- APIGroup:
GTKAPI
- APIPublisher:
GTKIPL
- APIVersion:
v2.0
- EntityName:
journalLine
- EntitySetName:
journalLines
- ODataKeyFields:
SystemId
Endpoints
Base URL Structure
https://{baseURL}/api/GTKIPL/GTKAPI/v2.0/journalLines
Available Operations
Get Journal Lines
GET /api/GTKIPL/GTKAPI/v2.0/journalLines
Get Journal Lines by Template and Batch
GET /api/GTKIPL/GTKAPI/v2.0/journalLines?$filter=journalTemplateName eq '{templateName}' and journalBatchName eq '{batchName}'
Get Specific Journal Line
GET /api/GTKIPL/GTKAPI/v2.0/journalLines({systemId})
Create Journal Line
POST /api/GTKIPL/GTKAPI/v2.0/journalLines
Content-Type: application/json
{
"journalBatchId": "YOUR-BATCH-ID",
"journalTemplateName": "GENERAL",
"accountType": "G/L Account",
"accountNo": "10400",
"postingDate": "2025-04-06",
"documentNo": "INV001",
"amount": 1000.00,
"description": "Office Supplies"
}
Field Reference
Key Fields
systemId
: System ID (Key field)journalBatchId
: Journal Batch IDjournalBatchName
: Journal Batch NamejournalTemplateName
: Journal Template NamelineNo
: Line Number (Auto-generated)
Document Fields
postingDate
: Posting DatedocumentType
: Document TypedocumentNo
: Document NumberdocumentDate
: Document DatedueDate
: Due DateexternalDocumentNo
: External Document NumberyourReference
: Your Reference
Account Fields
accountType
: Account TypeaccountNo
: Account NumberaccountId
: Account IDbalAccountNo
: Balancing Account NumberbalAccountType
: Balancing Account TypebalanceAccountId
: Balance Account ID
Amount Fields
amount
: AmountamountLCY
: Amount (LCY)currencyCode
: Currency CodecurrencyFactor
: Currency Factor
Posting Group Fields
genBusPostingGroup
: General Business Posting GroupgenPostingType
: General Posting TypegenProdPostingGroup
: General Product Posting GroupbalGenBusPostingGroup
: Bal. General Business Posting GroupbalGenPostingType
: Bal. General Posting TypebalGenProdPostingGroup
: Bal. General Product Posting GroupbalVATBusPostingGroup
: Bal. VAT Business Posting GroupbalVATProdPostingGroup
: Bal. VAT Product Posting Group
Additional Fields
shortcutDimension1Code
: Dimension 1 CodeshortcutDimension2Code
: Dimension 2 Codedescription
: Descriptioncomment
: CommentpaymentMethodCode
: Payment Method CodepaymentTermsCode
: Payment Terms Code
Technical Details
Line Number Generation
- Starting line number: 10000
- Increment: 100
- Automatically assigns next available line number
- Handles gaps for future insertions
Features
- Delayed Insert enabled for performance
- Automatic line number generation
- Full support for dimensions
- Comprehensive posting group handling
- Multi-currency support
Best Practices
- Always provide required fields
- Use proper account types and numbers
- Include appropriate posting dates
- Validate currency codes when used
- Set proper dimension codes as configured
- Handle errors appropriately
Notes
- The API uses OData v4.0 query syntax
- All requests require proper authentication
- Special characters in filter values must be URL encoded
- Response format is JSON
- Dates should be in ISO 8601 format