Puzzle JournalEntries API
The JournalEntries API from Puzzle — 2 operation(s) for journalentries.
The JournalEntries API from Puzzle — 2 operation(s) for journalentries.
openapi: 3.0.3
info:
title: Puzzle Api Accounts JournalEntries API
description: Puzzle Api
version: '0'
servers:
- url: https://staging.southparkdata.com/rest/v0
tags:
- name: JournalEntries
paths:
/company/{id}/journalEntries:
get:
operationId: journalEntries
summary: Get Journal Entries
description: 'Required scope: read:company'
tags:
- JournalEntries
parameters:
- name: id
in: path
required: true
description: The company ID
schema:
type: string
minLength: 1
description: Partner-facing external identifier
- name: limit
in: query
required: false
schema:
type: integer
- name: cursor
in: query
required: false
schema:
type: string
- name: basis
in: query
required: false
schema:
type: string
enum:
- cash
- accrual
- name: createdAfter
in: query
required: false
schema:
type: string
minLength: 1
description: ISO 8601 timestamp
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
journalEntries:
type: array
items:
type: object
properties:
id:
type: string
minLength: 1
description: Partner-facing external identifier
manualJournalEntryId:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
description:
type: string
nullable: true
memo:
type: string
nullable: true
postingDate:
type: string
effectiveAt:
type: string
minLength: 1
description: ISO 8601 timestamp
basis:
type: string
enum:
- cash
- accrual
nullable: true
type:
type: string
enum:
- Partner
lines:
type: array
items:
type: object
properties:
description:
type: string
nullable: true
amount:
type: string
minLength: 1
description: Arbitrary-precision decimal, serialized as a string
currency:
type: string
minLength: 3
maxLength: 3
description: ISO 4217 currency code
accountId:
type: string
minLength: 1
description: Partner-facing external identifier
required:
- description
- amount
- currency
- accountId
required:
- id
- manualJournalEntryId
- description
- memo
- postingDate
- effectiveAt
- basis
- type
- lines
pageInfo:
type: object
properties:
nextCursor:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
required:
- nextCursor
required:
- journalEntries
- pageInfo
post:
operationId: upsertJournalEntries
summary: Create Journal Entry
description: 'Required scope: write:journal
Journal entries are the entries made in a company''s ledger accounts as a way of recording financial impact. The line items for each journal entry should balance to 0.
Create Journal Entries endpoint creates a Journal Entry into our Gateway and not on our Ledger. Once the Gateway receives a Journal Entry, you get an OK response. Ledger Journal Entries are created async and can be retrieved through the Get Journal Entries endpoint.
Puzzle journal entries are immutable. This means that when an update is made, 2 additional journal entries get created - one to reverse the original journal entry and another to reflect the updates. Reversal journal entries can be identified by their description field - they will have descriptions matching "Reversal of {{journal entry id}}".
All Puzzle companies have both cash and accrual journal entries; they are distinct populations.'
tags:
- JournalEntries
parameters:
- name: id
in: path
required: true
description: The company ID
schema:
type: string
minLength: 1
description: Partner-facing external identifier
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
entries:
type: array
items:
type: object
properties:
basis:
type: array
items:
type: string
memo:
type: string
postingDate:
type: string
minLength: 1
description: Calendar date, YYYY-MM-DD
type:
type: string
enum:
- Journal
- Transaction
nativeTransactionId:
type: string
createdFor:
type: string
lines:
type: array
items:
type: object
properties:
id:
type: string
minLength: 1
description: Partner-facing external identifier
amount:
type: string
minLength: 1
description: Arbitrary-precision decimal, serialized as a string
coaKey:
type: string
minLength: 1
description: Chart-of-accounts key
description:
type: string
manualJournalEntryId:
type: string
minLength: 1
description: Partner-facing external identifier
classifications:
type: array
items:
type: object
properties:
class:
type: string
minLength: 1
segment:
type: string
minLength: 1
required:
- class
- segment
userDefinedMetadata:
type: object
additionalProperties: {}
nullable: true
vendorId:
type: string
minLength: 1
description: Partner-facing external identifier
vendorName:
type: string
customerId:
type: string
minLength: 1
description: Partner-facing external identifier
customerName:
type: string
required:
- amount
- coaKey
- description
document:
type: object
properties:
documentType:
type: string
enum:
- Receipt
- Bill
- Invoice
fileName:
type: string
minLength: 1
contentType:
type: string
minLength: 1
base64File:
type: string
minLength: 1
nativeDocumentId:
type: string
minLength: 1
required:
- documentType
- fileName
- contentType
- base64File
- nativeDocumentId
required:
- basis
- memo
- postingDate
- lines
required:
- entries
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
summary:
type: object
properties:
requested:
type: integer
success:
type: integer
error:
type: integer
required:
- requested
- success
- error
results:
type: array
items:
type: object
properties:
index:
type: integer
status:
type: string
enum:
- success
- error
id:
type: string
minLength: 1
description: Partner-facing external identifier
nativeId:
type: string
error:
type: object
properties:
message:
type: string
code:
type: string
required:
- message
- code
required:
- index
- status
required:
- summary
- results
/company/{id}/journalEntries/{journalEntryId}/document:
post:
operationId: createJournalEntryDocument
summary: Create Document
description: 'Create a document for a given journal entry.
Required scope: write:journal'
tags:
- JournalEntries
parameters:
- name: id
in: path
required: true
description: The company ID
schema:
type: string
minLength: 1
description: Partner-facing external identifier
- name: journalEntryId
in: path
required: true
description: The journal entry ID
schema:
type: string
minLength: 1
description: Partner-facing external identifier
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
documentType:
type: string
enum:
- Receipt
- Bill
- Invoice
fileName:
type: string
minLength: 1
contentType:
type: string
minLength: 1
base64File:
type: string
minLength: 1
nativeDocumentId:
type: string
minLength: 1
required:
- documentType
- fileName
- contentType
- base64File
- nativeDocumentId
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
transactionId:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
manualJournalEntryId:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
journalEntryId:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
billId:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
invoiceId:
type: string
minLength: 1
description: Partner-facing external identifier
nullable: true
document:
type: object
properties:
id:
type: string
documentType:
type: string
enum:
- Receipt
- Bill
- Invoice
contentType:
type: string
downloadInfo:
type: object
properties:
signedUrl:
type: string
urlExpiresAt:
type: string
minLength: 1
description: ISO 8601 timestamp
required:
- signedUrl
- urlExpiresAt
required:
- id
- documentType
- contentType
- downloadInfo
required:
- transactionId
- manualJournalEntryId
- journalEntryId
- billId
- invoiceId
- document