Skip to content

Commit 1b4cf22

Browse files
bolg55claudekhaliqgant
authored
feat(quickbooks): add txn_date input to create-invoice action (#432)
## Summary Adds support for setting the invoice transaction date (`TxnDate`) when creating QuickBooks invoices. ## Problem The `create-invoice` action currently doesn't allow setting the invoice date (`TxnDate`). QuickBooks defaults to today's date, which is incorrect when: - Billing for past service periods (e.g., creating August invoices in September) - Invoice dates need to match billing cycles The `txn_date` field is already mapped in the **output** (via `toInvoice`), but cannot be set as **input**. ## Changes - `schema.zod.ts`: Added `txn_date: z.string().optional()` to `createInvoiceSchema` - `mappers/to-invoice.ts`: Added mapping `txn_date` → `TxnDate` in `toQuickBooksInvoice()` - `actions/create-invoice.md`: Updated documentation ## Backward Compatibility Fully backward compatible - `txn_date` is optional, existing integrations unaffected. --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Khaliq <khaliq@nango.dev>
1 parent 6f41087 commit 1b4cf22

File tree

13 files changed

+47
-14
lines changed

13 files changed

+47
-14
lines changed

integrations/.nango/nango.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11883,7 +11883,7 @@
1188311883
"ActionInput_quickbooks_createinvoice",
1188411884
"ActionOutput_quickbooks_createinvoice"
1188511885
],
11886-
"version": "1.0.0"
11886+
"version": "1.0.1"
1188711887
},
1188811888
{
1188911889
"type": "action",
@@ -12059,7 +12059,7 @@
1205912059
"ActionInput_quickbooks_updateinvoice",
1206012060
"ActionOutput_quickbooks_updateinvoice"
1206112061
],
12062-
"version": "1.0.0"
12062+
"version": "1.0.1"
1206312063
},
1206412064
{
1206512065
"type": "action",

integrations/.nango/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49447,6 +49447,9 @@
4944749447
"additionalProperties": false
4944849448
}
4944949449
},
49450+
"txn_date": {
49451+
"type": "string"
49452+
},
4945049453
"due_date": {
4945149454
"type": "string"
4945249455
},
@@ -52104,6 +52107,9 @@
5210452107
"additionalProperties": false
5210552108
}
5210652109
},
52110+
"txn_date": {
52111+
"type": "string"
52112+
},
5210752113
"due_date": {
5210852114
"type": "string"
5210952115
},

integrations/.nango/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10468,6 +10468,7 @@ export interface ActionInput_quickbooks_createinvoice {
1046810468
unit_price_cents?: number | undefined;
1046910469
discount_rate?: number | undefined;
1047010470
description?: string | undefined;})[];
10471+
txn_date?: string | undefined;
1047110472
due_date?: string | undefined;
1047210473
currency_ref: { name?: string | undefined;
1047310474
value: string;};
@@ -10938,6 +10939,7 @@ export interface ActionInput_quickbooks_updateinvoice {
1093810939
unit_price_cents?: number | undefined;
1093910940
discount_rate?: number | undefined;
1094010941
description?: string | undefined;})[];
10942+
txn_date?: string | undefined;
1094110943
due_date?: string | undefined;
1094210944
currency_ref: { name?: string | undefined;
1094310945
value: string;};

integrations/quickbooks/.nango/nango.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"ActionInput_quickbooks_createinvoice",
111111
"ActionOutput_quickbooks_createinvoice"
112112
],
113-
"version": "1.0.0"
113+
"version": "1.0.1"
114114
},
115115
{
116116
"type": "action",
@@ -286,7 +286,7 @@
286286
"ActionInput_quickbooks_updateinvoice",
287287
"ActionOutput_quickbooks_updateinvoice"
288288
],
289-
"version": "1.0.0"
289+
"version": "1.0.1"
290290
},
291291
{
292292
"type": "action",

integrations/quickbooks/.nango/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,9 @@
17361736
"additionalProperties": false
17371737
}
17381738
},
1739+
"txn_date": {
1740+
"type": "string"
1741+
},
17391742
"due_date": {
17401743
"type": "string"
17411744
},
@@ -4393,6 +4396,9 @@
43934396
"additionalProperties": false
43944397
}
43954398
},
4399+
"txn_date": {
4400+
"type": "string"
4401+
},
43964402
"due_date": {
43974403
"type": "string"
43984404
},

integrations/quickbooks/.nango/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ export interface ActionInput_quickbooks_createinvoice {
389389
unit_price_cents?: number | undefined;
390390
discount_rate?: number | undefined;
391391
description?: string | undefined;})[];
392+
txn_date?: string | undefined;
392393
due_date?: string | undefined;
393394
currency_ref: { name?: string | undefined;
394395
value: string;};
@@ -859,6 +860,7 @@ export interface ActionInput_quickbooks_updateinvoice {
859860
unit_price_cents?: number | undefined;
860861
discount_rate?: number | undefined;
861862
description?: string | undefined;})[];
863+
txn_date?: string | undefined;
862864
due_date?: string | undefined;
863865
currency_ref: { name?: string | undefined;
864866
value: string;};

integrations/quickbooks/actions/create-invoice.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ _No request parameters_
4747
"description?": "<string>"
4848
}
4949
],
50+
"txn_date?": "<string>",
5051
"due_date?": "<string>",
5152
"currency_ref": {
5253
"name?": "<string>",

integrations/quickbooks/actions/create-invoice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Invoice, CreateInvoice } from '../models.js';
1919
*/
2020
const action = createAction({
2121
description: 'Creates a single invoice in QuickBooks.',
22-
version: '1.0.0',
22+
version: '1.0.1',
2323

2424
endpoint: {
2525
method: 'POST',

integrations/quickbooks/actions/update-invoice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Invoice, UpdateInvoice } from '../models.js';
1919
*/
2020
const action = createAction({
2121
description: 'Updates a single invoice in QuickBooks.',
22-
version: '1.0.0',
22+
version: '1.0.1',
2323

2424
endpoint: {
2525
method: 'PUT',

integrations/quickbooks/mappers/to-invoice.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export function toQuickBooksInvoice(invoice: CreateInvoice | UpdateInvoice): Par
6464
quickBooksInvoice.CustomerRef = customerRef;
6565
}
6666

67+
if (invoice.txn_date) {
68+
quickBooksInvoice.TxnDate = toDate(invoice.txn_date);
69+
}
70+
6771
if (invoice.due_date) {
6872
quickBooksInvoice.DueDate = toDate(invoice.due_date);
6973
}
@@ -77,10 +81,7 @@ export function toQuickBooksInvoice(invoice: CreateInvoice | UpdateInvoice): Par
7781

7882
if (line.sales_item_line_detail) {
7983
qbLine.SalesItemLineDetail = {
80-
ItemRef: {
81-
value: line.sales_item_line_detail.item_ref.value,
82-
name: line.sales_item_line_detail.item_ref.name ?? ''
83-
}
84+
ItemRef: { value: line.sales_item_line_detail.item_ref.value, name: line.sales_item_line_detail.item_ref.name ?? '' }
8485
};
8586

8687
if (line.quantity) {

0 commit comments

Comments
 (0)