Supplier Integrations: Generic API

Supplier Integrations: Generic API

Introduction

The Order Push API allows a supplier to configure a per dropship URL that will receive order details for any new orders created by retailers.

Order details are sent to the URL via a simple JSON POST request.

Additionally, a X-CustomGateway-Hmac header is also sent as part of the request. This header can be used to verify that the request has originated from KornitX.


Below is an example of the JSON structure you can expect to receive

  1. {
  2.     "id":0,
  3.     "company_ref_id":Sales Channel Company Ref ID,
  4.     "secondary_company_ref_id":"Dropship Connection Ref ID",
  5.     "ref":"unique Kornit X reference",
  6.     "status":1,
  7.     "status_name":"Received",
  8.     "shipping_company":"",
  9.     "shipping_address_1":"",
  10.     "shipping_address_2":"",
  11.     "shipping_address_3":"",
  12.     "shipping_address_4":"",
  13.     "shipping_address_5":"",
  14.     "shipping_postcode":"",
  15.     "shipping_country":"",
  16.     "shipping_country_code":"ISO 2 Country Code",
  17.     "billing_company":"",
  18.     "billing_address_1":"",
  19.     "billing_address_2":"",
  20.     "billing_address_3":"",
  21.     "billing_address_4":"",
  22.     "billing_address_5":"",
  23.     "billing_postcode":"",
  24.     "billing_country":"",
  25.     "customer_name":"",
  26.     "customer_telephone":"",
  27.     "customer_telephone_mobile":"",
  28.     "sale_datetime":"YYYY-MM-DD HH:MM:SS",
  29.     "external_ref":"Sales Channel order reference",
  30.     "has_been_completed":false,
  31.     "completion_datetime":"0000-00-00 00:00:00",
  32.     "shipping_method":"",
  33.     "customer_email":"",
  34.     "shipping_carrier":"",
  35.     "shipping_tracking":"",
  36.     "shipping_note_url":"Sales Channel Generate Paperwork URL",
  37.     "payment_trans_id":"",
  38.     "payment_type":"",
  39.     "creation_datetime":"YYYY-MM-DD HH:MM:SS",
  40.     "additional_info":"",
  41.     "has_error":false,
  42.     "error_message":"",
  43.     "required_dispatch_date":"0000-00-00",
  44.     "billing_customer_name":"",
  45.     "billing_customer_email":"",
  46.     "billing_customer_telephone":"",
  47.     "shipping_price":0,
  48.     "shipping_price_inc_tax":0,
  49.     "shipping_tax_rate":0,
  50.     "is_urgent":false,
  51.     "coupon_code":"",
  52.     "currency_code":null,
  53.     "is_free_of_charge":true,
  54.     "company_external_ref":"",
  55.     "items":[
  56.         {
  57.             "id":0,
  58.             "sale_vat_rate":0,
  59.             "external_ref":"Sales Channels unique item ref",
  60.             "ref":"KornitX unique item ref",
  61.             "order_id":0,
  62.             "sku":"",
  63.             "mapped_sku":"",
  64.             "description":"",
  65.             "colour":"",
  66.             "size":"",
  67.             "quantity":1,
  68.             "type":2,
  69.             "print_job_id":0,
  70.             "print_job_promise_ref":"",
  71.             "external_url":"",
  72.             "external_thumbnail_url":"https:\/\/s3-eu-west-1.amazonaws.com\/assets.easypromo3d.com\/output\/thumbnails\/product-state\/ZZ9BC2105A64DF76C8-thumbnail.png",
  73.             "status":1,
  74.             "print_on_demand_ref":"",
  75.             "plain_stock_item_ref":"",
  76.             "license":"",
  77.             "license_percentage":"",
  78.             "unit_sale_price":0,
  79.             "unit_sale_price_inc_tax":0,
  80.             "unit_cost_price":0,
  81.             "shipping_price":0,
  82.             "shipping_price_inc_tax":0,
  83.             "bundle_ref":"",
  84.             "textual_product_id":"0",
  85.             "product_variant_id":"0",
  86.             "quantity_batched":1,
  87.             "quantity_dispatched":0,
  88.             "stock_request_id":null,
  89.             "artwork_barcode":"0",
  90.             "quantity_consolidated":0,
  91.             "product_state_id":null,
  92.             "status_name":"Received",
  93.             "ecommerce":{
  94.                 "barcode":""
  95.             },
  96.             "attributes":[
  97.             {
  98.                "name":"",
  99.                "value":""
  100.               },
  101.             ],
  102.             "assets":[
  103.                 {
  104.                     "name":"output-5251025.jpg",
  105.                     "description":"Front",
  106.                     "url":"https:\/\/s3-eu-west-1.amazonaws.com\/generated-assets-gateway3d-com\/print-job\/ZZ759C450D64DF76C8\/print-artwork\/single-5251025.jpg"
  107.                 },
  108.                 {
  109.                     "name":"output-merged-j1hdhnrfmg265vh.jpg",
  110.                     "description":"Front & Neck",
  111.                     "url":"https:\/\/s3-eu-west-1.amazonaws.com\/generated-assets-gateway3d-com\/print-job\/ZZ759C450D64DF76C8\/print-artwork\/merged-302443.jpg"
  112.                 },
  113.                 {
  114.                     "name":"thumbnail.png",
  115.                     "description":"Default Thumbnail",
  116.                     "url":"https:\/\/s3-eu-west-1.amazonaws.com\/assets.easypromo3d.com\/output\/thumbnails\/print-jobs\/514797_90677340.png"
  117.                 },
  118.                 {
  119.                     "name":"thumbnail-2254325.png",
  120.                     "description":"Thumbnail Front",
  121.                     "url":"https:\/\/s3-eu-west-1.amazonaws.com\/assets.easypromo3d.com\/output\/thumbnails\/print-jobs\/514797_90677340_2254325.png"
  122.                 },
  123.                 {
  124.                     "name":"thumbnail-2254326.png",
  125.                     "description":"Thumbnail Back",
  126.                     "url":"https:\/\/s3-eu-west-1.amazonaws.com\/assets.easypromo3d.com\/output\/thumbnails\/print-jobs\/514797_90677340_2254326.png"
  127.                 },
  128.                 {
  129.                     "name":"thumbnail-2254329.png",
  130.                     "description":"Thumbnail Neck Label",
  131.                     "url":"https:\/\/s3-eu-west-1.amazonaws.com\/assets.easypromo3d.com\/output\/thumbnails\/print-jobs\/514797_90677340_2254329.png"
  132.                 }
  133.             ]
  134.         }
  135.     ],
  136.       "pdfs":[
  137.       {
  138.       "id":0,
  139.       "order_id":0,
  140.       "type":1,
  141.       "url":"https:\/\/s3-eu-west-1.amazonaws.com\/generated-assets-gateway3d-com\/misc\/html2pdf\/cc4c1c951eb1d6555401b628132a83a00.pdf",
  142.       "ref":"5pr6wrmrm6l49n8khzb1",
  143.       "is_outdated":false
  144.     }
  145.     ],
  146.     "shipments":[
  147.     ]

  148. }

Order Level Attributes
The Kornit X platform allows order level attributes to be submitted which may contain additional relevant information. For example for shipments to Brazil or other countries where this is required this is where the TaxID that will be needed to process shipping will be provided
  1. "attributes":[
  2.             {
  3.                "name":"TaxID",
  4.                "value":"123456789"
  5.             },

Integration Setup

To receive order pushes, a supplier must enable the "Generic API" supplier integration against the relevant dropship company in the Kornit X platform.

Note - This integration can be set on a “Fulfiller” type company if it is part of a network. In that case this integration will run on all connected dropships that do not have their own overriding integration.

Once the integration has been enabled, a push URL defined and changes saved, a HMAC key will be automatically generated.

The integration can be accessed by going to SETTINGS > COMPANIES and selecting a relevant Dropship or Fulfiller based on the above, selecting the “Supplier Integrations” tab and clicking “Generic API”

When this integration is selected you will be presented with a popup where required information and settings can be added.

  1. Enabled - Yes / No for if the integration is enabled and allowed to run
  2. Dispatch Date Filter - If enabled orders will only be processed on their “Required Dispatch Date” so assumes same day turnaround of production.
  3. Auto Ship - If enabled orders will be automatically classed as shipped when passed into the receiving supplier system
  4. Generate Documents - If you need to get Kornit X generated Dispatch or Address lables then the option “Generate Documents” needs to be enabled on the integration settings and these will be generated as part of the initial order processing if they are set on the Sales Channel or Dropship companies. This only supports documents of type Dispatch (meant for packing slips) or Address (meant for basic address labels) and any PDFs generated will be sent in the "pdfs" section of the JSON body.
  5. Enable Personalisation Text Elements - Enable this toggle option to on and you can ensure text personalisation can be sent within the payload, this has been detailed in more detail further down in this article. 
  6. Email Errors To - Any errors in running this integration will be sent to this email address.
  7. Start Timestamp (UTC) - This is a UTC date time which sets a limit on which any orders older than this will not be triggered on this integration.
  8. Push URL - Your API Endpoint should be added here.
  9. Proxy - If you have agreed a specific proxy IP with KornitX to be used to allow all requests to come from a static IP it should be added here.
  10. HMAC Key - Once the integration has been enabled, a push URL defined and changes saved, a HMAC key will be automatically generated. See below for more details on verifying this key for security.
  11. Artwork Format - PNG, JPEG, TIFF, PDF dropdown.
  12. Do Not Send Blank Print Areas - If enabled then outputs will only be sent where a print area has been populated (this should nearly always be enabled).
  13. Auth Username - If a basic authentication username is needed, add it here.
  14. Auth Password - If a basic authentication password is needed, add it here.
  15. Data Strategy - If you have worked with KornitX on a custom format for how the JSON should be sent to you which does not match our generic format then you will have a unique value to add here to trigger it.
  16. Auth Strategy - If you have worked with KornitX on a custom authentication method which does not match our generic format then you will have a unique value to add here to trigger it.
  17. Response Strategy - If you have worked with KornitX on a custom format for how the responses should be sent which does not match our generic format then you will have a unique value to add here to trigger it.
  18. Push Min. Order Age (s) - An age in seconds that an order must be before the integration is allowed to pick it up, this can allow for customer service windows were order details might be able to be changed.

Personalisation Text Elements Array

With the Generic API supplier integration you can send through text elements within the array, an example of how this will appears is on the extraction below taken from the full payload.

"personalisation_text-elements": [
      {
            "area_name": "Name",
            "area_position_x": 171,
            "area_position_y": 270,
            "final_text": "TEST",
            "size": 38     
      },
{
      "area_name": "Duplicated from Name",
      "area_position_x": 635,
      "area-position_y": 270,
      "final_text": "TEST",
      "size": 38
      }
]
}
]
This feature is a toggle option that is disabled by default. 

Verifying the HMAC header

Whilst optional, this step is highly recommended for security.

For each push request, a HMAC message digest can be calculated using the SHA256 algorithm with the request body as the input and the HMAC key displayed in the Generic API settings page.

The calculated HMAC message digest should match the value of the requests's X-CustomGateway-Hmac header.

Status and Timings
Orders for companies using the Generic API integration enabled will come in with orders on the status of "received" and will be sent out every hour.

Still Need Help?
You can access our extensive knowledge base or raise a ticket with our technical support teams using the buttons below



    • Related Articles

    • Production Integrations: Generic API

      Generic API Integration Help Like other production integrations this should be enabled on a PRODUCTION CENTRE company if it is required. For this particular integration all it requires is to be enabled, there are no other details to complete. This ...
    • Notification Integrations : Generic API

      Introduction Kornit X has built a notification integration to connect to a Generic API. This notifications integration will alert the customers whenever an order has been received, dispatched and delivered. Integration Setup In order to set this ...
    • Product Integration: Generic API

      Generic API Integration Help This product integration The point of this product integrations is that if your products were listed in a specific way for a marketplace the integrations can be set to map the products to the correct categories and that ...
    • Supplier Integrations: Generic Emailer

      Introduction This integration allows the Kornit X platform to send order data out to a Generic Emailer for fulfillers using that system to produce and dispatch items. Integration Setup When setting this up there are no details to add into the ...
    • Supplier Integrations | Generic Hotfolder

      Introduction This integration allows the Kornit X platform to send order data out to a Generic Hotfolder for fulfillers using that system to produce and dispatch items. Integration Setup When setting this up users will need to set their Filesystem ...