API docs incorrectly refer to `contact.company_name` as `contact.company`

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).

Hello @mirek ,

Thank you for your message. We are currently reviewing it and we will come back to you soon to give you a detailed answer.

Hello @Mirek,

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:

job.deliveries[].{pickup,dropoff}.contact.company_name

Thus, to answer the different examples mentioned:

  • 4 times in the “Job Payload Fields” table for the “POST Job creation” entry.

    This table refers to the request payload

  • The 3 references to “company” in the “PATCH Job update” entry.

    We updated the description in the documentation.

We are currently updating our documentation so that the examples are even more explicit.

1 Like

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 @mirek,

During the job creation you should always use the field company wether it is for a pickup or a drop-off. See below:

  • pickups[].contact.company
  • dropoffs[].contact.company

This will ensure that your job is created correctly.

We remain available if you need any further information.

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.company does not work
  • pickups[].contact.company_name works
  • dropoffs[].contact.company works
  • dropoffs[].contact.company_name does 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_name does 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 :slight_smile:

(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)).

Hello @mirek,

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_name does 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.

Understood. Thanks for the quick followup!