TABLE OF CONTENTS

What are Triggers?

Triggers are an effective way to notify your internal systems when certain events take place and can include:

  • Shipment shipped
  • Shipment updated
  • Order cancelled 
  • Order errored. 


The list can be customized, and new triggers added when / where required. These can be configured to be sent off for all orders, going to all PSPs. 

You can read all about creating and editing Triggers in this article: Create and Edit Your Triggers on HP Site Flow: HP Publishing & Graphics Solutions Business 


Events

The list below shows a set of events that are created by default:


Event TypeEvent Description

Order Received

The system has accepted the order, but the artwork has not yet been retrieved.

Order Printready

The artwork has been successfully retrieved and the order is now ready for production.

Order Errored

The artwork is not available, due to either a pre-flight failure or an invalid fetch URL. An order will go to error 12 hours after order submission.

Order Cancelled

The order has been cancelled by the brand or the end consumer.

Component Printed

An item component has been successfully printed.

Shipment Shipped

A shipment has been shipped.


Type

The trigger's type defines the format of the trigger, which can be an HTTPS Postback or email.

HTTPS (POST, PUT, GET) - Post to a HTTPS endpoint. This must be an open URL that cannot contain login credentials; however, a static token can be included either in the header or the body of the payload to be validated upon entry into the system.


Method: Choose whether you want to use a POST, PUT or GET request


Save postback to order: Setting this to YES ensures that the Postback will be recorded on the Postbacks tab within the order


Request headers: The following variables can be used in the headers:


content-type
application/json
content-type
text/xml
content-type
text/plain
content-type
text/html
authorization
The code provided by the brand is to be inserted into the header and allows the receiver to validate that the message is coming from a trusted source.


Template: Here you can select whether to use one of your previously created templates (this is the recommended setup).


Sample Trigger Templates

The following templates can be copied into your account and assigned to the trigger. If you require triggers to be sent in a format other than JSON or wish for custom fields to be included, please gather these requirements and send them to Site Flow. Site FLow will evaluate the requirements and if possible, provide a quote to develop the template.


Order Received
{
"TimeStamp":"{{timestamp}}",
"SourceOrderId":"{{data.orderData.sourceOrderId}}",
"OrderStatus":"received"
}
Order Printready
{
"TimeStamp":"{{timestamp}}",
"SourceOrderId":"{{data.orderData.sourceOrderId}}",
"OrderStatus":"printready"
}
Order Errored
{
"TimeStamp":"{{timestamp}}",
"SourceOrderId":"{{data.orderData.sourceOrderId}}",
"OrderStatus":"error"
}
Order Cancelled
{
"TimeStamp":"{{timestamp}}",
"SourceOrderId":"{{data.orderData.sourceOrderId}}",
"OrderStatus":"cancelled"
}
Component Printed
{
"TimeStamp":"{{timestamp}}",
"SourceOrderId":"{{data.sourceOrderId}}",
"PrintedComponentId":"{{data.sourceItemId}}",
"OrderStatus":"componentprinted"
}
Shipment Shipped
{
"TimeStamp":"{{timestamp}}",
"SourceOrderId":"{{data.sourceOrderId}}",
"SourceShipmentId":"{{data.sourceShipmentId}}",
"ShipmentIndex":"{{data.shipmentIndex}}",
"TrackingNumber":"{{data.trackingNumber}}",
"OrderStatus":"received"
}



PostbackThe notification that is sent
TriggerThe main configuration that enables Postback to be triggered and sent.
Trigger SourceThe event, e.g., the created order which is referenced in the trigger.


Common Questions

  • Triggers will time out if a response is not received within 5 seconds, can this be changed?
    No


  • Can a Postback contain a specific message as to why an order went to error?
    No, only a static error message can be recorded, however, an order will only go to error if the artwork fails pre-flight or if it cannot be retrieved from the supplied URL.

  • Can a Postback be manually generated for testing purposes?
    Not currently, only the event taking place can trigger a Postback. The print shop and print buyer should liaise to organize for the system to be tested end-to-end to ensure that all triggers are sent, and the expected information is received.

  • How can I test the cancelled order trigger?
     You can either manually cancel the order from within the UI, or alternatively via the API using the cancel order call.

  • Can you provide the fixed IP address to be whitelisted by our system to allow for Postbacks to be accepted and the artwork downloaded?
    No, this is not possible as the system runs on AWS, which has a large range of potential IP addresses that cycle multiple times per week.

  • How do I determine whether the Postback was sent and if it was successful?
    You can check this information by looking at the Postbacks tab within an order. If a Postback is shown, it has been sent and you will also see the returned message.
    • Success: 200 - The endpoint has acknowledged the receipt of the Postback.
    • Fail 400: Error - Bad request. The payload contains information not recognized by the receiving system.
    • Fail 415: Error - Unsupported media type. This means that the 'header' configured on the trigger is incorrect.
    • Fail 500: Error - Internal server error.
    • Fail 999: Error - timeout of 5000ms exceeded. The endpoint did not respond in the allowed timeframe.

  • Can I report on each item or stock items within an order created or shipment shipped Postback? 
    Yes, you can use the following function to break the Postback into items (data.orderData.items) or stock items: 
    {{#each data.orderData.stockItems}}: {{#each data.orderData.items}}       
    {           
    "productCode": "{{sku}}",
               "qty": {{quantity}},
               "jobReference": "{{sourceItemId}}",
               "files": [               
    {                   "cover": "{{components.0.path}}",
                       "text": "{{components.1.path}}"               
    }]}
    
    {{#unless @last}},
    {{/unless}} 
    {{/each}}   
    {{#if data.orderData.items}}       
    {{#if data.orderData.stockItems}},
           {{/if}}   {{/if}} 
    {{#each data.orderData.stockItems}}       
    {          
     "productCode": "{{code}}",
               "qty": {{quantity}},
               "files": []       }
    {{#unless @last}},
    {{/unless}} {{/each}}   
    ] } 



Back to Top