1{
2 "invoices": [
3 {
4 "shouldCalculateTax": true,
5 "taxCalculationStatus": "Estimated",
6 "graph": {
7 "graphId": "CreateInvoice",
8 "records": [
9 {
10 "referenceId": "refAccount",
11 "record": {
12 "attributes": {
13 "type": "Account",
14 "method": "GET",
15 "id": "ExternalId__c/123"
16 }
17 }
18 },
19 {
20 "referenceId": "refContact",
21 "record": {
22 "attributes": {
23 "type": "Contact",
24 "method": "GET",
25 "id": "ExternalId__c/123"
26 }
27 }
28 },
29 {
30 "referenceId": "refInvoice",
31 "record": {
32 "attributes": {
33 "type": "Invoice",
34 "method": "POST"
35 },
36 "billingAccountId": "@{refAccount.Id}",
37 "billToContactId": "@{refContact.Id}",
38 "paymentTermId": "2OXxx0000004CFUGA2",
39 "referenceEntityId": "801xx000003GeQQAA0",
40 "status": "Draft",
41 "invoiceDate": "2024-12-19",
42 "currencyIsoCode": "USD",
43 "dueDate": "2024-12-19",
44 "invoiceNumber": "DOC-10",
45 "description": "Sample Invoice",
46 "uniqueIdentifier": "5873af8f-f007-4aa0-9e3d-53a08c3f59de"
47 }
48 },
49 {
50 "referenceId": "refBillingAddress",
51 "record": {
52 "attributes": {
53 "type": "InvoiceAddressGroup",
54 "method": "POST"
55 },
56 "street": "123 Main St",
57 "city": "NewYork",
58 "postalCode": "10001",
59 "state": "New York",
60 "country": "US",
61 "longitude": "123.456",
62 "latitude": "78.910",
63 "invoiceId": "@{refInvoice.id}"
64 }
65 },
66 {
67 "referenceId": "refShippingAddress",
68 "record": {
69 "attributes": {
70 "type": "InvoiceAddressGroup",
71 "method": "POST"
72 },
73 "street": "123 Main St",
74 "city": "NewYork",
75 "postalCode": "10001",
76 "state": "New York",
77 "country": "US",
78 "longitude": "123.456",
79 "latitude": "78.910",
80 "invoiceId": "@{refInvoice.id}"
81 }
82 },
83 {
84 "referenceId": "refShipFromAddress",
85 "record": {
86 "attributes": {
87 "type": "InvoiceAddressGroup",
88 "method": "POST"
89 },
90 "street": "1 Market Street",
91 "city": "San Francisco",
92 "postalCode": "94105",
93 "state": "CA",
94 "country": "US",
95 "longitude": "123.456",
96 "latitude": "78.910",
97 "invoiceId": "@{refInvoice.id}"
98 }
99 },
100 {
101 "referenceId": "refInvoiceLine1",
102 "record": {
103 "attributes": {
104 "type": "InvoiceLine",
105 "method": "POST"
106 },
107 "name": "productName1",
108 "product2Id": "01txx0000006ic4AAA",
109 "invoiceLineStartDate": "2024-11-10",
110 "invoiceLineEndDate": "2024-11-13",
111 "quantity": "10",
112 "unitPrice": "10",
113 "chargeAmount": "100",
114 "invoiceId": "@{refInvoice.id}",
115 "referenceEntityItemId": "802xx000001neB9AAI",
116 "billingAddressId": "@{refBillingAddress.id}",
117 "shippingAddressId": "@{refShippingAddress.id}",
118 "shipFromAddressId": "@{refShipFromAddress.id}",
119 "taxTreatmentId": "1ttxx0000000BOTAA2",
120 "legalEntityId": "0fwxx0000000001AAA",
121 "legalEntityAccountingPeriodId": "1HLxx0000004C92GAE"
122 }
123 },
124 {
125 "referenceId": "refInvoiceLine2",
126 "record": {
127 "attributes": {
128 "type": "InvoiceLine",
129 "method": "POST"
130 },
131 "name": "productName2",
132 "product2Id": "01txx0000006ic4AAA",
133 "invoiceLineStartDate": "2024-11-10",
134 "invoiceLineEndDate": "2024-11-15",
135 "quantity": "10",
136 "unitPrice": "10",
137 "chargeAmount": "100",
138 "invoiceId": "@{refInvoice.id}",
139 "referenceEntityItemId": "802xx000001neB9AAI",
140 "billingAddressId": "@{refBillingAddress.id}",
141 "shippingAddressId": "@{refShippingAddress.id}",
142 "shipFromAddressId": "@{refShipFromAddress.id}",
143 "taxTreatmentId": "1ttxx00000001DpAAI",
144 "legalEntityId": "0fwxx0000000001AAA",
145 "legalEntityAccountingPeriodId": "1HLxx0000004C92GAE"
146 }
147 },
148 {
149 "referenceId": "refInvoiceLineTax",
150 "record": {
151 "attributes": {
152 "type": "InvoiceLineTax",
153 "method": "POST"
154 },
155 "taxAmount": 7.25,
156 "taxCode": "CA-94121",
157 "taxName": "CALIFORNIA",
158 "taxRate": 0.25,
159 "taxEffectiveDate": "2024-11-10",
160 "taxDocumentNumber": "123",
161 "taxExemptAmount": 0,
162 "taxTransactionNumber": "kl",
163 "description": "Associated tax line.",
164 "invoiceLineId": "@{refInvoiceLine1.id}"
165 }
166 },
167 {
168 "referenceId": "refInvoiceLineTax1",
169 "record": {
170 "attributes": {
171 "type": "InvoiceLineTax",
172 "method": "POST"
173 },
174 "taxAmount": "10",
175 "taxCode": "CA-94121",
176 "taxName": "CALIFORNIA",
177 "taxRate": 0.25,
178 "taxEffectiveDate": "2024-11-10",
179 "taxDocumentNumber": "123",
180 "taxExemptAmount": 0,
181 "taxTransactionNumber": "125",
182 "invoiceLineId": "@{refInvoiceLine2.id}",
183 "description": "Associated tax line."
184 }
185 }
186 ]
187 }
188 }
189 ]
190}