{"openapi":"3.1.0","info":{"title":"Tarifflo API","version":"1.0.0"},"servers":[{"url":"https://api.tarifflo.com/api/v2"}],"paths":{"/sort-sessions":{"post":{"operationId":"filing-createSortSession","summary":"Create an upload on a configuration","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configurationId":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9-_ ]+$"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/pipeline-configurations":{"get":{"operationId":"filing-listPipelineConfigurations","summary":"List the configurations a sort session can pick","description":"Requires the API key scope `filing`.","tags":["Configuration"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"configurations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"locked":{"type":"boolean"},"isTemporary":{"type":"boolean"},"general":{"type":"object","properties":{"requiredContent":{"type":"object","propertyNames":{"type":"string","enum":["filed_baseline","product_description","hts_code","line_value","quantity","country_of_origin","entry_date","transport_event","importer_identity"]},"additionalProperties":{"type":"boolean"},"required":["filed_baseline","product_description","hts_code","line_value","quantity","country_of_origin","entry_date","transport_event","importer_identity"]},"unidentifiedDocuments":{"type":"string","enum":["skip","ask"]},"filerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reuseByHash":{"type":"object","propertyNames":{"type":"string","enum":["beads_facts"]},"additionalProperties":{"type":"boolean"},"required":["beads_facts"]},"includeLiquidated":{"type":"boolean"},"filing":{"type":"object","properties":{"savingsThresholdUsd":{"type":"number","minimum":0},"dutyDecreasesOnly":{"type":"boolean"}},"required":["savingsThresholdUsd","dutyDecreasesOnly"],"additionalProperties":false}},"required":["requiredContent","unidentifiedDocuments","filerId","reuseByHash","includeLiquidated","filing"],"additionalProperties":false},"jobs":{"type":"object","propertyNames":{"type":"string","enum":["sort_documents","agent_sort","classify_products","web_search","eccn","coo","spi","pga","adcvd","duty","review","report","validate","approved_codes","stage_filing"]},"additionalProperties":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"],"additionalProperties":false},"required":["sort_documents","agent_sort","classify_products","web_search","eccn","coo","spi","pga","adcvd","duty","review","report","validate","approved_codes","stage_filing"]},"validationRules":{"type":"object","propertyNames":{"type":"string","enum":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]},"additionalProperties":{"type":"boolean"},"required":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]},"unsetValidationRules":{"readOnly":true,"type":"array","items":{"type":"string","enum":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]}},"billing":{"type":"object","properties":{"action":{"type":"string","enum":["entry_prepared","per_bead","none"]}},"required":["action"],"additionalProperties":false},"lane":{"type":"string","enum":["entry","classification"]}},"required":["id","name","description","isDefault","locked","isTemporary","general","jobs","validationRules","unsetValidationRules","billing","lane"],"additionalProperties":false}},"temporary":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"locked":{"type":"boolean"},"isTemporary":{"type":"boolean"},"general":{"type":"object","properties":{"requiredContent":{"type":"object","propertyNames":{"type":"string","enum":["filed_baseline","product_description","hts_code","line_value","quantity","country_of_origin","entry_date","transport_event","importer_identity"]},"additionalProperties":{"type":"boolean"},"required":["filed_baseline","product_description","hts_code","line_value","quantity","country_of_origin","entry_date","transport_event","importer_identity"]},"unidentifiedDocuments":{"type":"string","enum":["skip","ask"]},"filerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reuseByHash":{"type":"object","propertyNames":{"type":"string","enum":["beads_facts"]},"additionalProperties":{"type":"boolean"},"required":["beads_facts"]},"includeLiquidated":{"type":"boolean"},"filing":{"type":"object","properties":{"savingsThresholdUsd":{"type":"number","minimum":0},"dutyDecreasesOnly":{"type":"boolean"}},"required":["savingsThresholdUsd","dutyDecreasesOnly"],"additionalProperties":false}},"required":["requiredContent","unidentifiedDocuments","filerId","reuseByHash","includeLiquidated","filing"],"additionalProperties":false},"jobs":{"type":"object","propertyNames":{"type":"string","enum":["sort_documents","agent_sort","classify_products","web_search","eccn","coo","spi","pga","adcvd","duty","review","report","validate","approved_codes","stage_filing"]},"additionalProperties":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"],"additionalProperties":false},"required":["sort_documents","agent_sort","classify_products","web_search","eccn","coo","spi","pga","adcvd","duty","review","report","validate","approved_codes","stage_filing"]},"validationRules":{"type":"object","propertyNames":{"type":"string","enum":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]},"additionalProperties":{"type":"boolean"},"required":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]},"unsetValidationRules":{"readOnly":true,"type":"array","items":{"type":"string","enum":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]}},"billing":{"type":"object","properties":{"action":{"type":"string","enum":["entry_prepared","per_bead","none"]}},"required":["action"],"additionalProperties":false},"lane":{"type":"string","enum":["entry","classification"]}},"required":["id","name","description","isDefault","locked","isTemporary","general","jobs","validationRules","unsetValidationRules","billing","lane"],"additionalProperties":false},{"type":"null"}]},"selectedId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["configurations","temporary","selectedId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/pipeline-configurations":{"get":{"operationId":"filing-listOrganizationConfigurations","summary":"List the organization's pipeline configurations","description":"Requires the API key scope `filing`.","tags":["Configuration"],"security":[{"ApiKey":[]},{"Bearer":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"locked":{"type":"boolean"},"isTemporary":{"type":"boolean"},"general":{"type":"object","properties":{"requiredContent":{"type":"object","propertyNames":{"type":"string","enum":["filed_baseline","product_description","hts_code","line_value","quantity","country_of_origin","entry_date","transport_event","importer_identity"]},"additionalProperties":{"type":"boolean"},"required":["filed_baseline","product_description","hts_code","line_value","quantity","country_of_origin","entry_date","transport_event","importer_identity"]},"unidentifiedDocuments":{"type":"string","enum":["skip","ask"]},"filerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reuseByHash":{"type":"object","propertyNames":{"type":"string","enum":["beads_facts"]},"additionalProperties":{"type":"boolean"},"required":["beads_facts"]},"includeLiquidated":{"type":"boolean"},"filing":{"type":"object","properties":{"savingsThresholdUsd":{"type":"number","minimum":0},"dutyDecreasesOnly":{"type":"boolean"}},"required":["savingsThresholdUsd","dutyDecreasesOnly"],"additionalProperties":false}},"required":["requiredContent","unidentifiedDocuments","filerId","reuseByHash","includeLiquidated","filing"],"additionalProperties":false},"jobs":{"type":"object","propertyNames":{"type":"string","enum":["sort_documents","agent_sort","classify_products","web_search","eccn","coo","spi","pga","adcvd","duty","review","report","validate","approved_codes","stage_filing"]},"additionalProperties":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"],"additionalProperties":false},"required":["sort_documents","agent_sort","classify_products","web_search","eccn","coo","spi","pga","adcvd","duty","review","report","validate","approved_codes","stage_filing"]},"validationRules":{"type":"object","propertyNames":{"type":"string","enum":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]},"additionalProperties":{"type":"boolean"},"required":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]},"unsetValidationRules":{"readOnly":true,"type":"array","items":{"type":"string","enum":["civ_ior_named","civ_us_consignee_for_foreign_ior","civ_description_sufficient","civ_country_of_origin","civ_quantity","civ_set_components_reconcile","civ_unit_and_total_value","civ_total_reconciles","civ_currency","civ_incoterms_or_charges","civ_value_adjustments","civ_manufacturer_identified","civ_documents_belong","es_parties_match_civ","es_coo_matches_civ","es_country_of_export_matches_transport","es_export_date_after_lading","es_hts_matches_civ","es_part_number_correct","es_all_civ_hts_present","es_spi_supported","es_values_match_civ","es_quantities_match_civ","es_currency_and_exchange_rate","es_adjustments_match_incoterms","es_assists_declared","es_commissions_declared","es_first_sale_supported","es_mid_is_actual_manufacturer","es_relationship_recorded","es_article_set_reproduced","es_set_origin_dominance","es_set_component_quantities","es_ch99_consistent","es_232_claim_matches_description","es_232_claim_contradicted","es_fees_mpf_hmf","es_lines_complete","es_port_of_lading_matches_transport","es_gross_weight_matches_packing","es_ior_number_matches_profile","es_pga_evidence_present"]}},"billing":{"type":"object","properties":{"action":{"type":"string","enum":["entry_prepared","per_bead","none"]}},"required":["action"],"additionalProperties":false},"lane":{"type":"string","enum":["entry","classification"]}},"required":["id","name","description","isDefault","locked","isTemporary","general","jobs","validationRules","unsetValidationRules","billing","lane"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}":{"delete":{"operationId":"filing-deleteSortSession","summary":"Delete an upload and everything under it","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]},"get":{"operationId":"filing-uploadStatus","summary":"Where the upload stands","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"configurationId":{"type":"string"},"lane":{"type":"string","enum":["entry","classification"]},"runs":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string","enum":["upload","entry"]},"refId":{"type":"string"},"runId":{"type":"string"},"status":{"type":"string","enum":["running","blocked","complete","failed","cancelled"]},"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"status":{"type":"string","enum":["pending","running","finalizing","complete_with_open","awaiting_gate","held","complete","failed","blocked","skipped"]},"total":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"},"parked":{"type":"number"},"awaitingInput":{"type":"number"},"creditsNeeded":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["key","status","total","completed","failed","parked","awaitingInput","creditsNeeded"],"additionalProperties":false}}},"required":["scope","refId","runId","status","stages"],"additionalProperties":false}},"counts":{"anyOf":[{"type":"object","properties":{"products":{"type":"number"},"classified":{"type":"number"},"withOrigin":{"type":"number"},"priced":{"type":"number"},"compared":{"type":"number"},"unpriceable":{"type":"number"},"pendingApproval":{"type":"number"}},"required":["products","classified","withOrigin","priced","compared","unpriceable","pendingApproval"],"additionalProperties":false},{"type":"null"}]},"report":{"anyOf":[{"oneOf":[{"type":"object","properties":{"state":{"type":"string","const":"ready"},"runId":{"type":"string"},"reportId":{"type":"string"},"fileName":{"type":"string"},"url":{"type":"string"},"expiresInMinutes":{"type":"number"}},"required":["state","runId","reportId","fileName","url","expiresInMinutes"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"building"},"runId":{"type":"string"}},"required":["state","runId"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"unavailable"},"reason":{"type":"string"}},"required":["state","reason"],"additionalProperties":false}],"type":"object"},{"type":"null"}]}},"required":["id","name","configurationId","lane","runs","counts","report"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/files":{"post":{"operationId":"filing-getBeadsPacketUploadUrls","summary":"Add files to an upload: one signed PUT URL per file","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entrySessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"files":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1},"mimeType":{"type":"string","minLength":1},"size":{"type":"integer","minimum":0,"maximum":104857600},"path":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":255}},"contentHash":{"type":"string"},"declaredDoctype":{"type":"string","const":"product_sheet"}},"required":["filename","mimeType","size"]}}},"required":["files"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"packetId":{"type":"string"},"signedUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"filename":{"type":"string"},"path":{"type":"array","items":{"type":"string"}},"reused":{"type":"boolean"},"entryAttachment":{"anyOf":[{"type":"string","enum":["attached","already_on_entry","in_sort_run"]},{"type":"null"}]}},"required":["packetId","signedUrl","filename","path","reused","entryAttachment"],"additionalProperties":false}},"minted":{"type":"number"},"reused":{"type":"number"},"attributed":{"type":"number"}},"required":["results","minted","reused","attributed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/files/confirm":{"post":{"operationId":"filing-confirmBeadsPacketUploads","summary":"Confirm the files whose PUT landed","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"packetIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string"}}},"required":["packetIds"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"confirmed":{"type":"number"}},"required":["confirmed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/start":{"post":{"operationId":"filing-queueSortSessionIngest","summary":"Start, or re-drive, the upload's run","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"queuedCount":{"type":"number"},"runId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["queuedCount","runId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/products/{productId}/classification":{"get":{"operationId":"filing-classificationProduct","summary":"A product's rate facts and its printed-code comparison","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"productId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"facts":{"type":"object","properties":{"entryDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipmentValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"shares":{"type":"object","properties":{"steel":{"type":"number"},"aluminum":{"type":"number"},"copper":{"type":"number"},"usContent":{"type":"number"}},"additionalProperties":false}},"required":["entryDate","shipmentValue","shares"],"additionalProperties":false},"comparison":{"anyOf":[{"type":"object","properties":{"product_id":{"type":"string"},"destination":{"type":"string"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}]},"original_code":{"type":"string"},"proposed_code":{"type":"string"},"original_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"proposed_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"delta_pts":{"anyOf":[{"type":"number"},{"type":"null"}]},"customs_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"savings":{"anyOf":[{"type":"number"},{"type":"null"}]},"risk_score":{"type":"number"},"risk":{"type":"string"},"risk_reasons":{"type":"array","items":{"type":"string"}}},"required":["product_id","destination","origin","original_code","proposed_code","original_rate","proposed_rate","delta_pts","customs_value","savings","risk_score","risk","risk_reasons"],"additionalProperties":false},{"type":"null"}]},"components":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"destination":{"type":"string"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}]},"original_code":{"type":"string"},"proposed_code":{"type":"string"},"original_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"proposed_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"delta_pts":{"anyOf":[{"type":"number"},{"type":"null"}]},"customs_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"savings":{"anyOf":[{"type":"number"},{"type":"null"}]},"risk_score":{"type":"number"},"risk":{"type":"string"},"risk_reasons":{"type":"array","items":{"type":"string"}}},"required":["product_id","destination","origin","original_code","proposed_code","original_rate","proposed_rate","delta_pts","customs_value","savings","risk_score","risk","risk_reasons"],"additionalProperties":false}}},"required":["facts","comparison","components"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/products":{"post":{"operationId":"filing-uploadProductsPage","summary":"A page of the upload's products, filtered and sorted","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startRow":{"type":"integer","minimum":0,"maximum":9007199254740991},"endRow":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["PENDING","PROCESSING","AWAITING_INPUT","PENDING_APPROVAL","APPROVED","REJECTED","COMPLETED","UPLOADED","FAILED"]},"search":{"type":"string","minLength":1,"maxLength":100},"sort":{"type":"object","properties":{"column":{"type":"string","enum":["name","description","origin","hts","status","updatedAt"]},"direction":{"type":"string","enum":["asc","desc"]}},"required":["column","direction"]}},"required":["startRow","endRow"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["PENDING","PROCESSING","AWAITING_INPUT","PENDING_APPROVAL","APPROVED","REJECTED","COMPLETED","UPLOADED","FAILED"]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"origin":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalRate":{"anyOf":[{"type":"string"},{"type":"null"}]},"rate":{"anyOf":[{"type":"string"},{"type":"null"}]},"eccn":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["id","name","description","status","code","origin","originalCode","originalRate","rate","eccn","updatedAt"],"additionalProperties":false}},"total":{"type":"number"}},"required":["rows","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/rate-report":{"post":{"operationId":"filing-uploadRateReport","summary":"Build or fetch the upload's rate report at each product's origin on file","description":"Requires the API key scope `tariff_rates`.","tags":["Rate report"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"restart":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"state":{"type":"string","const":"ready"},"runId":{"type":"string"},"reportId":{"type":"string"},"fileName":{"type":"string"},"url":{"type":"string"},"expiresInMinutes":{"type":"number"}},"required":["state","runId","reportId","fileName","url","expiresInMinutes"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"building"},"runId":{"type":"string"}},"required":["state","runId"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"unavailable"},"reason":{"type":"string"}},"required":["state","reason"],"additionalProperties":false}],"type":"object"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["tariff_rates"]}},"/sort-sessions/{sortSessionId}/questions":{"get":{"operationId":"filing-downloadSortSessionQuestions","summary":"The open questions as a sheet to fill in","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true},{"in":"query","name":"timeZone","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"fileName":{"type":"string"},"questions":{"type":"number"}},"required":["url","fileName","questions"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/sort-sessions/{sortSessionId}/answers":{"post":{"operationId":"filing-applySortSessionAnswers","summary":"The questions sheet, filled in","description":"Requires the API key scope `filing`.","tags":["Uploads"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"sortSessionId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileBase64":{"type":"string","minLength":1,"maxLength":30000000}},"required":["fileBase64"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"answeredRows":{"type":"number"},"unmatchedRows":{"type":"number"},"answered":{"type":"number"},"resumedJobs":{"type":"number"}},"required":["answeredRows","unmatchedRows","answered","resumedJobs"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries":{"post":{"operationId":"apiEntries-fileEntry","summary":"File an entry summary","description":"Validates, writes and submits a whole entry summary. CBP's answer arrives as an `entry.disposition` webhook. A repeat of an Idempotency-Key answers the first result with `Idempotent-Replayed: true`.\n\nRequires the API key scope `entries:write`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"description":"The entry summary to file; its shape is documented at https://tarifflo.com/docs/v2.","$ref":"#/components/schemas/__schema0"},"webhookUrl":{"description":"Where the `entry.disposition` webhook goes; defaults to the key environment's URL.","type":"string"}},"required":["entry"],"additionalProperties":false}}}},"responses":{"201":{"description":"Filed and submitted to CBP","headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"efid":{"type":"string"},"entryNumber":{"type":"number"},"shortJobId":{"type":"string"},"status":{"type":"string","const":"AWAITING_CBP"}},"required":["efid","shortJobId","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"409":{"description":"The first request with this Idempotency-Key is still filing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.CONFLICT"}}}},"412":{"description":"No webhook URL for the key's environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.PRECONDITION_FAILED"}}}},"422":{"description":"The entry is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNPROCESSABLE_CONTENT"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}},"502":{"description":"Submitting to CBP failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_GATEWAY"}}}}},"x-tarifflo-scopes":["entries:write"]}},"/audit/uploads":{"post":{"operationId":"apiAudit-createUpload","summary":"Get an audit upload URL","description":"A presigned PUT URL for one document. PUT the bytes, then start a run with the returned `fileId`.\n\nRequires the API key scope `audit`.","tags":["Audit"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":500,"description":"PDF, Excel, Word, CSV or an image; the type is checked again from the bytes."},"mimeType":{"type":"string","minLength":1,"maxLength":200}},"required":["filename","mimeType"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"fileId":{"type":"string","description":"Pass it in `fileIds` when starting the run."},"uploadUrl":{"type":"string","description":"PUT the file's bytes here, with the declared `mimeType` as Content-Type."},"expiresInSeconds":{"type":"number"}},"required":["fileId","uploadUrl","expiresInSeconds"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["audit"]}},"/audit/uploads/bulk":{"post":{"operationId":"apiAudit-createUploads","summary":"Get many audit upload URLs","description":"Presigned PUT URLs for up to 50 documents; one unsupported file type refuses the whole call.\n\nRequires the API key scope `audit`.","tags":["Audit"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":500,"description":"PDF, Excel, Word, CSV or an image; the type is checked again from the bytes."},"mimeType":{"type":"string","minLength":1,"maxLength":200}},"required":["filename","mimeType"]}}},"required":["files"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"uploads":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":"string","description":"Pass it in `fileIds` when starting the run."},"uploadUrl":{"type":"string","description":"PUT the file's bytes here, with the declared `mimeType` as Content-Type."},"expiresInSeconds":{"type":"number"}},"required":["fileId","uploadUrl","expiresInSeconds"],"additionalProperties":false}}},"required":["uploads"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["audit"]}},"/audit/runs":{"post":{"operationId":"apiAudit-startRun","summary":"Start a pre-audit run","description":"Files the uploaded documents under a fresh audit request and runs the pre-audit (ingest, classification, rate and savings). Answers 202 with the run id; the result is delivered as a `pre_audit.completed` webhook to the key environment's URL (or `Tarifflo-Webhook-Url`) and pollable at GET /audit/runs/{jobId}. `config: \"post\"` (PSC) is not available yet.\n\nRequires the API key scope `audit`.","tags":["Audit"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeats of the same request with the same key answer the first result (72 hours) with `Idempotent-Replayed: true`.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"string","enum":["pre","post"]},"fileIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}},"clientName":{"description":"The audit client to file under (default \"API Intake\").","type":"string","minLength":1,"maxLength":200},"requestName":{"type":"string","minLength":1,"maxLength":200},"destinationCountries":{"description":"Markets to rate for (default US).","type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"dryRun":{"description":"Price the request at the organization's card and reserve nothing; answers 200 with the estimate.","type":"boolean"}},"required":["config","fileIds"]}}}},"responses":{"202":{"description":"Queued (or, for `dryRun`, priced with 200)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string","description":"The run id: poll GET /audit/runs/{jobId}."},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"queued"},"config":{"type":"string","const":"pre"},"filesQueued":{"type":"number"},"message":{"type":"string"}},"required":["jobId","status","config","filesQueued","message"],"additionalProperties":false},{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"estimatedCredits":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},"units":{"type":"number"},"credits":{"type":"number"}},"required":["action","units","credits"],"additionalProperties":false}},"balance":{"type":"number"},"unit":{"type":"string","enum":["token","credit"]},"note":{"type":"string"}},"required":["dryRun","estimatedCredits","lines","balance","unit"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"402":{"description":"Not enough credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.PAYMENT_REQUIRED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"409":{"description":"The first request with this Idempotency-Key is still filing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.CONFLICT"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}},"501":{"description":"`config: \"post\"` is not available yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_IMPLEMENTED"}}}}},"x-tarifflo-scopes":["audit"]}},"/audit/runs/{jobId}":{"get":{"operationId":"apiAudit-getRun","summary":"Get a pre-audit run","description":"The run's status; once complete, `data` is the `pre_audit.completed` webhook's `data`.\n\nRequires the API key scope `audit`.","tags":["Audit"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"jobId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"failed"},"error":{"type":"object","properties":{"code":{"type":"string","const":"RUN_FAILED"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["jobId","credits","status","error"],"additionalProperties":false},{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","enum":["queued","processing","blocked"]},"stagesComplete":{"type":"number"},"stagesTotal":{"type":"number"},"creditsNeeded":{"description":"Credits the run waits for (`blocked` only).","type":"number"},"purchaseUrl":{"description":"Where to add credits (`blocked` only).","type":"string"}},"required":["jobId","credits","status","stagesComplete","stagesTotal"],"additionalProperties":false},{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"complete"},"event":{"type":"string","description":"The webhook event that delivered the same `data`."},"data":{"description":"The run's result, exactly the webhook's `data`.","$ref":"#/components/schemas/__schema2"}},"required":["jobId","credits","status","event","data"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["audit"]}},"/pricing":{"get":{"operationId":"apiBilling-pricing","summary":"Get the price list","description":"Credits per unit for every billable action at list price. Public: needs no key.","tags":["Billing"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"creditCents":{"type":"number","description":"What one credit costs, in US cents."},"actions":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},"unit":{"type":"string"},"credits":{"type":"number"},"listCredits":{"type":"number"},"usd":{"type":"number"}},"required":["action","unit","credits","listCredits","usd"],"additionalProperties":false}}},"required":["creditCents","actions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/credits":{"get":{"operationId":"apiBilling-credits","summary":"Get the credit balance","description":"The organization's balance, the current cycle's allowance and what each action consumed this cycle.\n\nAny valid API key.","tags":["Billing"],"security":[{"ApiKey":[]},{"Bearer":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"unit":{"type":"string","enum":["token","credit"],"description":"Always \"credit\": every amount here is presented in credits, whatever the ledger counts in."},"balance":{"type":"number"},"reserved":{"type":"number","description":"Held by running work."},"used":{"type":"number"},"floor":{"type":"number"},"currentCycle":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"anyOf":[{"type":"string"},{"type":"null"}]},"allowance":{"type":"number"},"consumed":{"type":"number"}},"required":["start","end","allowance","consumed"],"additionalProperties":false},{"type":"null"}]},"perAction":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"units":{"type":"number"},"credits":{"type":"number"}},"required":["action","units","credits"],"additionalProperties":false}}},"required":["unit","balance","reserved","used","floor","currentCycle","perAction"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":[]}},"/usage":{"get":{"operationId":"apiBilling-usage","summary":"Get settled usage","description":"Settled usage between `from` and `to` (ISO dates; default the last 30 days, at most a year), grouped by action, key, user or run.\n\nAny valid API key.","tags":["Billing"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"query","name":"groupBy","schema":{"type":"string","enum":["action","key","user","run"]}},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"groupBy":{"type":"string","enum":["action","key","user","run"]},"unit":{"type":"string","enum":["token","credit"],"description":"Always \"credit\": every amount here is presented in credits, whatever the ledger counts in."},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}]},"units":{"type":"number"},"credits":{"type":"number"},"listCredits":{"type":"number"}},"required":["key","units","credits","listCredits"],"additionalProperties":false}}},"required":["from","to","groupBy","unit","rows"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":[]}},"/classifications/batch":{"post":{"operationId":"apiClassificationBatch-start","summary":"Classify many products","description":"Bulk HTS classification of `items` (inline) or `inputKey` (an uploaded JSONL file). Answers 202 with the batch id; the results are delivered to the key environment's webhook URL (or `Tarifflo-Webhook-Url`) and pollable at GET /classifications/batch/{batchId}.\n\nRequires the API key scope `classifications`.","tags":["Classification"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeats of the same request with the same key answer the first result (72 hours) with `Idempotent-Replayed: true`.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Up to 10000 rows inline; `id` is echoed back on each result.","maxItems":10000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string","minLength":1}},"required":["text"]}},"inputKey":{"description":"A JSONL file of {id?,text} rows, from POST /classifications/batch/upload-url.","type":"string"},"dryRun":{"description":"Price the request at the organization's card and reserve nothing; answers 200 with the estimate.","type":"boolean"}}}}}},"responses":{"202":{"description":"Queued (or, for `dryRun`, priced with 200)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string","description":"The batch id: poll GET /classifications/batch/{batchId}."},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"queued"},"itemsQueued":{"type":"number"},"message":{"type":"string"}},"required":["jobId","credits","status","itemsQueued","message"],"additionalProperties":false},{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"estimatedCredits":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},"units":{"type":"number"},"credits":{"type":"number"}},"required":["action","units","credits"],"additionalProperties":false}},"balance":{"type":"number"},"unit":{"type":"string","enum":["token","credit"]},"note":{"type":"string"}},"required":["dryRun","estimatedCredits","lines","balance","unit"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"402":{"description":"Not enough credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.PAYMENT_REQUIRED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"409":{"description":"The first request with this Idempotency-Key is still filing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.CONFLICT"}}}},"413":{"description":"The file or the row count is over the limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.PAYLOAD_TOO_LARGE"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["classifications"]}},"/classifications/batch/upload-url":{"post":{"operationId":"apiClassificationBatch-uploadUrl","summary":"Get a batch upload URL","description":"A presigned PUT URL (valid 900 seconds) for a JSONL file of {id?,text} rows. PUT the file, then start the batch with the returned `inputKey`.\n\nRequires the API key scope `classifications`.","tags":["Classification"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":256}},"required":["filename"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"uploadUrl":{"type":"string"},"inputKey":{"type":"string"},"expiresInSeconds":{"type":"number"}},"required":["uploadUrl","inputKey","expiresInSeconds"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["classifications"]}},"/classifications/batch/{batchId}":{"get":{"operationId":"apiClassificationBatch-get","summary":"Get a classification batch","description":"The batch's status and one page (1000 rows, `page` from 0) of its results once it completes.\n\nRequires the API key scope `classifications`.","tags":["Classification"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"batchId","schema":{"type":"string"},"required":true},{"in":"query","name":"page","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string"},"state":{"type":"string","description":"SUBMITTED, RUNNING, COMPLETED or FAILED; results appear once COMPLETED."},"expectedCount":{"type":"number"},"shardsSettled":{"type":"number"},"expectedShards":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hts10":{"anyOf":[{"type":"string"},{"type":"null"}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"chosenModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"top5":{"description":"The top alternatives the classifier weighed.","$ref":"#/components/schemas/__schema2"}},"required":["id","hts10","confidence","chosenModel","top5"],"additionalProperties":false}}},"required":["batchId","credits","status","state","expectedCount","shardsSettled","expectedShards","page","pageSize","results"],"additionalProperties":false}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["classifications"]}},"/export-control":{"post":{"operationId":"apiExportControl-start","summary":"Determine export-control codes","description":"ECCN (or a foreign jurisdiction's control code) for up to 50 products. Answers 202 with the run id; the result is delivered as an `export_control.completed` webhook to the key environment's URL (or `Tarifflo-Webhook-Url`) and pollable at GET /export-control/{jobId}.\n\nRequires the API key scope `eccn`.","tags":["Export control"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeats of the same request with the same key answer the first result (72 hours) with `Idempotent-Replayed: true`.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"products":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"description":"Your correlation id, echoed back on the result line.","type":"string","maxLength":200},"name":{"type":"string","maxLength":500},"description":{"type":"string","minLength":3,"maxLength":5000},"origin":{"type":"string","pattern":"^[A-Z]{2}$","description":"Country of origin, ISO-3166 alpha-2."},"context":{"description":"Anything else the determination should weigh.","type":"string","maxLength":5000}},"required":["description","origin"],"additionalProperties":false}},"dryRun":{"description":"Price the request at the organization's card and reserve nothing; answers 200 with the estimate.","type":"boolean"}},"required":["products"],"additionalProperties":false}}}},"responses":{"202":{"description":"Queued (or, for `dryRun`, priced with 200)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string","description":"The run id: poll GET /export-control/{jobId}."},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"queued"},"productsQueued":{"type":"number"},"message":{"type":"string"}},"required":["jobId","credits","status","productsQueued","message"],"additionalProperties":false},{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"estimatedCredits":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},"units":{"type":"number"},"credits":{"type":"number"}},"required":["action","units","credits"],"additionalProperties":false}},"balance":{"type":"number"},"unit":{"type":"string","enum":["token","credit"]},"note":{"type":"string"}},"required":["dryRun","estimatedCredits","lines","balance","unit"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"402":{"description":"Not enough credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.PAYMENT_REQUIRED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"409":{"description":"The first request with this Idempotency-Key is still filing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.CONFLICT"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["eccn"]}},"/export-control/{jobId}":{"get":{"operationId":"apiExportControl-get","summary":"Get an export-control run","description":"The run's status; once complete, `data` is the `export_control.completed` webhook's `data`.\n\nRequires the API key scope `eccn`.","tags":["Export control"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"jobId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"failed"},"error":{"type":"object","properties":{"code":{"type":"string","const":"RUN_FAILED"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["jobId","credits","status","error"],"additionalProperties":false},{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","enum":["queued","processing","blocked"]},"stagesComplete":{"type":"number"},"stagesTotal":{"type":"number"},"creditsNeeded":{"description":"Credits the run waits for (`blocked` only).","type":"number"},"purchaseUrl":{"description":"Where to add credits (`blocked` only).","type":"string"}},"required":["jobId","credits","status","stagesComplete","stagesTotal"],"additionalProperties":false},{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"complete"},"event":{"type":"string","description":"The webhook event that delivered the same `data`."},"data":{"description":"The run's result, exactly the webhook's `data`.","$ref":"#/components/schemas/__schema2"}},"required":["jobId","credits","status","event","data"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["eccn"]}},"/origin":{"post":{"operationId":"apiOrigin-start","summary":"Determine country of origin","description":"Rules-of-origin determinations (non-preferential, marking, FTA-preferential) for up to 5 goods from their bill of materials. Answers 202 with the run id; a run takes minutes. The result is delivered as an `origin.completed` webhook to the key environment's URL (or `Tarifflo-Webhook-Url`) and pollable at GET /origin/{jobId}.\n\nRequires the API key scope `origin`.","tags":["Origin"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeats of the same request with the same key answer the first result (72 hours) with `Idempotent-Replayed: true`.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"id":{"description":"Your correlation id, echoed back on the result line.","type":"string","maxLength":200},"import_into":{"description":"The importing country (default US).","type":"string","pattern":"^[A-Za-z]{2}$"},"finished_good":{"type":"object","properties":{"description":{"type":"string","minLength":3,"maxLength":5000},"hts":{"type":"string","maxLength":20},"value_usd":{"type":"number"},"ex_works_price_usd":{"type":"number"}},"required":["description"],"additionalProperties":{}},"country_of_finished_production":{"type":"string","pattern":"^[A-Za-z]{2}$"},"claimed_country_of_origin":{"type":"string","pattern":"^[A-Za-z]{2}$"},"processing":{"description":"What is done in the country of finished production.","type":"string","maxLength":10000},"bom":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"type":"string","maxLength":500},"hts":{"type":"string","maxLength":20},"origin":{"type":"string","pattern":"^[A-Za-z]{2}$"},"value_usd":{"type":"number"}},"required":["item","origin"],"additionalProperties":{}}},"automotive":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema1"}},"fungible_inventory":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema1"}},"quality":{"description":"\"ship\" (default, the full ensemble) or \"screen\" (one draft, about half the cost).","type":"string","enum":["ship","screen"]}},"required":["finished_good","country_of_finished_production","bom"],"additionalProperties":{}}},"dryRun":{"description":"Price the request at the organization's card and reserve nothing; answers 200 with the estimate.","type":"boolean"}},"required":["jobs"]}}}},"responses":{"202":{"description":"Queued (or, for `dryRun`, priced with 200)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string","description":"The run id: poll GET /origin/{jobId}."},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"queued"},"jobsQueued":{"type":"number"},"message":{"type":"string"}},"required":["jobId","credits","status","jobsQueued","message"],"additionalProperties":false},{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"estimatedCredits":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},"units":{"type":"number"},"credits":{"type":"number"}},"required":["action","units","credits"],"additionalProperties":false}},"balance":{"type":"number"},"unit":{"type":"string","enum":["token","credit"]},"note":{"type":"string"}},"required":["dryRun","estimatedCredits","lines","balance","unit"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"402":{"description":"Not enough credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.PAYMENT_REQUIRED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"409":{"description":"The first request with this Idempotency-Key is still filing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.CONFLICT"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["origin"]}},"/origin/{jobId}":{"get":{"operationId":"apiOrigin-get","summary":"Get an origin run","description":"The run's status; once complete, `data` is the `origin.completed` webhook's `data`.\n\nRequires the API key scope `origin`.","tags":["Origin"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"jobId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"failed"},"error":{"type":"object","properties":{"code":{"type":"string","const":"RUN_FAILED"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["jobId","credits","status","error"],"additionalProperties":false},{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","enum":["queued","processing","blocked"]},"stagesComplete":{"type":"number"},"stagesTotal":{"type":"number"},"creditsNeeded":{"description":"Credits the run waits for (`blocked` only).","type":"number"},"purchaseUrl":{"description":"Where to add credits (`blocked` only).","type":"string"}},"required":["jobId","credits","status","stagesComplete","stagesTotal"],"additionalProperties":false},{"type":"object","properties":{"jobId":{"type":"string"},"credits":{"type":"object","properties":{"action":{"anyOf":[{"type":"string","enum":["rate_lookup","adcvd_screen","pga_applicability","code_classified","export_control","origin_determination","entry_filed","entry_prepared","document_ocr","document_extract","document_sort","product_enrich","entry_review","rationale_document","audit_parse","data_export"]},{"type":"null"}]},"reserved":{"type":"number"},"used":{"type":"number"},"refunded":{"type":"number"}},"required":["action","reserved","used","refunded"],"additionalProperties":false,"description":"What the job has reserved, used and refunded so far, in credits."},"status":{"type":"string","const":"complete"},"event":{"type":"string","description":"The webhook event that delivered the same `data`."},"data":{"description":"The run's result, exactly the webhook's `data`.","$ref":"#/components/schemas/__schema2"}},"required":["jobId","credits","status","event","data"],"additionalProperties":false}]}}},"headers":{"X-Credits-Balance":{"description":"The organization's balance after this request, in credits.","schema":{"type":"string"}},"X-Credits-Charged":{"description":"What this request reserved or consumed, in credits.","schema":{"type":"string"}},"X-Credits-Unit":{"description":"What the ledger counts in (`credit` or `token`).","schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["origin"]}},"/cbp-queries/adcvd-rates":{"post":{"operationId":"adcvd-getRates","summary":"Query CBP AD/CVD cases","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mid":{"type":"string"},"htsCode":{"type":"string"},"caseNumber":{"type":"string"},"countryCode":{"type":"string"},"companyCaseStatus":{"type":"string"},"customDate":{"type":"string"},"certificationScenario":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/manufacturer":{"post":{"operationId":"queries-manufacturerQuery","summary":"Query CBP for a manufacturer (MID)","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"manufacturerId":{"type":"string"},"documentId":{"type":"string"},"dedupeKey":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/census-warnings":{"post":{"operationId":"queries-getCensusWarnings","summary":"Query CBP census warnings for entries","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blockHeaderParams":{"type":"object","properties":{"processingPortCode":{"type":"string"},"processingFilerCode":{"type":"string"},"appIdCode":{"type":"string","enum":["AE","EQ","SE","CQ","RE","DE","NE","HA","HB","AD","AH","CW","CJ","CB","EC","FT","FZ","GE","KI","TP","SF","WP","QP","$I","MA","CA","AA","MO","QA","PE","SU","TE","RM","FQ","FI"]}},"required":["appIdCode"]},"requestedFromDate":{"type":"string"},"requestedToDate":{"type":"string"},"entryNumbers":{"type":"array","items":{"type":"string","minLength":1}}},"required":["blockHeaderParams","entryNumbers"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/currency-conversion":{"post":{"operationId":"queries-getCurrencyConversion","summary":"Query CBP currency conversion","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blockHeaderParams":{"type":"object","properties":{"appIdCode":{"type":"string","enum":["AE","EQ","SE","CQ","RE","DE","NE","HA","HB","AD","AH","CW","CJ","CB","EC","FT","FZ","GE","KI","TP","SF","WP","QP","$I","MA","CA","AA","MO","QA","PE","SU","TE","RM","FQ","FI"]}},"required":["appIdCode"]},"countryCode":{"type":"string","minLength":2,"maxLength":2},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"exchangeRateDate":{"type":"string"},"foreignAmount":{"type":"number","exclusiveMinimum":0}},"required":["blockHeaderParams","countryCode","currencyCode","exchangeRateDate","foreignAmount"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/quota-rates":{"post":{"operationId":"queries-getQuotaRates","summary":"Query CBP quota status","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queries":{"minItems":1,"maxItems":99,"type":"array","items":{"type":"object","properties":{"queryId":{"type":"string","minLength":1},"secondTariffNumber":{"type":"string"},"countryCode":{"type":"string","minLength":1}},"required":["queryId","countryCode"]}},"certificationScenario":{"type":"string"}},"required":["queries"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/entry-summary":{"post":{"operationId":"queries-getEntrySummaryQuery","summary":"Query CBP entry summaries","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queryType":{"type":"string","enum":["J1","J2"]},"includeDetail":{"type":"boolean"},"entries":{"type":"array","items":{"type":"object","properties":{"filerCode":{"type":"string","minLength":3,"maxLength":3},"entryNumber":{"type":"string","minLength":1,"maxLength":8}},"required":["filerCode","entryNumber"]}},"criteriaQueryTypeCode":{"type":"string","enum":["AII","DOC","RCN","PSC","LIQ","NLQ","EES"]},"requestedFromDateTime":{"type":"string","pattern":"^\\d{2}\\d{2}\\d{2}\\d{2}\\d{2}\\d{2}(AM|PM)$"},"requestedToDateTime":{"type":"string","pattern":"^\\d{2}\\d{2}\\d{2}\\d{2}\\d{2}\\d{2}(AM|PM)$"},"entrySummariesFlag":{"type":"string","const":"Y"},"ftaReconSummariesFlag":{"type":"string","const":"Y"},"otherReconSummariesFlag":{"type":"string","const":"Y"},"drawbackSummariesFlag":{"type":"string","const":"Y"},"dutyDeferralSummariesFlag":{"type":"string","const":"Y"},"collectionBillInfoCode":{"type":"string","enum":["1","2","3","4","5","6"]},"certificationScenario":{"type":"string"}},"required":["queryType"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/importer-profiles":{"get":{"operationId":"importerProfile-getImporterProfiles","summary":"List the organization's importer profiles","description":"Requires the API key scope `filing`.","tags":["Parties"],"security":[{"ApiKey":[]},{"Bearer":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"importerName":{"type":"string"},"importerOfRecord":{"type":"string"},"status":{"type":"string","enum":["DRAFT","AWAITING CBP","APPROVED","DENIED","CBP INACTIVE","CBP VOIDED"]}},"required":["id","status"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/importer-bond":{"post":{"operationId":"importerProfile-bondQuery","summary":"Query CBP importer and bond records","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"importerOfRecord":{"type":"string","minLength":1},"importerProfileId":{"type":"string"}},"required":["importerOfRecord"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/filers/{id}":{"get":{"operationId":"filer-getFiler","summary":"Get one of the organization's filers","description":"Requires the API key scope `filing`.","tags":["Parties"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"filerCode":{"type":"string"},"portCode":{"type":"string"},"startingEntryNumber":{"type":"number"},"checkDigitOffset":{"type":"number"},"nationalPermit":{"type":"boolean"},"isBroker":{"type":"boolean"},"brokerLicenseNumber":{"type":"string"},"qualifyingBrokerName":{"type":"string"},"disPocName":{"type":"string"},"disPocEmail":{"type":"string"},"disPocPhone":{"type":"string"},"id":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/filers":{"get":{"operationId":"filer-getFilers","summary":"List the organization's filers","description":"Requires the API key scope `filing`.","tags":["Parties"],"security":[{"ApiKey":[]},{"Bearer":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"filerCode":{"type":"string"},"portCode":{"type":"string"},"isBroker":{"type":"boolean"},"status":{"type":"string","enum":["INCOMPLETE","COMPLETED"]}},"required":["id","status"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/cbp-queries/mid":{"post":{"operationId":"tradeParty-generateMID","summary":"Ask CBP to generate a manufacturer ID","description":"Requires the API key scope `filing`.","tags":["CBP queries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"legalName":{"type":"string"},"address":{"type":"string"},"cityName":{"type":"string"},"countryCode":{"type":"string"},"postalCode":{"type":"string"},"documentId":{"type":"string"}},"required":["legalName","address","cityName","countryCode","postalCode"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shortJobId":{"type":"string"}},"required":["shortJobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/trade-parties/manufacturers":{"get":{"operationId":"tradeParty-getManufacturers","summary":"List the organization's manufacturers","description":"Requires the API key scope `filing`.","tags":["Parties"],"security":[{"ApiKey":[]},{"Bearer":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"countryCode":{"type":"string"}},"required":["id","countryCode"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/trade-parties/search":{"post":{"operationId":"tradeParty-getPage","summary":"Page through the organization's trade parties","description":"Requires the API key scope `filing`.","tags":["Parties"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startRow":{"type":"number"},"endRow":{"type":"number"},"searchText":{"type":"string"}},"required":["startRow","endRow"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"rowData":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"},"error":{"type":"string"},"individualContacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"}},"additionalProperties":false}}},"required":["id","legalName","phone","address"],"additionalProperties":false}},"rowCount":{"type":"number"}},"required":["rowData","rowCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}":{"delete":{"operationId":"shipping-deleteEntry","summary":"Delete an entry","description":"Requires the API key scope `entries:write`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string","enum":["Successfully deleted","Request to delete sent to CBP"]}},"required":["id","message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["entries:write"]}},"/entries/{efid}/responses":{"get":{"operationId":"shipping-getEntryFormResponse","summary":"Get CBP's entry summary response for an entry","description":"Requires the API key scope `filing`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"disposition":{"anyOf":[{"type":"object","properties":{"groupReference":{"type":"object","properties":{"dataType":{"type":"string"},"content":{"type":"string"},"position":{"type":"number"}},"required":["dataType"],"additionalProperties":false},"response":{"type":"object","properties":{"dispositionType":{"type":"string"},"severityCode":{"type":"string"},"conditionCode":{"type":"string"},"description":{"type":"string"},"filerCode":{"type":"string"},"entryNumber":{"type":"number"},"entryVersion":{"type":"number"},"referenceNumber":{"type":"string"}},"required":["conditionCode","description"],"additionalProperties":false}},"required":["groupReference","response"],"additionalProperties":false},{"type":"null"}]},"conditions":{"type":"array","items":{"type":"object","properties":{"referencePath":{"type":"array","items":{"type":"object","properties":{"dataType":{"type":"string"},"content":{"type":"string"},"position":{"type":"number"}},"required":["dataType"],"additionalProperties":false}},"responses":{"type":"array","items":{"type":"object","properties":{"dispositionType":{"type":"string"},"severityCode":{"type":"string"},"conditionCode":{"type":"string"},"description":{"type":"string"},"filerCode":{"type":"string"},"entryNumber":{"type":"number"},"entryVersion":{"type":"number"},"referenceNumber":{"type":"string"}},"required":["conditionCode","description"],"additionalProperties":false}}},"required":["referencePath","responses"],"additionalProperties":false}},"hasInternalError":{"type":"boolean"}},"required":["disposition","conditions","hasInternalError"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}/cargo-release":{"get":{"operationId":"shipping-getEntryCargoReleaseResponse","summary":"Get CBP's cargo release response for an entry","description":"Requires the API key scope `filing`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"disposition":{"type":"object","properties":{"messageTypeCode":{"type":"string"},"status":{"type":"string","enum":["DRAFT","AWAITING CBP","APPROVED","DENIED","WARNING","INFO","INTERNAL ERROR"]},"description":{"type":"string"}},"required":["messageTypeCode","status","description"],"additionalProperties":false},"conditionGroups":{"type":"array","items":{"type":"object","properties":{"referencePath":{"type":"array","items":{"type":"object","properties":{"dataType":{"type":"string"},"content":{"type":"string"},"position":{"type":"number"}},"required":["dataType"],"additionalProperties":false}},"responses":{"type":"array","items":{"type":"object","properties":{"messageTypeCode":{"type":"string"},"messageIdentifierCode":{"type":"string"},"narrativeMessage":{"type":"string"},"actionDate":{"type":"string"},"actionTime":{"type":"string"},"releaseDate":{"type":"string"}},"required":["messageTypeCode","messageIdentifierCode","narrativeMessage"],"additionalProperties":false}}},"required":["referencePath","responses"],"additionalProperties":false}}},"required":["disposition","conditionGroups"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}/isf":{"get":{"operationId":"shipping-getEntryIsfResponse","summary":"Get CBP's ISF response for an entry","description":"Requires the API key scope `filing`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"disposition":{"type":"object","properties":{"messageTypeCode":{"type":"string"},"status":{"type":"string","enum":["DRAFT","AWAITING CBP","APPROVED","DENIED","WARNING","INTERNAL ERROR"]},"description":{"type":"string"},"isfTransactionNumber":{"type":"string"}},"required":["messageTypeCode","status","description"],"additionalProperties":false},"conditionGroups":{"type":"array","items":{"type":"object","properties":{"referencePath":{"type":"array","items":{"type":"object","properties":{"dataType":{"type":"string"},"content":{"type":"string"},"position":{"type":"number"}},"required":["dataType"],"additionalProperties":false}},"responses":{"type":"array","items":{"type":"object","properties":{"messageTypeCode":{"type":"string"},"messageIdentifierCode":{"type":"string"},"narrativeMessage":{"type":"string"}},"required":["messageTypeCode","messageIdentifierCode","narrativeMessage"],"additionalProperties":false}}},"required":["referencePath","responses"],"additionalProperties":false}}},"required":["disposition","conditionGroups"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}/batch-errors":{"get":{"operationId":"shipping-getEntryBatchErrors","summary":"List CBP batch rejects against an entry","description":"Requires the API key scope `filing`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"shortJobId":{"type":"string"},"appIdCode":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"severityCode":{"type":"string"},"conditionCode":{"type":"string"},"narrativeText":{"type":"string"},"referenceType":{"type":"string"},"referenceOccurrence":{"type":"number"},"referenceText":{"type":"string"}},"required":["id","severityCode","conditionCode","narrativeText"],"additionalProperties":false}},"receivedAt":{"type":"string"}},"required":["id","shortJobId","conditions","receivedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}/notifications":{"get":{"operationId":"shipping-getEntryNotifications","summary":"List CBP status notifications for an entry","description":"Requires the API key scope `filing`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"entryNumber":{"type":"string"},"filerCode":{"type":"string"},"receivedAt":{"type":"string"},"dispositionTypeCode":{"type":"string"},"notificationReasonCode":{"type":"string"},"dateOfAction":{"type":"string"},"lineItemIdentifier":{"type":"string"},"remarksText":{"type":"string"},"cbpUser":{"type":"string"},"telephoneNumber":{"type":"string"},"telephoneExtensionNumber":{"type":"string"},"actionIdentificationNumber":{"type":"string"},"quotaLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"lineItemIdentifier":{"type":"string"},"statusCode":{"type":"string"},"statusDescription":{"type":"string"},"requestedQuantity":{"type":"number"},"requestedUom":{"type":"string"},"reservedQuantity":{"type":"number"},"reservedUom":{"type":"string"}},"required":["id","lineItemIdentifier","statusCode","statusDescription","requestedUom","reservedUom"],"additionalProperties":false}},"pgaStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agencyCode":{"type":"string"},"programCode":{"type":"string"},"entryLevelStatusCode":{"type":"string"},"entryLevelStatusMessage":{"type":"string"},"lineLevelStatusCode":{"type":"string"},"statusReasonCode":{"type":"string"},"lineRange":{"type":"string"},"actionAt":{"type":"string"},"comments":{"type":"array","items":{"type":"string"}}},"required":["id","agencyCode","programCode","entryLevelStatusCode","entryLevelStatusMessage","lineLevelStatusCode","statusReasonCode","comments"],"additionalProperties":false}}},"required":["id","entryNumber","filerCode","receivedAt","dispositionTypeCode","notificationReasonCode","lineItemIdentifier","remarksText","cbpUser","telephoneNumber","telephoneExtensionNumber","actionIdentificationNumber","quotaLines","pgaStatuses"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}/importer":{"post":{"operationId":"shipping-updateEntryFormImporter","summary":"Set or clear an entry's importer","description":"Requires the API key scope `entries:write`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"importerId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["importerId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["entries:write"]}},"/entries/{versionId}/versions":{"get":{"operationId":"shipping-getRowsByVersionId","summary":"List every version of an entry","description":"Requires the API key scope `filing`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"versionId","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"versionId":{"type":"string"},"headerId":{"type":"string"},"organizationId":{"type":"string"},"entryNumber":{"type":"number"},"submittedAt":{"type":"string"},"importerName":{"type":"string"},"totalValue":{"type":"number"},"totalDuty":{"type":"number"},"products":{"type":"number"},"status":{"type":"string","enum":["DRAFT","AWAITING CBP","APPROVED","DENIED","WARNING","PGA WARNING","INFO","INTERNAL ERROR","UNKNOWN","CBP CONTROLLED","DOCUMENTS REQUESTED","DOCUMENTS RECEIVED","INACTIVATED","CANCELLED","PSC REVERTED","TIB DENIED","PGA UPDATE","LIQUIDATED"]},"numActionItems":{"type":"number"},"type":{"type":"string"},"brokerReferenceNumber":{"type":"string"},"internalName":{"type":"string"},"cbpSourced":{"type":"boolean"},"isLatest":{"type":"boolean"}},"required":["id","versionId","organizationId","status","numActionItems"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["filing"]}},"/entries/{efid}/copies":{"post":{"operationId":"shipping-createFromTemplate","summary":"Create a new entry from an existing one","description":"Requires the API key scope `entries:write`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"shipping":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"required":["shipping"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["entries:write"]}},"/entries/{efid}/drafts":{"post":{"operationId":"shipping-createDraftFromEntry","summary":"Open a new draft version of an entry","description":"Requires the API key scope `entries:write`.","tags":["Entries"],"security":[{"ApiKey":[]},{"Bearer":[]}],"parameters":[{"in":"path","name":"efid","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"efid":{"type":"string"}},"required":["efid"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}},"x-tarifflo-scopes":["entries:write"]}}},"components":{"schemas":{"__schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"not":{}},{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}}]},"__schema1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema1"}}]},"error.BAD_REQUEST":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"BAD_REQUEST"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.UNAUTHORIZED":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"UNAUTHORIZED"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.FORBIDDEN":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"FORBIDDEN"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.INTERNAL_SERVER_ERROR":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"INTERNAL_SERVER_ERROR"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.NOT_FOUND":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"NOT_FOUND"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.CONFLICT":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"CONFLICT"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.PRECONDITION_FAILED":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"PRECONDITION_FAILED"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.UNPROCESSABLE_CONTENT":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"UNPROCESSABLE_CONTENT"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.BAD_GATEWAY":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"BAD_GATEWAY"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.PAYMENT_REQUIRED":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"PAYMENT_REQUIRED"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.NOT_IMPLEMENTED":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"NOT_IMPLEMENTED"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"error.PAYLOAD_TOO_LARGE":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"PAYLOAD_TOO_LARGE"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{}}},"required":["message"]},"description":"Input validation issues (400 only)"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"lineItems[3].tariffRows[0].htsNumber"},"message":{"type":"string"}},"required":["path","message"]},"description":"Entry validation errors, by path in the request's `entry`"},"efid":{"type":"string","description":"The entry the request wrote before it failed"},"field":{"type":"string","description":"The field CBP now requires or rejects (`cbp_requirement` only)"},"effectiveDate":{"type":"string","description":"When that CBP rule takes effect (`cbp_requirement` only)"}},"required":["code","message"]}},"required":["error"]},"__schema2":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema2"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema2"}}]}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"Bearer":{"type":"http","scheme":"bearer","description":"A `tflo_` API key as a bearer token."}}}}