def generate_response(invoice_line_ids): assert len(invoice_line_ids) == 1, "the mocked response is for 1 lines" for i, line in enumerate(response['lines']): line['lineNumber'] = 'account.move.line,%s' % invoice_line_ids[i].id return response response = {'addresses': [{'boundaryLevel': 'Address', 'city': 'Charleston', 'country': 'US', 'id': 85073906405601, 'latitude': '0', 'line1': 'XXXX', 'line2': '', 'line3': '', 'longitude': '0', 'postalCode': '0', 'region': 'SC', 'taxRegionId': 2113524, 'transactionId': 85073906405600}, {'boundaryLevel': 'Address', 'city': 'San Francisco', 'country': 'US', 'id': 85073906405602, 'latitude': '37.71116', 'line1': '250 Executive Park Blvd Ste 3400', 'line2': '', 'line3': '', 'longitude': '-122.391717', 'postalCode': '94134-3349', 'region': 'CA', 'taxRegionId': 4016940, 'transactionId': 85073906405600}], 'adjustmentDescription': 'Create or adjust transaction', 'adjustmentReason': 'Other', 'batchCode': '', 'businessIdentificationNo': '', 'code': 'Journal Entry 109', 'companyId': 2765828, 'country': 'US', 'currencyCode': 'USD', 'customerCode': 'Contact 45', 'customerUsageType': '', 'customerVendorCode': 'Contact 45', 'date': '2024-12-10', 'destinationAddressId': 0, 'entityUseCode': '', 'exchangeRate': 1.0, 'exchangeRateCurrencyCode': 'USD', 'exchangeRateEffectiveDate': '2024-12-10', 'exemptNo': '', 'id': 85073906405600, 'isSellerImporterOfRecord': False, 'lines': [{'boundaryOverrideId': 0, 'businessIdentificationNo': '', 'costInsuranceFreight': 0.0, 'customerUsageType': '', 'description': '[E-COM07] Large Cabinet', 'destinationAddressId': 85073906405601, 'details': [{'addressId': 85073906405601, 'chargedTo': 'Buyer', 'country': 'US', 'countyFIPS': '', 'exemptAmount': 0.0, 'exemptReasonId': 4, 'exemptRuleId': 0, 'exemptUnits': 0.0, 'id': 85073906405613, 'inState': False, 'isFee': False, 'isNonPassThru': False, 'jurisCode': '45', 'jurisName': 'SOUTH CAROLINA', 'jurisType': 'STA', 'jurisdictionId': 52, 'jurisdictionType': 'State', 'liabilityType': 'Seller', 'nonTaxableAmount': 0.0, 'nonTaxableRuleId': 0, 'nonTaxableType': 'RateRule', 'nonTaxableUnits': 0.0, 'rate': 0.06, 'rateRuleId': 1109432, 'rateSourceId': 3, 'rateType': 'General', 'rateTypeCode': 'G', 'region': 'SC', 'reportingExemptUnits': 0.0, 'reportingNonTaxableUnits': 0.0, 'reportingTax': 1.8, 'reportingTaxCalculated': 1.8, 'reportingTaxableUnits': 30.0, 'serCode': '', 'signatureCode': 'BNPB', 'sourcing': 'Destination', 'stateAssignedNo': '', 'stateFIPS': '45', 'tax': 1.8, 'taxAuthorityTypeId': 45, 'taxCalculated': 1.8, 'taxName': 'SC STATE TAX', 'taxOverride': 0.0, 'taxRegionId': 2113524, 'taxSubTypeId': 'S', 'taxType': 'Sales', 'taxTypeGroupId': 'SalesAndUse', 'taxableAmount': 30.0, 'taxableUnits': 30.0, 'transactionId': 85073906405600, 'transactionLineId': 85073906405606, 'unitOfBasis': 'PerCurrencyUnit'}, {'addressId': 85073906405601, 'chargedTo': 'Buyer', 'country': 'US', 'countyFIPS': '', 'exemptAmount': 0.0, 'exemptReasonId': 4, 'exemptRuleId': 0, 'exemptUnits': 0.0, 'id': 85073906405614, 'inState': False, 'isFee': False, 'isNonPassThru': False, 'jurisCode': '019', 'jurisName': 'CHARLESTON', 'jurisType': 'CTY', 'jurisdictionId': 2342, 'jurisdictionType': 'County', 'liabilityType': 'Seller', 'nonTaxableAmount': 0.0, 'nonTaxableRuleId': 0, 'nonTaxableType': 'RateRule', 'nonTaxableUnits': 0.0, 'rate': 0.0, 'rateRuleId': 1109119, 'rateSourceId': 3, 'rateType': 'General', 'rateTypeCode': 'G', 'region': 'SC', 'reportingExemptUnits': 0.0, 'reportingNonTaxableUnits': 0.0, 'reportingTax': 0.0, 'reportingTaxCalculated': 0.0, 'reportingTaxableUnits': 30.0, 'serCode': '', 'signatureCode': 'BNSO', 'sourcing': 'Destination', 'stateAssignedNo': '1010', 'stateFIPS': '45', 'tax': 0.0, 'taxAuthorityTypeId': 45, 'taxCalculated': 0.0, 'taxName': 'SC COUNTY TAX', 'taxOverride': 0.0, 'taxRegionId': 2113524, 'taxSubTypeId': 'S', 'taxType': 'Sales', 'taxTypeGroupId': 'SalesAndUse', 'taxableAmount': 30.0, 'taxableUnits': 30.0, 'transactionId': 85073906405600, 'transactionLineId': 85073906405606, 'unitOfBasis': 'PerCurrencyUnit'}, {'addressId': 85073906405601, 'chargedTo': 'Buyer', 'country': 'US', 'countyFIPS': '', 'exemptAmount': 0.0, 'exemptReasonId': 4, 'exemptRuleId': 0, 'exemptUnits': 0.0, 'id': 85073906405615, 'inState': False, 'isFee': False, 'isNonPassThru': False, 'jurisCode': '13330', 'jurisName': 'CHARLESTON', 'jurisType': 'CIT', 'jurisdictionId': 140842, 'jurisdictionType': 'City', 'liabilityType': 'Seller', 'nonTaxableAmount': 0.0, 'nonTaxableRuleId': 0, 'nonTaxableType': 'RateRule', 'nonTaxableUnits': 0.0, 'rate': 0.01, 'rateRuleId': 1110408, 'rateSourceId': 3, 'rateType': 'General', 'rateTypeCode': 'G', 'region': 'SC', 'reportingExemptUnits': 0.0, 'reportingNonTaxableUnits': 0.0, 'reportingTax': 0.3, 'reportingTaxCalculated': 0.3, 'reportingTaxableUnits': 30.0, 'serCode': '', 'signatureCode': 'BNSR', 'sourcing': 'Destination', 'stateAssignedNo': '2130', 'stateFIPS': '45', 'tax': 0.3, 'taxAuthorityTypeId': 45, 'taxCalculated': 0.3, 'taxName': 'SC CITY TAX', 'taxOverride': 0.0, 'taxRegionId': 2113524, 'taxSubTypeId': 'S', 'taxType': 'Sales', 'taxTypeGroupId': 'SalesAndUse', 'taxableAmount': 30.0, 'taxableUnits': 30.0, 'transactionId': 85073906405600, 'transactionLineId': 85073906405606, 'unitOfBasis': 'PerCurrencyUnit'}, {'addressId': 85073906405601, 'chargedTo': 'Buyer', 'country': 'US', 'countyFIPS': '', 'exemptAmount': 0.0, 'exemptReasonId': 4, 'exemptRuleId': 0, 'exemptUnits': 0.0, 'id': 85073906405616, 'inState': False, 'isFee': False, 'isNonPassThru': False, 'jurisCode': '1245019001', 'jurisName': 'CHARLESTON CO EDUCATIONAL CAPITAL ' 'IMPROVEMENTS TAX', 'jurisType': 'STJ', 'jurisdictionId': 2001059753, 'jurisdictionType': 'Special', 'liabilityType': 'Seller', 'nonTaxableAmount': 0.0, 'nonTaxableRuleId': 0, 'nonTaxableType': 'RateRule', 'nonTaxableUnits': 0.0, 'rate': 0.01, 'rateRuleId': 1109507, 'rateSourceId': 3, 'rateType': 'General', 'rateTypeCode': 'G', 'region': 'SC', 'reportingExemptUnits': 0.0, 'reportingNonTaxableUnits': 0.0, 'reportingTax': 0.3, 'reportingTaxCalculated': 0.3, 'reportingTaxableUnits': 30.0, 'serCode': '', 'signatureCode': 'EILX', 'sourcing': 'Destination', 'stateAssignedNo': '2130', 'stateFIPS': '45', 'tax': 0.3, 'taxAuthorityTypeId': 45, 'taxCalculated': 0.3, 'taxName': 'SC SPECIAL TAX', 'taxOverride': 0.0, 'taxRegionId': 2113524, 'taxSubTypeId': 'S', 'taxType': 'Sales', 'taxTypeGroupId': 'SalesAndUse', 'taxableAmount': 30.0, 'taxableUnits': 30.0, 'transactionId': 85073906405600, 'transactionLineId': 85073906405606, 'unitOfBasis': 'PerCurrencyUnit'}, {'addressId': 85073906405601, 'chargedTo': 'Buyer', 'country': 'US', 'countyFIPS': '', 'exemptAmount': 0.0, 'exemptReasonId': 4, 'exemptRuleId': 0, 'exemptUnits': 0.0, 'id': 85073906405617, 'inState': False, 'isFee': False, 'isNonPassThru': False, 'jurisCode': '5003794', 'jurisName': 'CHARLESTON CO TT', 'jurisType': 'STJ', 'jurisdictionId': 5003794, 'jurisdictionType': 'Special', 'liabilityType': 'Seller', 'nonTaxableAmount': 0.0, 'nonTaxableRuleId': 0, 'nonTaxableType': 'RateRule', 'nonTaxableUnits': 0.0, 'rate': 0.01, 'rateRuleId': 1358516, 'rateSourceId': 3, 'rateType': 'General', 'rateTypeCode': 'G', 'region': 'SC', 'reportingExemptUnits': 0.0, 'reportingNonTaxableUnits': 0.0, 'reportingTax': 0.3, 'reportingTaxCalculated': 0.3, 'reportingTaxableUnits': 30.0, 'serCode': '', 'signatureCode': 'EETL', 'sourcing': 'Destination', 'stateAssignedNo': '2130', 'stateFIPS': '45', 'tax': 0.3, 'taxAuthorityTypeId': 45, 'taxCalculated': 0.3, 'taxName': 'SC SPECIAL TAX', 'taxOverride': 0.0, 'taxRegionId': 2113524, 'taxSubTypeId': 'S', 'taxType': 'Sales', 'taxTypeGroupId': 'SalesAndUse', 'taxableAmount': 30.0, 'taxableUnits': 30.0, 'transactionId': 85073906405600, 'transactionLineId': 85073906405606, 'unitOfBasis': 'PerCurrencyUnit'}], 'discountAmount': 0.0, 'discountTypeId': 0, 'entityUseCode': '', 'exemptAmount': 0.0, 'exemptCertId': 0, 'exemptNo': '', 'hsCode': '', 'id': 85073906405606, 'isItemTaxable': True, 'isSSTP': False, 'itemCode': 'E-COM07', 'lineAmount': 30.0, 'lineLocationTypes': [{'documentAddressId': 85073906405602, 'documentLineId': 85073906405606, 'documentLineLocationTypeId': 85073906405608, 'locationTypeCode': 'ShipFrom'}, {'documentAddressId': 85073906405601, 'documentLineId': 85073906405606, 'documentLineLocationTypeId': 85073906405609, 'locationTypeCode': 'ShipTo'}], 'lineNumber': 'account.move.line,344', 'nonPassthroughDetails': [], 'originAddressId': 85073906405602, 'quantity': 1.0, 'ref1': '', 'ref2': '', 'reportingDate': '2024-12-10', 'revAccount': '', 'sourcing': 'Destination', 'tax': 2.7, 'taxCalculated': 2.7, 'taxCode': 'D0000000', 'taxCodeId': 8570, 'taxDate': '2024-12-10', 'taxEngine': '', 'taxIncluded': False, 'taxOverrideAmount': 0.0, 'taxOverrideReason': '', 'taxOverrideType': 'None', 'taxableAmount': 30.0, 'transactionId': 85073906405600, 'vatCode': '', 'vatNumberTypeId': 0}], 'locationCode': '', 'locationTypes': [{'documentAddressId': 85073906405602, 'documentId': 85073906405600, 'documentLocationTypeId': 85073906405604, 'locationTypeCode': 'ShipFrom'}, {'documentAddressId': 85073906405601, 'documentId': 85073906405600, 'documentLocationTypeId': 85073906405605, 'locationTypeCode': 'ShipTo'}], 'locked': False, 'modifiedDate': '2024-12-10T17:42:45.1649967Z', 'modifiedUserId': 1452151, 'originAddressId': 0, 'paymentDate': '1900-01-01', 'purchaseOrderNo': '', 'reconciled': False, 'referenceCode': '/', 'region': 'SC', 'reportingLocationCode': '', 'salespersonCode': '', 'softwareVersion': '24.12.0.0', 'status': 'Saved', 'summary': [{'country': 'US', 'exemption': 0.0, 'jurisCode': '45', 'jurisName': 'SOUTH CAROLINA', 'jurisType': 'State', 'nonTaxable': 0.0, 'rate': 0.06, 'rateType': 'General', 'region': 'SC', 'stateAssignedNo': '', 'tax': 1.8, 'taxAuthorityType': 45, 'taxCalculated': 1.8, 'taxName': 'SC STATE TAX', 'taxSubType': 'S', 'taxType': 'Sales', 'taxable': 30.0}, {'country': 'US', 'exemption': 0.0, 'jurisCode': '019', 'jurisName': 'CHARLESTON', 'jurisType': 'County', 'nonTaxable': 0.0, 'rate': 0.0, 'rateType': 'General', 'region': 'SC', 'stateAssignedNo': '1010', 'tax': 0.0, 'taxAuthorityType': 45, 'taxCalculated': 0.0, 'taxName': 'SC COUNTY TAX', 'taxSubType': 'S', 'taxType': 'Sales', 'taxable': 30.0}, {'country': 'US', 'exemption': 0.0, 'jurisCode': '13330', 'jurisName': 'CHARLESTON', 'jurisType': 'City', 'nonTaxable': 0.0, 'rate': 0.01, 'rateType': 'General', 'region': 'SC', 'stateAssignedNo': '2130', 'tax': 0.3, 'taxAuthorityType': 45, 'taxCalculated': 0.3, 'taxName': 'SC CITY TAX', 'taxSubType': 'S', 'taxType': 'Sales', 'taxable': 30.0}, {'country': 'US', 'exemption': 0.0, 'jurisCode': '1245019001', 'jurisName': 'CHARLESTON CO EDUCATIONAL CAPITAL IMPROVEMENTS TAX', 'jurisType': 'Special', 'nonTaxable': 0.0, 'rate': 0.01, 'rateType': 'General', 'region': 'SC', 'stateAssignedNo': '2130', 'tax': 0.3, 'taxAuthorityType': 45, 'taxCalculated': 0.3, 'taxName': 'SC SPECIAL TAX', 'taxSubType': 'S', 'taxType': 'Sales', 'taxable': 30.0}, {'country': 'US', 'exemption': 0.0, 'jurisCode': '5003794', 'jurisName': 'CHARLESTON CO TT', 'jurisType': 'Special', 'nonTaxable': 0.0, 'rate': 0.01, 'rateType': 'General', 'region': 'SC', 'stateAssignedNo': '2130', 'tax': 0.3, 'taxAuthorityType': 45, 'taxCalculated': 0.3, 'taxName': 'SC SPECIAL TAX', 'taxSubType': 'S', 'taxType': 'Sales', 'taxable': 30.0}], 'taxDate': '2024-12-10', 'taxOverrideAmount': 0.0, 'taxOverrideReason': '', 'taxOverrideType': 'None', 'totalAmount': 30.0, 'totalDiscount': 0.0, 'totalExempt': 0.0, 'totalTax': 2.7, 'totalTaxCalculated': 2.7, 'totalTaxable': 30.0, 'type': 'SalesInvoice', 'version': 15}