Zoho

    Below is a step-by-step guide to setting up a webhook in Zoho to send a JSON payload to the Print.one API.

    Preparation

    Zoho Account

    Make sure you have access to your Zoho account and the correct Zoho app (e.g., Zoho CRM, Zoho Creator, or Zoho Desk).

    Print.one API Key

    Obtain your API key from Print.one. Ensure you use a TEST API key for testing purposes and the LIVE API key when you're ready for production.

    Step 1: Log in to Zoho

    Navigate to Zoho and log in to your account.

    Step 2: Select the appropriate Zoho app

    Choose the Zoho app where you want to set up the webhook. For example:

    • Zoho CRM

      for lead or deal information.

    • Zoho Creator

      for custom forms.

    • Zoho Desk

      for ticket information.

    In this example, we'll assume you are using Zoho CRM, but the process is similar for other Zoho apps.

    Step 3: Navigate to Settings

    Click on the Settings icon (gear icon) in the top-right corner. Find the "Webhooks" option under Automation or Integrations.

    For example:

    • In Zoho CRM: Navigate to Settings → Automation → Webhooks.

    • In Zoho Desk: Navigate to Settings → Automation → Webhooks.

    Step 4: Create a new Webhook

    1. Click the "New Webhook" (or "Create Webhook") button.

    2. Fill in the following fields:

      • Webhook Name: Name the webhook, e.g., "Send to Print.one API".

      • URL to Notify: Enter the following URL: https://api.print.one/v2/orders

      • HTTP Method: Select POST.

    Step 5: Add the Headers

    Add the following headers to the webhook:

    1. API Key Header:

      • Key: X-API-KEY

      • Value: Enter your Print.one API key, which can be found in the Print.one portal under Integrate → API Keys.

    2. Content-Type Header:

      • Key: Content-Type

      • Value: application/json

    Step 6: Configure the JSON Payload

    Set up the data you want to send to Print.one. The Print.one API expects a JSON payload containing order information.

    In Zoho, you can use dynamic fields (e.g., data from a lead, ticket, or other object). Configure the JSON payload as follows:

    JSON code example for Zoho
    1{
    2 "sender": {
    3 "name": "Your Name",
    4 "address": "Street 123",
    5 "postalCode": "1234AB",
    6 "city": "Amsterdam",
    7 "country": "Netherlands"
    8 },
    9 "recipient": {
    10 "name": "{{Field_Name}}",
    11 "address": "{{Field_Name}}",
    12 "postalCode": "{{Field_Name}}",
    13 "city": "{{Field_Name}}",
    14 "country": "{{Field_Name}}"
    15 },
    16 "mergeVariables": {
    17 "firstname": "{{Field_Name}}",
    18 "discount": "{{Field_Name}}",
    19 "couponcode": "{{Field_Name}}"
    20 },
    21 "templateId": "tmpl_1234567890987654321",
    22 "finish": "GLOSSY",
    23 "billingId": "Your attribute or campaign name for cost allocation"
    24}

    Replace {{Field_Name}} with the actual fields from Zoho CRM.

    Step 7: Add the Webhook to a Workflow

    To automate the webhook activation (e.g., when a lead is created):

    1. Navigate to Settings → Automation → Workflows.

    2. Create a new workflow or edit an existing one.

    3. Add the webhook as an action:

      • Select the webhook you just created.

      • Configure any additional conditions, such as when the workflow should trigger (e.g., on creating a new lead or deal).

    Step 8: Test the Webhook

    1. After setting up the webhook, test it.

    2. Create a test record in Zoho (e.g., a new lead) that triggers the workflow.

    3. Check in Print.one to see if the order was received correctly.

      • If the order status is failed, review the order details to identify the error.

      • If you use a TEST API key, the order will not be printed or shipped, but a PDF will be generated.

      • If you use the LIVE API key, the order will be printed and shipped.

    Step 9: Troubleshooting

    If the webhook doesn’t work as expected, verify the following:

    1. API Key: Ensure the X-API-KEY header is correctly set with the appropriate API key (TEST for testing, LIVE for production).

    2. JSON Payload: Verify the JSON structure and ensure it includes the correct data. Check that all merge variables used in the design (in Print.one) are present in the payload.

    3. URL: Confirm the URL is set to https://api.print.one/v2/orders

    4. Content-Type: Ensure the header is set to Content-Type: application/json.

    5. Workflow: Ensure the workflow triggers as expected and the webhook is activated on the correct event (e.g., when a lead is created).

    Step 10: Use the LIVE API Key for Production

    Once you've confirmed the webhook works correctly with the TEST API key:

    1. Replace the TEST API key in the header with your LIVE API key.

    2. Run the test again to ensure everything functions correctly.