I have attempted to sync a contact, deal, product and line item into HubSpot via the eCommerce Bridge sync API end point: /extensions/ecomm/v1/sync-messages/{objectType}
NOTE - the data that we attempted to sync is illustrated in the code snippet at the end of this message.
The problem we experience is that the data is all created in HubSpotexcept for the line item. The line itemis not created in HubSpot.
Subsequently, we have now found that if we send through a value of 0 (zero) through as the tax rate, instead of NULL as is illustrated in the code below, then the line item is created in HubSpot.
Our big concern here is that if we make a call to the sync errors endpoint to check if the sync worked, /extensions/ecomm/v1/sync-errors, it is not coming back with any errors related to this line item. It therefore appears that HubSpot issilently failing to insert the line item and is not informing us of the error.
Please let me know if this makes sense and if you are able to help us get to the bottom of this?
Thanks for clarifying! Apologies for the delayed response.
I was able to reproduce this behavior with a null value for tax in my account.
However, since the sync messages endpoint already returns a 400 error, I would not expect the Get sync errors endpoint to return the same error. The latter endpoint's documentation states that it will return errors from "previously processed sync messages," indicating those which return a 204, and the following error types:
INACTIVE_PORTAL
NO_SYNC_SETTINGS
SETTINGS_NOT_ENABLED
NO_MAPPINGS_DEFINED
MISSING_REQUIRED_PROPERTY
NO_PROPERTIES_DEFINED
INVALID_ASSOCIATION_PROPERTY
INVALID_DEAL_STAGE
INVALID_EMAIL_ADDRESS
INVALID_ENUM_PROPERTY
UNKNOWN_ERROR
Thus, since "Invalid input" errors are already triggered by the sync messages endpoint, they are not returned by the Get sync errors endpoint. Sorry for the confusion and back-and-forth.
To confirm, is the sync message endpoint returning a 204 response for line item Q00078094LINE000, yet you are not seeing the line item appear on deal Q00078094?
Could you share the Hub ID you are operating in and what is returned when you query this sync status endpoint for line item Q00078094LINE000?
Then the sync endpoint comes back with this error:
"{"status":"error","message":"Invalid input JSON on line 1, column 312: Instantiation of [simple type, class com.hubspot.sync.core.messages.SyncMessageRequest] value failed (java.lang.NullPointerException): propertyNameToValues value","correlationId":"1446dbcd-17a9-41d0-8fdb-9692094808b5","requestId":"86f2cb07dbc5d284345ec53430f6c0f0"}"
Then we find our deal was created without the line item:
"[{"integratorObjectId":"lineItem201905232126","action":"UPSERT","changeOccurredTimestamp":1558640012,"propertyNameToValues":{"hs_assoc__product_id":"scprod201905071450","hs_assoc__deal_id":"dealId201905232133","name":"TEST SideClick dealId201905232133 lineItem201905232126 scprod201905071450 Line Item 1","quantity":1,"price":"100","amount":100,"discount":10,"tax":null}}]"
Here is the response we get:
"{"status":"error","message":"Invalid input JSON on line 1, column 371: Instantiation of [simple type, class com.hubspot.sync.core.messages.SyncMessageRequest] value failed (java.lang.NullPointerException): propertyNameToValues value","correlationId":"6326c95b-e05a-48bb-8992-f4959cfbe210","requestId":"6517d7085c61fbcd562238cc0c8e0ab3"}"
The error no longer happens if we switch the 'tax' value to an integer.
Thanks for clarifying! Apologies for the delayed response.
I was able to reproduce this behavior with a null value for tax in my account.
However, since the sync messages endpoint already returns a 400 error, I would not expect the Get sync errors endpoint to return the same error. The latter endpoint's documentation states that it will return errors from "previously processed sync messages," indicating those which return a 204, and the following error types:
INACTIVE_PORTAL
NO_SYNC_SETTINGS
SETTINGS_NOT_ENABLED
NO_MAPPINGS_DEFINED
MISSING_REQUIRED_PROPERTY
NO_PROPERTIES_DEFINED
INVALID_ASSOCIATION_PROPERTY
INVALID_DEAL_STAGE
INVALID_EMAIL_ADDRESS
INVALID_ENUM_PROPERTY
UNKNOWN_ERROR
Thus, since "Invalid input" errors are already triggered by the sync messages endpoint, they are not returned by the Get sync errors endpoint. Sorry for the confusion and back-and-forth.
Thanks very much for the response, that makes sense. Is it documented anywhere how we can expect error messages to come back from the sync messages call? That particular page of documentation does not make reference to 400 being an expected response code and under what conditions?
You're absolutely right — the Sync messages article doesn't mention 400 errors at all.
To be frank, much of our documentation currently lacks the expected range of error codes, and for that, I apologize.
Our product team is working to completely overhaul our current documentation. In the not-too-distant future, we expect our docs to adhere to the OpenAPI Specification v3 (OAS 3), which should make troubleshooting error codes much easier.
In the meantime, I'll be sure to share your pain internally.