v47 - webservice/webhook.svc/json/customers/addresses
Short Summary:
We have a JSON endpoint to create and update addresses. When creating and updating addresses this way you need to reference via the IntegrationID.
You can get the Address by calling our address endpoint -- {{ServerURL}}/webservice/webhook.svc/json/customers/addresses/
Use above with care, as it will GET all of the Address in your printIQ instances.
Or you can get the address by ID:
{{ServerURL}}/webservice/webhook.svc/json/customers/addresses/{{ID}}
With this new EndPoint, it will Update all address as per behaviour below.
Expected behaviour from this Webservice
- Add a field to the create/update Addresses webhook
- Field: UpdateAll
- Not required
- Default to false if not passed
- Delivery prices will NOT BE RECALCULATED
- Implement "Update All" behaviour
- If passed as true, address will be updated on all cached addresses on active
- Freight deliveries on quotes
- Freight deliveries on jobs
- Freight deliveries on sales orders
- Addresses on Inventory purchase orders
- Active means
- deliveries on quotes that are not: discarded, accepted or rejected
- deliveries on jobs that are not: completed or canceled
- deliveries on sales orders that are not: completed or canceled
We add UpdateAll in the Payload and Integration id needs to be kept in the payload to ensure the address updates.
You need to Post to this Endpoint if you want to use this Webservice.
{{ServerURL}}/webservice/webhook.svc/json/customers/addresses
Eg:
POST //webservice/webhook.svc/json/customers/addresses HTTP/1.1
Host: Your Site URL
PrintIQ-API-Name: {{ContactIQ support to get this information}}
PrintIQ-API-Key: {{Contact IQ support to have this information}}
Content-Length:
{
"Type": ""
"Active": ""
"CustomerCode": ""
"CustomerID": ""
"Name": ""
"Line1": ""
"Line2": ""
"Line3": ""
"City": ""
"Country": ""
"PostCode": ""
"StateName": ""
"IntegrationID": ""
"CanBlindShip": ""
"BlindShipDefaultAddress": ""
"UpdateAll": ""
}
Workflow example.
- You need to run Get CustomerAddress / Get CustomerAddressby ID
GetCustomerAddress ** Use with care it will return everything.
{{ServerURL}}/webservice/webhook.svc/json/customers/addresses/
GetCustomerAddressById
{{ServerURL}}/webservice/webhook.svc/json/customers/addresses/ID - and then Grab the Integration ID.
- Update address update all to a new address
- Validate if the quote has the new address
Below for Sample Payload.
Customer Delivery Address (used for freight sessions on quote/job/sales order and OPO):
{
"Active": "True",
"BlindShipDefaultAddress": false,
"CanBlindShip": false,
"City": "Melbourne",
"Country": "Australia",
"CustomerCode": "UpdateAllTesting",
"CustomerID": "13994",
"Id": "47482",
"IntegrationID": "F76B79CC-1313-4F39-924B-7FA36CE474E2",
"IsDefault": "False",
"Line1": "69 Update All Way",
"Line2": "",
"Line3": "",
"Name": "",
"PostCode": "5050",
"StateName": "Queensland",
"Type": 1,
"UpdateAll": true
}
Customer Billing Address (used for quotes billing address)
{
"Active": "True",
"BlindShipDefaultAddress": false,
"CanBlindShip": false,
"City": "Burleigh Heads",
"Country": "Australia",
"CustomerCode": "UpdateAllTesting",
"CustomerID": "13994",
"Id": "47481",
"IntegrationID": "",
"IsDefault": "True",
"Line1": "37 Connor Street",
"Line2": "",
"Line3": "",
"Name": "",
"PostCode": "4220",
"StateName": "Queensland",
"Type": 2,
"UpdateAll": false
}