Skip to content

Commit 8d6f380

Browse files
committed
fix: update duty tax recipient type and commodity value formatting in Freightcom shipment creation
- Set duty tax recipient type to "receiver" as required by the API. - Adjust commodity value calculation to ensure formatting meets API expectations.
1 parent ccb9c99 commit 8d6f380

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • plugins/freightcom_rest/karrio/providers/freightcom_rest/shipment

plugins/freightcom_rest/karrio/providers/freightcom_rest/shipment/create.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,19 @@ def shipment_request(
343343
num_units=item.quantity,
344344
unit_price=freightcom_rest_req.TotalCostType(
345345
currency=item.value_currency,
346+
# the api expect to be a whole number like 16900 for 169.00
346347
value=str(int(item.value_amount * 100))
347348
),
348349
description=item.description
349350
) for item in customs.commodities
350351
],
351352
tax_recipient=freightcom_rest_req.TaxRecipientType(
352-
type=provider_units.PaymentType.map(
353-
customs.duty.paid_by
354-
).value
355-
or "shipper",
353+
# they require it to be receiver
354+
# type=provider_units.PaymentType.map(
355+
# customs.duty.paid_by
356+
# ).value
357+
# or "shipper",
358+
type = "receiver",
356359
name=customs.duty_billing_address.company_name or customs.duty.person_name,
357360
address=freightcom_rest_req.AddressType(
358361
address_line_1=customs.duty_billing_address.address_line1,

0 commit comments

Comments
 (0)