Overslaan naar inhoud
  • Er zijn geen suggesties want het zoekveld is leeg.

Troubleshooting the Shipment API

Use this article when an integration doesn't do what you expect.
Work through the layers from top to bottom: a problem in a higher layer often causes errors in the layers below it.

First, collect this information

  • Environment: Test or Production, and the prefix.
  • The dossierNumber and the applicationReferenceId of the declaration.
  • Date and time of the request.
  • Message type, for example DMS Export.
  • The HTTP status code and the full response body.
  • The JSON that was sent, without the Client Secret or token.

Layer 1: Requesting a token fails

Symptom Check Solution
The token request returns an error Client ID, Client Secret and scope=erpservice Secret lost or incorrect? Generate a new one in Administration > Settings > ERP Integrations.
Token works in Test but not in Production Token endpoint and Client ID must belong to the same product (Stratech Shipment or Beurtvaartadres ShipmentManager) and the same environment Use the token endpoint of the same product and environment as the credentials.
It used to work, now it doesn't Is an old token endpoint in use? Stratech Shipment: identity.stratech.nl or shptrainingidentity.stratech.nl. Beurtvaartadres ShipmentManager: identity.beurtvaartadres.nl or identity.stratechlive.nl. Switch to the new endpoint. See the article Authentication (OAuth 2.0).
401 after a while Age of the token A token is valid for 1 hour. Request a new token for every call.

Layer 2: The request is rejected (HTTP 4xx or 5xx)

Nothing is saved.
The response body contains a plain text message.

Code Meaning Solution
400 The request body was empty or contained no declarations. Check that the JSON is sent as the body and that at least one array, such as dmsExportDeclarations, contains a declaration.
401 Missing, invalid or expired token. For Chamber of Commerce with Basic authentication: wrong username or password. See layer 1. [VERIFY: not listed in the specification]
404 Wrong URL. Use /erpservices/ImportDossier, or /api/Import/ImportDossier for Chamber of Commerce. See the article Environments and URLs. [VERIFY]
405 The request contains a declaration type for a module the customer doesn't have. Check which modules the customer has. Support can enable a module.
409 Duplicate applicationReferenceId values. The reference was already used, possibly in an earlier request. Use a new applicationReferenceId for every declaration, also when you send a dataset again. For example: dossier number plus a sequence number.
413 More than 10 declarations in one request. Split the request. Use the same dossierNumber for every part.
500 Unexpected error. Try again. If it keeps happening, contact support with the information listed at the top of this article.

Layer 3: HTTP 200, but the declaration has errors

The request was accepted, but a declaration did not pass the functional validation.
Check isSaved, isSubmitted and errors in the result of each declaration.

Symptom Check Solution
errors is not empty The error messages per declaration Correct the fields mentioned and send the declaration again with a new applicationReferenceId. Never reuse the old one.
Saved but not submitted Is doSubmitWhenValid set to true? The default is false. Set it to true, or submit manually in Shipment.
Saved with errors Is doNotSaveWhenInvalid set to true? The default is false. Set it to true. Invalid declarations are then not saved.
Article data duplicated or conflicting Is the article (SKU and HS code) in the article master data? Leave out previousDocuments, additionalDocumentCode and additionalReferences.
Error on an empty field Empty elements, arrays or objects Leave them out instead of sending them empty.
Dossier can't be found with search Hyphens in dossierNumber Use underscores.
Second DMS export declaration in the same dossier fails Does the dossier already contain a DMS export declaration? Maximum one DMS export declaration per dossier. Use a new dossier.
Chamber of Commerce document can't be added to an existing dossier Does the dossier already contain a declaration or transport document? In the Chamber of Commerce module, ShipmentIdentifier is the dossier number: the same value as dossierNumber in the other modules. A Chamber of Commerce document can only start a dossier. Send it first, then add declarations or transport documents with the same dossierNumber. If the dossier already exists, use a new dossier for the Chamber of Commerce document.

Common error messages

Error message (excerpt) Cause Solution
"The following ApplicationReferenceIds have already been used before" The applicationReferenceId was used before, also when that submission failed. Send a new, unique applicationReferenceId.
"... has 'TransportEquipment_Number' set but the related 'IsContainerShipment' is not set properly" Container data is sent while isContainerShipment is false. Set isContainerShipment to true, or leave out the container data.
"The field AddressDescription must match the regular expression ..." Wrong line break: /n instead of \n, or more than 6 lines of 50 characters. Separate lines with \n.
"The value of Type may not be shorter than 1 character" An empty string ("") in a field that needs a value or no value at all. Leave out the field or send null.
"BG9018: IF <Type of Identification> = 'T' ..." Dutch postal code in the wrong format, for example 1234AB. Use four digits, a space and two capital letters: "1234 AB".
"Submitting is not possible because the credit bundle has been exhausted" The declaration credits are used up or the bundle has expired. Buy a new bundle before you submit more declarations.
"An error occured while importing this declaration. Meldcode: ..." Unexpected error while processing. Send the error message, the Meldcode, the time and the applicationReferenceId to Stratech Support.
"unexpected content "refresh_expires_in"; expected "scope"" Your platform validates the token response against a fixed schema. Keycloak sends extra fields, such as refresh_expires_in, session_state and not-before-policy. OAuth 2.0 (RFC 6749) allows these: a client must ignore fields it doesn't recognise. Have your platform ignore unknown fields, or add them to the schema. See the article Authentication (OAuth 2.0), section Token response.

Tip: show the feedback from the API to the users of your platform, together with the applicationReferenceId. Most data errors can then be solved by the user who created the declaration, without IT or Stratech Support.
HTTP 200 does not mean that the dataset was accepted: always check the response body.

Layer 4: Customs rejects the declaration

The integration works, but Customs does not accept the content.
You receive a status update with status 23 (FunctionalRejection) and an error code such as DMS455AA.

  1. Look up the error code in the DMS rejection codes in the Customs knowledge base.
  2. Read the path in the message: GoodsShipment[1] is declaration 1, GovernmentAgencyGoodsItem[6] is article 6.
  3. Correct the value in your platform, so the error doesn't come back with the next shipment.

Layer 5: Status updates don't arrive

Symptom Check Solution
No status updates at all Is the Status callback URL set? Does the customer have the modules for status updates? Set the URL in Administration > Settings > ERP Integration.
The same update arrives several times Does the endpoint return HTTP 200? On a 4xx or 5xx, Shipment retries later (up to 36 times over about 7 days). Return 200 as soon as the update is received.
Rejected by authentication Authentication type of the webhook in the ERP integration: Geen (None), Basic or OAuth Make sure the authentication type and credentials match on both sides.
Updates are blocked before they reach the endpoint Firewall or IP whitelisting Allow incoming requests from 20.61.240.121.
Signature check fails Certificate used for verification Get the current certificate from /erpservices/Certificates.

Reproduce the issue with Postman

Not sure whether the problem is in your data, your platform or the API? Send the same payload with our Postman collection [TO DO: link].
If it works in Postman, the problem is in your platform.
If it fails in Postman too, check the payload against layers 2 and 3.

Still stuck?

Check the article Common errors and solutions.
Not solved? Contact support and include the information from First, collect this information.
Who to contact is in the article Getting support.