@lotics/cli 0.320.2 → 0.320.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -911,6 +911,730 @@ above. A provider's refusal carries the provider's own words.
911
911
  | `files[].owner` | string \\| null | yes | Email address of the file's owner |
912
912
  | `files[].web_view_link` | string \\| null | yes | URL to open the file in Drive |
913
913
 
914
+ ## easyinvoice
915
+
916
+ ### easyinvoice_attach_ikey (workflow step)
917
+
918
+ - Give an invoice numbered on EasyInvoice's own site an ikey, so the other EasyInvoice tools can name it.
919
+
920
+ **Inputs**
921
+
922
+ | Name | Type | Required | What it is |
923
+ | --- | --- | --- | --- |
924
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
925
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA (Thông tư 78 puts the whole symbol here and leaves serial empty); needed when the account issues under more than one |
926
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
927
+ | `no` | string | yes | The invoice's number |
928
+ | `ikey` | string | yes | A new key of your own, at most 50 characters |
929
+
930
+ **Answer**
931
+
932
+ | Name | Type | Required | What it is |
933
+ | --- | --- | --- | --- |
934
+ | `ikey` | string | yes | |
935
+ | `no` | string | yes | |
936
+
937
+ ### easyinvoice_cancel_invoice (workflow step)
938
+
939
+ - Cancel an issued invoice.
940
+ - Under Nghị định 70 EasyInvoice may refuse, or issue a 0-đồng replacement in its place and return it in Invoices.
941
+
942
+ **Inputs**
943
+
944
+ | Name | Type | Required | What it is |
945
+ | --- | --- | --- | --- |
946
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
947
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA (Thông tư 78 puts the whole symbol here and leaves serial empty); needed when the account issues under more than one |
948
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
949
+ | `ikey` | string | yes | |
950
+
951
+ **Answer**
952
+
953
+ | Name | Type | Required | What it is |
954
+ | --- | --- | --- | --- |
955
+ | `Pattern` | string \\| null | yes | |
956
+ | `Serial` | string \\| null | yes | |
957
+ | `Invoices` | object[] | yes | |
958
+ | `Invoices[].Ikey` | string \\| null | yes | |
959
+ | `Invoices[].Pattern` | string \\| null | yes | |
960
+ | `Invoices[].Serial` | string \\| null | yes | |
961
+ | `Invoices[].No` | string \\| null | yes | The invoice number; empty until issued |
962
+ | `Invoices[].InvoiceStatus` | number \\| null | yes | -1 reserved, 0 unsigned, 1 signed, 2 tax-declared, 3 replaced, 4 adjusted, 5 cancelled, 6 approved |
963
+ | `Invoices[].TCTCheckStatus` | number \\| null | yes | Tax authority: null not sent, 0 not processed, -1 checking, 1 valid, -2 invalid |
964
+ | `Invoices[].TCTErrorMessage` | string \\| null | yes | |
965
+ | `Invoices[].TaxAuthorityCode` | string \\| null | yes | Mã của cơ quan thuế, a few minutes after issuing |
966
+ | `Invoices[].LookupCode` | string \\| null | yes | Mã tra cứu, which the buyer looks the invoice up by |
967
+ | `Invoices[].LinkView` | string \\| null | yes | |
968
+ | `Invoices[].ArisingDate` | string \\| null | yes | dd/MM/yyyy |
969
+ | `Invoices[].IssueDate` | string \\| null | yes | dd/MM/yyyy |
970
+ | `Invoices[].Buyer` | string \\| null | yes | |
971
+ | `Invoices[].CustomerName` | string \\| null | yes | |
972
+ | `Invoices[].CustomerCode` | string \\| null | yes | |
973
+ | `Invoices[].CustomerTaxCode` | string \\| null | yes | |
974
+ | `Invoices[].Total` | number \\| null | yes | |
975
+ | `Invoices[].TaxAmount` | number \\| null | yes | |
976
+ | `Invoices[].Amount` | number \\| null | yes | |
977
+
978
+ ### easyinvoice_convert_invoice (workflow step)
979
+
980
+ - Convert an issued invoice to paper (bản chuyển đổi), to prove where goods came from or to archive, and save the PDF as a workspace file.
981
+ - The invoice is named by ikey or by its lookup code.
982
+
983
+ **Inputs**
984
+
985
+ | Name | Type | Required | What it is |
986
+ | --- | --- | --- | --- |
987
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
988
+ | `purpose` | "proof_of_origin" \\| "archive" | yes | |
989
+ | `ikey` | string | | |
990
+ | `lookup_code` | string | | Mã tra cứu |
991
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA |
992
+
993
+ **Answer**
994
+
995
+ | Name | Type | Required | What it is |
996
+ | --- | --- | --- | --- |
997
+ | `file_id` | string | yes | The ID of the generated file. |
998
+ | `url` | string | yes | The download URL of the generated file. |
999
+ | `filename` | string | yes | The filename of the generated file, including extension. |
1000
+ | `mime_type` | string | yes | The MIME type of the generated file. |
1001
+
1002
+ ### easyinvoice_correct_invoice (workflow step)
1003
+
1004
+ - Adjust or replace one issued invoice with a new invoice, in EasyInvoice's field names.
1005
+ - The new invoice's totals and amount in words are summed from its lines.
1006
+
1007
+ **Inputs**
1008
+
1009
+ | Name | Type | Required | What it is |
1010
+ | --- | --- | --- | --- |
1011
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1012
+ | `kind` | "adjust" \\| "replace" \\| "adjust_draft" \\| "replace_draft" | yes | adjust, replace: created and signed at once. adjust_draft, replace_draft: created unsigned, issued later by easyinvoice_issue_invoices. (workflow step, chat) |
1013
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA (Thông tư 78 puts the whole symbol here and leaves serial empty); needed when the account issues under more than one |
1014
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
1015
+ | `original_ikey` | string | | Ikey of the invoice corrected |
1016
+ | `related_invoice` | object | | An original issued outside EasyInvoice, in place of original_ikey (adjust and replace only) |
1017
+ | `related_invoice.Pattern` | string | yes | |
1018
+ | `related_invoice.Serial` | string | yes | |
1019
+ | `related_invoice.No` | string | yes | |
1020
+ | `related_invoice.ArisingDate` | string | yes | The original's date, YYYY-MM-DD |
1021
+ | `related_invoice.RelatedType` | number | yes | 1 a Thông tư 78 e-invoice; 3 a Thông tư 32 or paper invoice |
1022
+ | `invoice` | object | yes | The new invoice; its Ikey is a new key of your own |
1023
+ | `invoice.Ikey` | string | yes | Your own key for this invoice, at most 50 characters; every later call names the invoice by it |
1024
+ | `invoice.ArisingDate` | string | yes | Invoice date, YYYY-MM-DD |
1025
+ | `invoice.PaymentMethod` | string | yes | Tiền mặt, Chuyển khoản, Tiền mặt/Chuyển khoản, Đối trừ công nợ, Không thu tiền, or other words printed as given |
1026
+ | `invoice.CurrencyUnit` | string | yes | VND, USD, EUR, … |
1027
+ | `invoice.ExchangeRate` | number | | Required unless VND |
1028
+ | `invoice.VATRate` | number | yes | 0, 5, 8, 10; -1 not taxable; -2 not declared; -3 another rate, stated in VATRateOther; -5 financial leasing; -6 outside the VAT law; -7 not in the taxable price |
1029
+ | `invoice.VATRateOther` | number | | |
1030
+ | `invoice.Products` | object[] | yes | |
1031
+ | `invoice.Products[].No` | number | | Printed line number; 0 prints none |
1032
+ | `invoice.Products[].Feature` | number | yes | 1 goods/service, 2 promotion, 3 commercial discount (positive, subtracted from the invoice), 4 note line, 5 special goods |
1033
+ | `invoice.Products[].Code` | string | | |
1034
+ | `invoice.Products[].ProdName` | string | yes | |
1035
+ | `invoice.Products[].BusinessProdGroupCode` | string | | Business group, e.g. 01_2 |
1036
+ | `invoice.Products[].ProdUnit` | string | | |
1037
+ | `invoice.Products[].ProdQuantity` | number | | |
1038
+ | `invoice.Products[].ProdPrice` | number | | |
1039
+ | `invoice.Products[].Discount` | number | | Line discount rate, % |
1040
+ | `invoice.Products[].DiscountAmount` | number | | |
1041
+ | `invoice.Products[].Total` | number | yes | Before VAT, after the line's own discount; 0 on a note line |
1042
+ | `invoice.Products[].VATRate` | number | | The invoice's VATRate when absent |
1043
+ | `invoice.Products[].VATRateOther` | number | | The rate when VATRate is -3 |
1044
+ | `invoice.Products[].VATAmount` | number | | Absent only on a note line |
1045
+ | `invoice.Products[].Extra` | string | | A JSON object: {"Pos":""} on a note line, the special-goods attributes on Feature 5 |
1046
+ | `invoice.CusCode` | string | | EasyInvoice files the buyer under this code, creating or updating it |
1047
+ | `invoice.Buyer` | string | | The buyer's personal name; this or CusName is required |
1048
+ | `invoice.CusName` | string | | The buyer company's name; required with CusTaxCode |
1049
+ | `invoice.CusTaxCode` | string | | |
1050
+ | `invoice.CusAddress` | string | | Required with CusTaxCode |
1051
+ | `invoice.CusEmails` | string | | Comma-separated; where the issuance notice goes |
1052
+ | `invoice.Email` | string | | |
1053
+ | `invoice.EmailCC` | string | | |
1054
+ | `invoice.CusBankName` | string | | |
1055
+ | `invoice.CusBankNo` | string | | |
1056
+ | `invoice.CusPhone` | string | | |
1057
+ | `invoice.CusIdentification` | string | | Buyer's citizen ID, 9 or 12 characters |
1058
+ | `invoice.PassportNo` | string | | |
1059
+ | `invoice.BudgetaryRelationshipCode` | string | | |
1060
+ | `invoice.ProvinceCode` | string | | |
1061
+ | `invoice.ProvinceName` | string | | |
1062
+ | `invoice.CommuneCode` | string | | |
1063
+ | `invoice.CommuneName` | string | | |
1064
+ | `invoice.LocationCode` | string | | Required for a household or individual business, with LocationName and LocationAddress |
1065
+ | `invoice.LocationName` | string | | |
1066
+ | `invoice.LocationAddress` | string | | |
1067
+ | `invoice.StoreCode` | string | | |
1068
+ | `invoice.StoreName` | string | | |
1069
+ | `invoice.Note` | string | | |
1070
+ | `invoice.ListAttachNum` | string | | Number of the bảng kê the invoice carries |
1071
+ | `invoice.ListAttachDate` | string | | Its date, YYYY-MM-DD |
1072
+ | `invoice.IdentityCardNumber` | string | | National-reserve sale: the buyer's ID when they have no tax code |
1073
+ | `invoice.TaxAuthorityCode` | string | | An invoice made from a cash register: the code it already holds |
1074
+ | `invoice.ComRelateCode` | string | | Public-asset sale: the seller's budget unit code |
1075
+ | `invoice.CusRelateCode` | string | | Public-asset sale: the buyer's budget unit code |
1076
+ | `invoice.DecisionCode` | string | | |
1077
+ | `invoice.DecisionDate` | string | | YYYY-MM-DD |
1078
+ | `invoice.DecisionAgent` | string | | |
1079
+ | `invoice.SellMethod` | string | | |
1080
+ | `invoice.TransportAddress` | string | | |
1081
+ | `invoice.TransportDateFrom` | string | | YYYY-MM-DD |
1082
+ | `invoice.TransportDateTo` | string | | YYYY-MM-DD |
1083
+ | `invoice.Extra` | string | | A JSON object of fields agreed with EasyInvoice |
1084
+ | `invoice.AdjustReplaceReasonCode` | number | yes | 1–14 (Thông tư 91 Điều 10); 13 corrects an invoice issued wrong |
1085
+ | `invoice.Type` | number | | Required on an adjustment, absent on a replacement: 2 increase, 3 decrease, 4 information only |
1086
+
1087
+ **Answer**
1088
+
1089
+ | Name | Type | Required | What it is |
1090
+ | --- | --- | --- | --- |
1091
+ | `Pattern` | string \\| null | yes | |
1092
+ | `Serial` | string \\| null | yes | |
1093
+ | `Invoices` | object[] | yes | |
1094
+ | `Invoices[].Ikey` | string \\| null | yes | |
1095
+ | `Invoices[].Pattern` | string \\| null | yes | |
1096
+ | `Invoices[].Serial` | string \\| null | yes | |
1097
+ | `Invoices[].No` | string \\| null | yes | The invoice number; empty until issued |
1098
+ | `Invoices[].InvoiceStatus` | number \\| null | yes | -1 reserved, 0 unsigned, 1 signed, 2 tax-declared, 3 replaced, 4 adjusted, 5 cancelled, 6 approved |
1099
+ | `Invoices[].TCTCheckStatus` | number \\| null | yes | Tax authority: null not sent, 0 not processed, -1 checking, 1 valid, -2 invalid |
1100
+ | `Invoices[].TCTErrorMessage` | string \\| null | yes | |
1101
+ | `Invoices[].TaxAuthorityCode` | string \\| null | yes | Mã của cơ quan thuế, a few minutes after issuing |
1102
+ | `Invoices[].LookupCode` | string \\| null | yes | Mã tra cứu, which the buyer looks the invoice up by |
1103
+ | `Invoices[].LinkView` | string \\| null | yes | |
1104
+ | `Invoices[].ArisingDate` | string \\| null | yes | dd/MM/yyyy |
1105
+ | `Invoices[].IssueDate` | string \\| null | yes | dd/MM/yyyy |
1106
+ | `Invoices[].Buyer` | string \\| null | yes | |
1107
+ | `Invoices[].CustomerName` | string \\| null | yes | |
1108
+ | `Invoices[].CustomerCode` | string \\| null | yes | |
1109
+ | `Invoices[].CustomerTaxCode` | string \\| null | yes | |
1110
+ | `Invoices[].Total` | number \\| null | yes | |
1111
+ | `Invoices[].TaxAmount` | number \\| null | yes | |
1112
+ | `Invoices[].Amount` | number \\| null | yes | |
1113
+
1114
+ ### easyinvoice_create_invoices (workflow step)
1115
+
1116
+ - Create invoices on EasyInvoice, in its own field names.
1117
+ - An Ikey that already holds a draft updates that draft.
1118
+ - Each invoice's totals and amount in words are summed from its lines.
1119
+
1120
+ **Inputs**
1121
+
1122
+ | Name | Type | Required | What it is |
1123
+ | --- | --- | --- | --- |
1124
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1125
+ | `kind` | "draft" \\| "reserved" \\| "issue" | yes | draft: unsigned and unnumbered, deletable, issued later by easyinvoice_issue_invoices. reserved: numbered by its InvNo from a reserved range, awaiting signature. issue: created and signed at once. (workflow step, chat) |
1126
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA (Thông tư 78 puts the whole symbol here and leaves serial empty); needed when the account issues under more than one |
1127
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
1128
+ | `invoices` | object[] | yes | |
1129
+ | `invoices[].Ikey` | string | yes | Your own key for this invoice, at most 50 characters; every later call names the invoice by it |
1130
+ | `invoices[].ArisingDate` | string | yes | Invoice date, YYYY-MM-DD |
1131
+ | `invoices[].PaymentMethod` | string | yes | Tiền mặt, Chuyển khoản, Tiền mặt/Chuyển khoản, Đối trừ công nợ, Không thu tiền, or other words printed as given |
1132
+ | `invoices[].CurrencyUnit` | string | yes | VND, USD, EUR, … |
1133
+ | `invoices[].ExchangeRate` | number | | Required unless VND |
1134
+ | `invoices[].VATRate` | number | yes | 0, 5, 8, 10; -1 not taxable; -2 not declared; -3 another rate, stated in VATRateOther; -5 financial leasing; -6 outside the VAT law; -7 not in the taxable price |
1135
+ | `invoices[].VATRateOther` | number | | |
1136
+ | `invoices[].Products` | object[] | yes | |
1137
+ | `invoices[].Products[].No` | number | | Printed line number; 0 prints none |
1138
+ | `invoices[].Products[].Feature` | number | yes | 1 goods/service, 2 promotion, 3 commercial discount (positive, subtracted from the invoice), 4 note line, 5 special goods |
1139
+ | `invoices[].Products[].Code` | string | | |
1140
+ | `invoices[].Products[].ProdName` | string | yes | |
1141
+ | `invoices[].Products[].BusinessProdGroupCode` | string | | Business group, e.g. 01_2 |
1142
+ | `invoices[].Products[].ProdUnit` | string | | |
1143
+ | `invoices[].Products[].ProdQuantity` | number | | |
1144
+ | `invoices[].Products[].ProdPrice` | number | | |
1145
+ | `invoices[].Products[].Discount` | number | | Line discount rate, % |
1146
+ | `invoices[].Products[].DiscountAmount` | number | | |
1147
+ | `invoices[].Products[].Total` | number | yes | Before VAT, after the line's own discount; 0 on a note line |
1148
+ | `invoices[].Products[].VATRate` | number | | The invoice's VATRate when absent |
1149
+ | `invoices[].Products[].VATRateOther` | number | | The rate when VATRate is -3 |
1150
+ | `invoices[].Products[].VATAmount` | number | | Absent only on a note line |
1151
+ | `invoices[].Products[].Extra` | string | | A JSON object: {"Pos":""} on a note line, the special-goods attributes on Feature 5 |
1152
+ | `invoices[].CusCode` | string | | EasyInvoice files the buyer under this code, creating or updating it |
1153
+ | `invoices[].Buyer` | string | | The buyer's personal name; this or CusName is required |
1154
+ | `invoices[].CusName` | string | | The buyer company's name; required with CusTaxCode |
1155
+ | `invoices[].CusTaxCode` | string | | |
1156
+ | `invoices[].CusAddress` | string | | Required with CusTaxCode |
1157
+ | `invoices[].CusEmails` | string | | Comma-separated; where the issuance notice goes |
1158
+ | `invoices[].Email` | string | | |
1159
+ | `invoices[].EmailCC` | string | | |
1160
+ | `invoices[].CusBankName` | string | | |
1161
+ | `invoices[].CusBankNo` | string | | |
1162
+ | `invoices[].CusPhone` | string | | |
1163
+ | `invoices[].CusIdentification` | string | | Buyer's citizen ID, 9 or 12 characters |
1164
+ | `invoices[].PassportNo` | string | | |
1165
+ | `invoices[].BudgetaryRelationshipCode` | string | | |
1166
+ | `invoices[].ProvinceCode` | string | | |
1167
+ | `invoices[].ProvinceName` | string | | |
1168
+ | `invoices[].CommuneCode` | string | | |
1169
+ | `invoices[].CommuneName` | string | | |
1170
+ | `invoices[].LocationCode` | string | | Required for a household or individual business, with LocationName and LocationAddress |
1171
+ | `invoices[].LocationName` | string | | |
1172
+ | `invoices[].LocationAddress` | string | | |
1173
+ | `invoices[].StoreCode` | string | | |
1174
+ | `invoices[].StoreName` | string | | |
1175
+ | `invoices[].Note` | string | | |
1176
+ | `invoices[].ListAttachNum` | string | | Number of the bảng kê the invoice carries |
1177
+ | `invoices[].ListAttachDate` | string | | Its date, YYYY-MM-DD |
1178
+ | `invoices[].IdentityCardNumber` | string | | National-reserve sale: the buyer's ID when they have no tax code |
1179
+ | `invoices[].TaxAuthorityCode` | string | | An invoice made from a cash register: the code it already holds |
1180
+ | `invoices[].ComRelateCode` | string | | Public-asset sale: the seller's budget unit code |
1181
+ | `invoices[].CusRelateCode` | string | | Public-asset sale: the buyer's budget unit code |
1182
+ | `invoices[].DecisionCode` | string | | |
1183
+ | `invoices[].DecisionDate` | string | | YYYY-MM-DD |
1184
+ | `invoices[].DecisionAgent` | string | | |
1185
+ | `invoices[].SellMethod` | string | | |
1186
+ | `invoices[].TransportAddress` | string | | |
1187
+ | `invoices[].TransportDateFrom` | string | | YYYY-MM-DD |
1188
+ | `invoices[].TransportDateTo` | string | | YYYY-MM-DD |
1189
+ | `invoices[].Extra` | string | | A JSON object of fields agreed with EasyInvoice |
1190
+ | `invoices[].InvNo` | number | | The number, from a reserved range; only on reserved invoices |
1191
+ | `invoices[].StoreAddress` | string | | |
1192
+
1193
+ **Answer**
1194
+
1195
+ | Name | Type | Required | What it is |
1196
+ | --- | --- | --- | --- |
1197
+ | `Pattern` | string \\| null | yes | |
1198
+ | `Serial` | string \\| null | yes | |
1199
+ | `Invoices` | object[] | yes | |
1200
+ | `Invoices[].Ikey` | string \\| null | yes | |
1201
+ | `Invoices[].Pattern` | string \\| null | yes | |
1202
+ | `Invoices[].Serial` | string \\| null | yes | |
1203
+ | `Invoices[].No` | string \\| null | yes | The invoice number; empty until issued |
1204
+ | `Invoices[].InvoiceStatus` | number \\| null | yes | -1 reserved, 0 unsigned, 1 signed, 2 tax-declared, 3 replaced, 4 adjusted, 5 cancelled, 6 approved |
1205
+ | `Invoices[].TCTCheckStatus` | number \\| null | yes | Tax authority: null not sent, 0 not processed, -1 checking, 1 valid, -2 invalid |
1206
+ | `Invoices[].TCTErrorMessage` | string \\| null | yes | |
1207
+ | `Invoices[].TaxAuthorityCode` | string \\| null | yes | Mã của cơ quan thuế, a few minutes after issuing |
1208
+ | `Invoices[].LookupCode` | string \\| null | yes | Mã tra cứu, which the buyer looks the invoice up by |
1209
+ | `Invoices[].LinkView` | string \\| null | yes | |
1210
+ | `Invoices[].ArisingDate` | string \\| null | yes | dd/MM/yyyy |
1211
+ | `Invoices[].IssueDate` | string \\| null | yes | dd/MM/yyyy |
1212
+ | `Invoices[].Buyer` | string \\| null | yes | |
1213
+ | `Invoices[].CustomerName` | string \\| null | yes | |
1214
+ | `Invoices[].CustomerCode` | string \\| null | yes | |
1215
+ | `Invoices[].CustomerTaxCode` | string \\| null | yes | |
1216
+ | `Invoices[].Total` | number \\| null | yes | |
1217
+ | `Invoices[].TaxAmount` | number \\| null | yes | |
1218
+ | `Invoices[].Amount` | number \\| null | yes | |
1219
+
1220
+ ### easyinvoice_delete_draft (workflow step)
1221
+
1222
+ - Delete an invoice that was never signed.
1223
+
1224
+ **Inputs**
1225
+
1226
+ | Name | Type | Required | What it is |
1227
+ | --- | --- | --- | --- |
1228
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1229
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA (Thông tư 78 puts the whole symbol here and leaves serial empty); needed when the account issues under more than one |
1230
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
1231
+ | `ikey` | string | yes | |
1232
+
1233
+ **Answer**
1234
+
1235
+ | Name | Type | Required | What it is |
1236
+ | --- | --- | --- | --- |
1237
+ | `deleted_ikey` | string | yes | |
1238
+
1239
+ ### easyinvoice_get_invoice_file (workflow step)
1240
+
1241
+ - Save an invoice's PDF or XML as a workspace file, the invoice named by ikey or by its lookup code.
1242
+
1243
+ **Inputs**
1244
+
1245
+ | Name | Type | Required | What it is |
1246
+ | --- | --- | --- | --- |
1247
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1248
+ | `format` | "xml" \\| "pdf" | yes | |
1249
+ | `ikey` | string | | |
1250
+ | `lookup_code` | string | | Mã tra cứu |
1251
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA |
1252
+
1253
+ **Answer**
1254
+
1255
+ | Name | Type | Required | What it is |
1256
+ | --- | --- | --- | --- |
1257
+ | `file_id` | string | yes | The ID of the generated file. |
1258
+ | `url` | string | yes | The download URL of the generated file. |
1259
+ | `filename` | string | yes | The filename of the generated file, including extension. |
1260
+ | `mime_type` | string | yes | The MIME type of the generated file. |
1261
+
1262
+ ### easyinvoice_get_invoices (workflow step)
1263
+
1264
+ - Read invoices by their ikeys: status, number, lookup code and the tax authority's verdict and code.
1265
+
1266
+ **Inputs**
1267
+
1268
+ | Name | Type | Required | What it is |
1269
+ | --- | --- | --- | --- |
1270
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1271
+ | `ikeys` | string[] | yes | |
1272
+
1273
+ **Answer**
1274
+
1275
+ | Name | Type | Required | What it is |
1276
+ | --- | --- | --- | --- |
1277
+ | `invoices` | object[] | yes | |
1278
+ | `invoices[].Ikey` | string \\| null | yes | |
1279
+ | `invoices[].Pattern` | string \\| null | yes | |
1280
+ | `invoices[].Serial` | string \\| null | yes | |
1281
+ | `invoices[].No` | string \\| null | yes | The invoice number; empty until issued |
1282
+ | `invoices[].InvoiceStatus` | number \\| null | yes | -1 reserved, 0 unsigned, 1 signed, 2 tax-declared, 3 replaced, 4 adjusted, 5 cancelled, 6 approved |
1283
+ | `invoices[].TCTCheckStatus` | number \\| null | yes | Tax authority: null not sent, 0 not processed, -1 checking, 1 valid, -2 invalid |
1284
+ | `invoices[].TCTErrorMessage` | string \\| null | yes | |
1285
+ | `invoices[].TaxAuthorityCode` | string \\| null | yes | Mã của cơ quan thuế, a few minutes after issuing |
1286
+ | `invoices[].LookupCode` | string \\| null | yes | Mã tra cứu, which the buyer looks the invoice up by |
1287
+ | `invoices[].LinkView` | string \\| null | yes | |
1288
+ | `invoices[].ArisingDate` | string \\| null | yes | dd/MM/yyyy |
1289
+ | `invoices[].IssueDate` | string \\| null | yes | dd/MM/yyyy |
1290
+ | `invoices[].Buyer` | string \\| null | yes | |
1291
+ | `invoices[].CustomerName` | string \\| null | yes | |
1292
+ | `invoices[].CustomerCode` | string \\| null | yes | |
1293
+ | `invoices[].CustomerTaxCode` | string \\| null | yes | |
1294
+ | `invoices[].Total` | number \\| null | yes | |
1295
+ | `invoices[].TaxAmount` | number \\| null | yes | |
1296
+ | `invoices[].Amount` | number \\| null | yes | |
1297
+
1298
+ ### easyinvoice_get_report (workflow step)
1299
+
1300
+ - Save a period's invoice-usage report (BC26/AC) or listing of sales documents (bảng kê) as a workspace file.
1301
+ - The htkk kinds are for import into HTKK.
1302
+
1303
+ **Inputs**
1304
+
1305
+ | Name | Type | Required | What it is |
1306
+ | --- | --- | --- | --- |
1307
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1308
+ | `kind` | "usage_excel" \\| "usage_htkk_excel" \\| "usage_htkk_xml" \\| "sales_listing_html" \\| "sales_listing_excel" | yes | |
1309
+ | `from_date` | string | yes | YYYY-MM-DD |
1310
+ | `to_date` | string | yes | YYYY-MM-DD |
1311
+
1312
+ **Answer**
1313
+
1314
+ | Name | Type | Required | What it is |
1315
+ | --- | --- | --- | --- |
1316
+ | `file_id` | string | yes | The ID of the generated file. |
1317
+ | `url` | string | yes | The download URL of the generated file. |
1318
+ | `filename` | string | yes | The filename of the generated file, including extension. |
1319
+ | `mime_type` | string | yes | The MIME type of the generated file. |
1320
+
1321
+ ### easyinvoice_issue_invoices (workflow step)
1322
+
1323
+ - Sign and issue drafts and reserved invoices, all under one symbol.
1324
+ - An issued invoice goes to the tax authority and is corrected only by adjustment or replacement.
1325
+
1326
+ **Inputs**
1327
+
1328
+ | Name | Type | Required | What it is |
1329
+ | --- | --- | --- | --- |
1330
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1331
+ | `pattern` | string | yes | The invoice symbol they share, e.g. 1C26TAA |
1332
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
1333
+ | `ikeys` | string[] | yes | |
1334
+
1335
+ **Answer**
1336
+
1337
+ | Name | Type | Required | What it is |
1338
+ | --- | --- | --- | --- |
1339
+ | `Pattern` | string \\| null | yes | |
1340
+ | `Serial` | string \\| null | yes | |
1341
+ | `Invoices` | object[] | yes | |
1342
+ | `Invoices[].Ikey` | string \\| null | yes | |
1343
+ | `Invoices[].Pattern` | string \\| null | yes | |
1344
+ | `Invoices[].Serial` | string \\| null | yes | |
1345
+ | `Invoices[].No` | string \\| null | yes | The invoice number; empty until issued |
1346
+ | `Invoices[].InvoiceStatus` | number \\| null | yes | -1 reserved, 0 unsigned, 1 signed, 2 tax-declared, 3 replaced, 4 adjusted, 5 cancelled, 6 approved |
1347
+ | `Invoices[].TCTCheckStatus` | number \\| null | yes | Tax authority: null not sent, 0 not processed, -1 checking, 1 valid, -2 invalid |
1348
+ | `Invoices[].TCTErrorMessage` | string \\| null | yes | |
1349
+ | `Invoices[].TaxAuthorityCode` | string \\| null | yes | Mã của cơ quan thuế, a few minutes after issuing |
1350
+ | `Invoices[].LookupCode` | string \\| null | yes | Mã tra cứu, which the buyer looks the invoice up by |
1351
+ | `Invoices[].LinkView` | string \\| null | yes | |
1352
+ | `Invoices[].ArisingDate` | string \\| null | yes | dd/MM/yyyy |
1353
+ | `Invoices[].IssueDate` | string \\| null | yes | dd/MM/yyyy |
1354
+ | `Invoices[].Buyer` | string \\| null | yes | |
1355
+ | `Invoices[].CustomerName` | string \\| null | yes | |
1356
+ | `Invoices[].CustomerCode` | string \\| null | yes | |
1357
+ | `Invoices[].CustomerTaxCode` | string \\| null | yes | |
1358
+ | `Invoices[].Total` | number \\| null | yes | |
1359
+ | `Invoices[].TaxAmount` | number \\| null | yes | |
1360
+ | `Invoices[].Amount` | number \\| null | yes | |
1361
+
1362
+ ### easyinvoice_list_invoices (workflow step)
1363
+
1364
+ - List invoices dated within a window, a page at a time.
1365
+
1366
+ **Inputs**
1367
+
1368
+ | Name | Type | Required | What it is |
1369
+ | --- | --- | --- | --- |
1370
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1371
+ | `from_date` | string | yes | YYYY-MM-DD |
1372
+ | `to_date` | string | yes | YYYY-MM-DD |
1373
+ | `page` | number | | 1-based |
1374
+ | `page_size` | number | | At most 100 |
1375
+ | `pattern` | string | | Only invoices under this symbol |
1376
+ | `include_web_invoices` | boolean | | Also invoices made on EasyInvoice's own site, not only through this connection's API |
1377
+
1378
+ **Answer**
1379
+
1380
+ | Name | Type | Required | What it is |
1381
+ | --- | --- | --- | --- |
1382
+ | `page` | number \\| null | yes | |
1383
+ | `page_size` | number \\| null | yes | |
1384
+ | `total_records` | number \\| null | yes | |
1385
+ | `total_pages` | number \\| null | yes | |
1386
+ | `invoices` | object[] | yes | |
1387
+ | `invoices[].Ikey` | string \\| null | yes | |
1388
+ | `invoices[].Pattern` | string \\| null | yes | |
1389
+ | `invoices[].Serial` | string \\| null | yes | |
1390
+ | `invoices[].No` | string \\| null | yes | The invoice number; empty until issued |
1391
+ | `invoices[].InvoiceStatus` | number \\| null | yes | -1 reserved, 0 unsigned, 1 signed, 2 tax-declared, 3 replaced, 4 adjusted, 5 cancelled, 6 approved |
1392
+ | `invoices[].TCTCheckStatus` | number \\| null | yes | Tax authority: null not sent, 0 not processed, -1 checking, 1 valid, -2 invalid |
1393
+ | `invoices[].TCTErrorMessage` | string \\| null | yes | |
1394
+ | `invoices[].TaxAuthorityCode` | string \\| null | yes | Mã của cơ quan thuế, a few minutes after issuing |
1395
+ | `invoices[].LookupCode` | string \\| null | yes | Mã tra cứu, which the buyer looks the invoice up by |
1396
+ | `invoices[].LinkView` | string \\| null | yes | |
1397
+ | `invoices[].ArisingDate` | string \\| null | yes | dd/MM/yyyy |
1398
+ | `invoices[].IssueDate` | string \\| null | yes | dd/MM/yyyy |
1399
+ | `invoices[].Buyer` | string \\| null | yes | |
1400
+ | `invoices[].CustomerName` | string \\| null | yes | |
1401
+ | `invoices[].CustomerCode` | string \\| null | yes | |
1402
+ | `invoices[].CustomerTaxCode` | string \\| null | yes | |
1403
+ | `invoices[].Total` | number \\| null | yes | |
1404
+ | `invoices[].TaxAmount` | number \\| null | yes | |
1405
+ | `invoices[].Amount` | number \\| null | yes | |
1406
+
1407
+ ### easyinvoice_list_reserved_numbers (workflow step)
1408
+
1409
+ - List the numbers of a reserved range still waiting to be signed.
1410
+
1411
+ **Inputs**
1412
+
1413
+ | Name | Type | Required | What it is |
1414
+ | --- | --- | --- | --- |
1415
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1416
+ | `pattern` | string | yes | The invoice symbol, e.g. 1C26TAA |
1417
+ | `serial` | string | yes | Empty under Thông tư 78 |
1418
+
1419
+ **Answer**
1420
+
1421
+ | Name | Type | Required | What it is |
1422
+ | --- | --- | --- | --- |
1423
+ | `numbers` | string[] | yes | |
1424
+
1425
+ ### easyinvoice_preview_invoice (workflow step)
1426
+
1427
+ - Save how an invoice would print, as a PDF or HTML workspace file, before it is created.
1428
+ - Nothing is created on EasyInvoice.
1429
+
1430
+ **Inputs**
1431
+
1432
+ | Name | Type | Required | What it is |
1433
+ | --- | --- | --- | --- |
1434
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1435
+ | `kind` | "invoice" \\| "replacement" \\| "adjustment_increase" \\| "adjustment_decrease" \\| "adjustment_information" | yes | invoice: a new one. The others: a replacement or adjustment, whose invoice states its AdjustReplaceReasonCode |
1436
+ | `format` | "pdf" \\| "html" | yes | |
1437
+ | `pattern` | string | | The invoice symbol, e.g. 1C26TAA (Thông tư 78 puts the whole symbol here and leaves serial empty); needed when the account issues under more than one |
1438
+ | `serial` | string | | Ký hiệu of a Thông tư 32 range |
1439
+ | `invoice` | object | yes | |
1440
+ | `invoice.Ikey` | string | yes | Your own key for this invoice, at most 50 characters; every later call names the invoice by it |
1441
+ | `invoice.ArisingDate` | string | yes | Invoice date, YYYY-MM-DD |
1442
+ | `invoice.PaymentMethod` | string | yes | Tiền mặt, Chuyển khoản, Tiền mặt/Chuyển khoản, Đối trừ công nợ, Không thu tiền, or other words printed as given |
1443
+ | `invoice.CurrencyUnit` | string | yes | VND, USD, EUR, … |
1444
+ | `invoice.ExchangeRate` | number | | Required unless VND |
1445
+ | `invoice.VATRate` | number | yes | 0, 5, 8, 10; -1 not taxable; -2 not declared; -3 another rate, stated in VATRateOther; -5 financial leasing; -6 outside the VAT law; -7 not in the taxable price |
1446
+ | `invoice.VATRateOther` | number | | |
1447
+ | `invoice.Products` | object[] | yes | |
1448
+ | `invoice.Products[].No` | number | | Printed line number; 0 prints none |
1449
+ | `invoice.Products[].Feature` | number | yes | 1 goods/service, 2 promotion, 3 commercial discount (positive, subtracted from the invoice), 4 note line, 5 special goods |
1450
+ | `invoice.Products[].Code` | string | | |
1451
+ | `invoice.Products[].ProdName` | string | yes | |
1452
+ | `invoice.Products[].BusinessProdGroupCode` | string | | Business group, e.g. 01_2 |
1453
+ | `invoice.Products[].ProdUnit` | string | | |
1454
+ | `invoice.Products[].ProdQuantity` | number | | |
1455
+ | `invoice.Products[].ProdPrice` | number | | |
1456
+ | `invoice.Products[].Discount` | number | | Line discount rate, % |
1457
+ | `invoice.Products[].DiscountAmount` | number | | |
1458
+ | `invoice.Products[].Total` | number | yes | Before VAT, after the line's own discount; 0 on a note line |
1459
+ | `invoice.Products[].VATRate` | number | | The invoice's VATRate when absent |
1460
+ | `invoice.Products[].VATRateOther` | number | | The rate when VATRate is -3 |
1461
+ | `invoice.Products[].VATAmount` | number | | Absent only on a note line |
1462
+ | `invoice.Products[].Extra` | string | | A JSON object: {"Pos":""} on a note line, the special-goods attributes on Feature 5 |
1463
+ | `invoice.CusCode` | string | | EasyInvoice files the buyer under this code, creating or updating it |
1464
+ | `invoice.Buyer` | string | | The buyer's personal name; this or CusName is required |
1465
+ | `invoice.CusName` | string | | The buyer company's name; required with CusTaxCode |
1466
+ | `invoice.CusTaxCode` | string | | |
1467
+ | `invoice.CusAddress` | string | | Required with CusTaxCode |
1468
+ | `invoice.CusEmails` | string | | Comma-separated; where the issuance notice goes |
1469
+ | `invoice.Email` | string | | |
1470
+ | `invoice.EmailCC` | string | | |
1471
+ | `invoice.CusBankName` | string | | |
1472
+ | `invoice.CusBankNo` | string | | |
1473
+ | `invoice.CusPhone` | string | | |
1474
+ | `invoice.CusIdentification` | string | | Buyer's citizen ID, 9 or 12 characters |
1475
+ | `invoice.PassportNo` | string | | |
1476
+ | `invoice.BudgetaryRelationshipCode` | string | | |
1477
+ | `invoice.ProvinceCode` | string | | |
1478
+ | `invoice.ProvinceName` | string | | |
1479
+ | `invoice.CommuneCode` | string | | |
1480
+ | `invoice.CommuneName` | string | | |
1481
+ | `invoice.LocationCode` | string | | Required for a household or individual business, with LocationName and LocationAddress |
1482
+ | `invoice.LocationName` | string | | |
1483
+ | `invoice.LocationAddress` | string | | |
1484
+ | `invoice.StoreCode` | string | | |
1485
+ | `invoice.StoreName` | string | | |
1486
+ | `invoice.Note` | string | | |
1487
+ | `invoice.ListAttachNum` | string | | Number of the bảng kê the invoice carries |
1488
+ | `invoice.ListAttachDate` | string | | Its date, YYYY-MM-DD |
1489
+ | `invoice.IdentityCardNumber` | string | | National-reserve sale: the buyer's ID when they have no tax code |
1490
+ | `invoice.TaxAuthorityCode` | string | | An invoice made from a cash register: the code it already holds |
1491
+ | `invoice.ComRelateCode` | string | | Public-asset sale: the seller's budget unit code |
1492
+ | `invoice.CusRelateCode` | string | | Public-asset sale: the buyer's budget unit code |
1493
+ | `invoice.DecisionCode` | string | | |
1494
+ | `invoice.DecisionDate` | string | | YYYY-MM-DD |
1495
+ | `invoice.DecisionAgent` | string | | |
1496
+ | `invoice.SellMethod` | string | | |
1497
+ | `invoice.TransportAddress` | string | | |
1498
+ | `invoice.TransportDateFrom` | string | | YYYY-MM-DD |
1499
+ | `invoice.TransportDateTo` | string | | YYYY-MM-DD |
1500
+ | `invoice.Extra` | string | | A JSON object of fields agreed with EasyInvoice |
1501
+ | `invoice.AdjustReplaceReasonCode` | number | | 1–14 (Thông tư 91 Điều 10); 13 corrects an invoice issued wrong |
1502
+
1503
+ **Answer**
1504
+
1505
+ | Name | Type | Required | What it is |
1506
+ | --- | --- | --- | --- |
1507
+ | `file_id` | string | yes | The ID of the generated file. |
1508
+ | `url` | string | yes | The download URL of the generated file. |
1509
+ | `filename` | string | yes | The filename of the generated file, including extension. |
1510
+ | `mime_type` | string | yes | The MIME type of the generated file. |
1511
+
1512
+ ### easyinvoice_reserve_numbers (workflow step)
1513
+
1514
+ - Reserve invoice numbers in a range, for invoices created later with kind reserved.
1515
+ - Give quantity or ikey_dates.
1516
+ - EasyInvoice must have granted the account reserved ranges.
1517
+
1518
+ **Inputs**
1519
+
1520
+ | Name | Type | Required | What it is |
1521
+ | --- | --- | --- | --- |
1522
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1523
+ | `pattern` | string | yes | The invoice symbol, e.g. 1C26TAA |
1524
+ | `serial` | string | yes | Empty under Thông tư 78 |
1525
+ | `quantity` | number | | |
1526
+ | `ikey_dates` | object | | Ikey → invoice date (YYYY-MM-DD): one number each |
1527
+
1528
+ **Answer**
1529
+
1530
+ | Name | Type | Required | What it is |
1531
+ | --- | --- | --- | --- |
1532
+ | `Pattern` | string \\| null | yes | |
1533
+ | `Serial` | string \\| null | yes | |
1534
+ | `numbers` | string[] | yes | Reserved by quantity |
1535
+ | `by_ikey` | object | yes | Reserved by ikey: ikey → number |
1536
+
1537
+ ### easyinvoice_save_customers (workflow step)
1538
+
1539
+ - Create or update customers in EasyInvoice's customer list, in its own field names.
1540
+
1541
+ **Inputs**
1542
+
1543
+ | Name | Type | Required | What it is |
1544
+ | --- | --- | --- | --- |
1545
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1546
+ | `customers` | object[] | yes | |
1547
+ | `customers[].Code` | string | yes | Fixed once created |
1548
+ | `customers[].AccountName` | string | yes | The buyer's lookup account; fixed once created |
1549
+ | `customers[].Name` | string | yes | |
1550
+ | `customers[].Buyer` | string | | |
1551
+ | `customers[].Address` | string | | |
1552
+ | `customers[].TaxCode` | string | | Required for a company |
1553
+ | `customers[].BankName` | string | | |
1554
+ | `customers[].BankAccountName` | string | | |
1555
+ | `customers[].BankNumber` | string | | |
1556
+ | `customers[].Email` | string | | |
1557
+ | `customers[].EmailCC` | string | | Comma-separated |
1558
+ | `customers[].Fax` | string | | |
1559
+ | `customers[].Phone` | string | | |
1560
+ | `customers[].ContactPerson` | string | | |
1561
+ | `customers[].RepresentPerson` | string | | |
1562
+ | `customers[].CusType` | number | | 1 the customer keeps accounts, 0 not |
1563
+
1564
+ **Answer**
1565
+
1566
+ | Name | Type | Required | What it is |
1567
+ | --- | --- | --- | --- |
1568
+ | `saved` | number | yes | |
1569
+
1570
+ ### easyinvoice_save_products (workflow step)
1571
+
1572
+ - Create or update products and services in EasyInvoice's product list, in its own field names.
1573
+
1574
+ **Inputs**
1575
+
1576
+ | Name | Type | Required | What it is |
1577
+ | --- | --- | --- | --- |
1578
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1579
+ | `products` | object[] | yes | |
1580
+ | `products[].Code` | string | yes | |
1581
+ | `products[].Name` | string | yes | |
1582
+ | `products[].Price` | number | | |
1583
+ | `products[].Unit` | string | | |
1584
+ | `products[].Des` | string | | |
1585
+ | `products[].VATRate` | number | yes | As on an invoice line |
1586
+
1587
+ **Answer**
1588
+
1589
+ | Name | Type | Required | What it is |
1590
+ | --- | --- | --- | --- |
1591
+ | `saved` | number | yes | |
1592
+
1593
+ ### easyinvoice_send_error_notice (workflow step)
1594
+
1595
+ - File an error notice (04/SS-HĐĐT) with the tax authority for erroneous invoices, through EasyInvoice.
1596
+
1597
+ **Inputs**
1598
+
1599
+ | Name | Type | Required | What it is |
1600
+ | --- | --- | --- | --- |
1601
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1602
+ | `notice_type` | number | yes | 1 the seller's own notice; 2 answering a notice from the tax authority |
1603
+ | `created_date` | string | yes | YYYY-MM-DD |
1604
+ | `tax_authority_notice_no` | string | | Type 2: the tax authority's notice number |
1605
+ | `tax_authority_notice_date` | string | | Type 2: its date, YYYY-MM-DD |
1606
+ | `invoices` | object[] | yes | |
1607
+ | `invoices[].Pattern` | string | yes | |
1608
+ | `invoices[].Serial` | string | | |
1609
+ | `invoices[].No` | number | yes | |
1610
+ | `invoices[].ArisingDate` | string | yes | YYYY-MM-DD |
1611
+ | `invoices[].TaxAuthorityCode` | string | | Required unless the invoice carries none |
1612
+ | `invoices[].InvType` | number | yes | 1 NĐ 123/2020 e-invoice; 2 authenticated under QĐ 1209/2660; 3 under NĐ 51/2010 or 04/2014; 4 printed to order under NĐ 123/2020 |
1613
+ | `invoices[].Note` | string | yes | The reason |
1614
+
1615
+ **Answer**
1616
+
1617
+ | Name | Type | Required | What it is |
1618
+ | --- | --- | --- | --- |
1619
+ | `sent` | number | yes | Invoices the notice names |
1620
+
1621
+ ### easyinvoice_send_issuance_notice (workflow step)
1622
+
1623
+ - Send invoices' issuance notices again, each to the address given for it.
1624
+
1625
+ **Inputs**
1626
+
1627
+ | Name | Type | Required | What it is |
1628
+ | --- | --- | --- | --- |
1629
+ | `connected_account_id` | string | yes | EasyInvoice connected account |
1630
+ | `emails` | object | yes | Ikey → email address |
1631
+
1632
+ **Answer**
1633
+
1634
+ | Name | Type | Required | What it is |
1635
+ | --- | --- | --- | --- |
1636
+ | `results` | object | yes | Ikey → EasyInvoice's answer for it, sent or refused |
1637
+
914
1638
  ## evaluate
915
1639
 
916
1640
  ### evaluate_formula (workflow step)