Skip to content

Commit

Permalink
Merged PR 83648: 81502 Sync for payables v2 bill attachments fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Codat Pipeline Bot committed Oct 31, 2024
1 parent 130e2ca commit 669a122
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 53 deletions.
95 changes: 62 additions & 33 deletions json/Codat-Sync-Payables.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,27 @@
},
"responses": {
"201": {
"description": "Created"
"description": "Created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Attachment"
},
"examples": {
"Attachment metadata": {
"value": {
"id": "422f093f-e556-4bf3-91c0-93af70c3e850",
"name": "receipt.png",
"contentType": "image/png",
"dateCreated": "2022-10-23T00:00:00.000Z",
"fileSize": 100,
"includeWhenSent": true,
"sourceModifiedDate": "2022-05-26T10:34:10Z"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
Expand All @@ -1582,21 +1602,11 @@
"$ref": "#/components/responses/Service-Unavailable"
}
}
}
},
"/companies/{companyId}/connections/{connectionId}/bills/{billId}/attachments": {
"parameters": [
{
"$ref": "#/components/parameters/companyId"
},
{
"$ref": "#/components/parameters/connectionId"
},
{
"$ref": "#/components/parameters/billId"
}
],
},
"get": {
"summary": "List bill attachments",
"description": "The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.",
"operationId": "list-bill-attachments",
"tags": [
"Bills"
],
Expand All @@ -1606,19 +1616,30 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Attachment"
"$ref": "#/components/schemas/Attachment/definitions/attachments"
},
"examples": {
"Info": {
"value": {
"id": "422f093f-e556-4bf3-91c0-93af70c3e850",
"name": "receipt.png",
"contentType": "image/png",
"dateCreated": "2022-10-23T00:00:00.000Z",
"fileSize": 100,
"includeWhenSent": true,
"sourceModifiedDate": "2022-05-26T10:34:10Z"
}
"Attachments": {
"value": [
{
"id": "422f093f-e556-4bf3-91c0-93af70c3e850",
"name": "receipt.png",
"contentType": "image/png",
"dateCreated": "2022-10-23T00:00:00.000Z",
"fileSize": 100,
"includeWhenSent": true,
"sourceModifiedDate": "2022-05-26T10:34:10Z"
},
{
"id": "20cfd269-2f0f-44ef-a28c-7b5f725cf1aa",
"name": "another_receipt.png",
"contentType": "image/png",
"dateCreated": "2022-10-24T00:00:00.000Z",
"fileSize": 98,
"includeWhenSent": true,
"sourceModifiedDate": "2022-05-27T12:38:10Z"
}
]
}
}
}
Expand Down Expand Up @@ -1648,10 +1669,7 @@
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
},
"operationId": "list-bill-attachments",
"summary": "List bill attachments",
"description": "The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services."
}
}
},
"/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download": {
Expand Down Expand Up @@ -2316,12 +2334,11 @@
}
},
"Attachment": {
"title": "Attachment",
"title": "Attachment metadata",
"description": " The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes.\n\n > **Retrieving attachments**\n > \n > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data.\n\n Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments.\n\n Note that different integrations have different requirements for file size and extension of attachments.\n\n | Integration | File size | File extension |\n |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP |\n | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML |\n | NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |\n | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state <a className=\"external\" href=\"https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice\" target=\"_blank\">here</a> that \"You can attach any type of file, such as text, image, or video files\". |",
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
Expand Down Expand Up @@ -2370,7 +2387,19 @@
}
}
}
]
],
"definitions": {
"attachments": {
"title": "Attachments",
"description": {
"$ref": "#/components/schemas/Attachment/description"
},
"type": "array",
"items": {
"$ref": "#/components/schemas/Attachment"
}
}
}
},
"AttachmentUpload": {
"title": "Attachment upload",
Expand Down
63 changes: 43 additions & 20 deletions yaml/Codat-Sync-Payables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,20 @@ paths:
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/Attachment'
examples:
Attachment metadata:
value:
id: 422f093f-e556-4bf3-91c0-93af70c3e850
name: receipt.png
contentType: image/png
dateCreated: '2022-10-23T00:00:00.000Z'
fileSize: 100
includeWhenSent: true
sourceModifiedDate: '2022-05-26T10:34:10Z'
'400':
$ref: '#/components/responses/BadRequest'
'401':
Expand All @@ -1061,12 +1075,10 @@ paths:
$ref: '#/components/responses/Internal-Server-Error'
'503':
$ref: '#/components/responses/Service-Unavailable'
'/companies/{companyId}/connections/{connectionId}/bills/{billId}/attachments':
parameters:
- $ref: '#/components/parameters/companyId'
- $ref: '#/components/parameters/connectionId'
- $ref: '#/components/parameters/billId'
get:
summary: List bill attachments
description: "The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services."
operationId: list-bill-attachments
tags:
- Bills
responses:
Expand All @@ -1075,17 +1087,24 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Attachment'
$ref: '#/components/schemas/Attachment/definitions/attachments'
examples:
Info:
Attachments:
value:
id: 422f093f-e556-4bf3-91c0-93af70c3e850
name: receipt.png
contentType: image/png
dateCreated: '2022-10-23T00:00:00.000Z'
fileSize: 100
includeWhenSent: true
sourceModifiedDate: '2022-05-26T10:34:10Z'
- id: 422f093f-e556-4bf3-91c0-93af70c3e850
name: receipt.png
contentType: image/png
dateCreated: '2022-10-23T00:00:00.000Z'
fileSize: 100
includeWhenSent: true
sourceModifiedDate: '2022-05-26T10:34:10Z'
- id: 20cfd269-2f0f-44ef-a28c-7b5f725cf1aa
name: another_receipt.png
contentType: image/png
dateCreated: '2022-10-24T00:00:00.000Z'
fileSize: 98
includeWhenSent: true
sourceModifiedDate: '2022-05-27T12:38:10Z'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
Expand All @@ -1102,9 +1121,6 @@ paths:
$ref: '#/components/responses/Internal-Server-Error'
'503':
$ref: '#/components/responses/Service-Unavailable'
operationId: list-bill-attachments
summary: List bill attachments
description: "The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services."
'/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download':
parameters:
- $ref: '#/components/parameters/companyId'
Expand Down Expand Up @@ -1555,7 +1571,7 @@ components:
- Billing
- Delivery
Attachment:
title: Attachment
title: Attachment metadata
description: |2-
The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes.
Expand All @@ -1575,8 +1591,7 @@ components:
| Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state <a className="external" href="https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice" target="_blank">here</a> that "You can attach any type of file, such as text, image, or video files". |
type: object
allOf:
- type: object
properties:
- properties:
id:
type: string
description: 'Identifier for the attachment, unique for the company in the accounting software.'
Expand Down Expand Up @@ -1619,6 +1634,14 @@ components:
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records
In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.
definitions:
attachments:
title: Attachments
description:
$ref: '#/components/schemas/Attachment/description'
type: array
items:
$ref: '#/components/schemas/Attachment'
AttachmentUpload:
title: Attachment upload
type: object
Expand Down

0 comments on commit 669a122

Please sign in to comment.