When creating a new job (or obtaining details for an existing job), the company_name portion of deliveries[].{pickup,dropoff}.contact.company_name field is repeatedly referred to as just company.
Examples I ran into during development include:
4 times in the the “Job Payload Fields” table for the “POST Job creation” entry.
The “BODY raw” section of the same entry (the “Example Response” portion of said entry is correct as-is)
The 3 references to “company” in for the “PATCH Job update” entry.
Please note that I could be missing a few (string searching the API docs page doesn’t actually search “view more” portion of the example request / response sections).
In all requests except for the job update, you should use company in the payload ({pickups, dropoffs}[].contact.company), which will be returned as company_name ( deliveries[].{pickup,dropoff}.contact.company_name) in the response body.
Regarding the job update request, the payload expects a field named company_name as described below:
Hi @Adrien, thanks for the followup. In reference to this comment:
In all requests except for the job update, you should use company in the payload
Actually I think it’s a bit more complicated than that. The observed behavior during job creation is as follows:
The pickup company should be specified as pickups[].contact.company
The dropoff company should be specified as dropoffs[].contact.company_name
This might not have been the intended behavior at design time, but it’s the behavior that we’re currently seeing in the sandbox. Can you please confirm?
The remaining behavior is as you’ve described (which is effectively that company_name is used everywhere else).
Hi Adrien, just to clarify and confirm there are no bugs in our unit tests, was there an actual discrepancy that was fixed since I first reported it, or was there no discrepancy to begin with?
Here’s what we were seeing prior to opening this issue:
pickups[].contact.companydoes not work
pickups[].contact.company_name works
dropoffs[].contact.company works
dropoffs[].contact.company_namedoes not work
Here is what we’re observing today:
pickups[].contact.company works
pickups[].contact.company_name works
dropoffs[].contact.company works
dropoffs[].contact.company_namedoes not work
In other words, the pickup section will accept the company in either format, whereas the dropoff section will only accept the documented one.
I’m guessing that the reported issue was fixed but the old behavior still works (for pickups only) so as to not break existing clients, but want to make sure I’m not going crazy here
(As a parting thought, it would be nice if the dropoffs section also accepted the company in either format. This would simplify our SDK, as today we need to maintain two separate contact models, one for order creation (using company) and another for the job response (using company_name)).
was there an actual discrepancy that was fixed since I first reported it, or was there no discrepancy to begin with?
No changes have been made in our API regarding these fields since your first message.
Here is what we’re observing today:
pickups[].contact.company works
pickups[].contact.company_name works
dropoffs[].contact.company works
dropoffs[].contact.company_namedoes not work
Indeed, that is how our API is currently designed.
(As a parting thought, it would be nice if the dropoffs section also accepted the company in either format. This would simplify our SDK, as today we need to maintain two separate contact models, one for order creation (using company ) and another for the job response (using company_name )).
Regarding this last point, no modifications are planned at this level. But we will make an announcement if any changes are made.