How to use the quote•hapily Price Book Import API

Learn how to generate an API key and use it to upload a Price Book CSV to quote•hapily.

Who Is This Document For?

This document is intended for developers looking to integrate with the quote•hapily platform. It provides instructions for generating an API key and using it to programmatically upload Price Book CSV files.

What is an API Key?

An API key is a unique identifier that allows secure communication between your system and the quote•hapily platform. In this case, you'll need an API key to upload a Price Book CSV to quote•hapily.

Why Use This Feature?

The API key enables seamless integration between your system and quote•hapily, allowing you to programmatically upload and manage your Price Books without manual intervention. This is especially useful for organizations handling frequent updates or multiple Price Books.


How to Set Up an API Key

Step 1: Navigate to the API Key Library

  1. Log in to your quote•hapily account.

  2. Select API Keys under Settings.

  3. You will see the API Key Library page displaying a summary of your existing keys.

Step 2: Create a New API Key

  1. Click the + Create New API Key button.

  2. Add a description to help identify the purpose of the API key (e.g., "NetSuite integration").

  3. Click Create Key.

Step 3: Copy and Save Your API Key

  1. Once created, the modal will display your new API key. This is the only time it will be visible.

  2. Click Copy Key to copy it to your clipboard.

  3. Save the key securely in a password manager or other safe location. If you lose it, you'll need to delete the key and create a new one.


How to Upload a Price Book CSV using the API

The quote•hapily Price Book Import API returns a pre-signed AWS S3 URL that you can use to upload your Price Book CSV.

See this article for a CSV template and details about the format of the file.

Step 1: Send a Request to Get an Upload URL

  1. Include your API key in the `X-API-Key` HTTP header to send a POST request to the following endpoint:

    POST https://prod.quote.hapily.com/v1/upload
  2. The response will include your pre-signed S3 URL:

    {
    "url": "https://your-presigned-s3-url"
    }

Step 2: Upload the CSV to the Provided URL

Use the url from the API response to upload your Price Book CSV file.

  1. Perform a PUT request to the URL, ensuring the CSV file is included in the request body.

  2. Example cURL command:

    curl -X PUT "<presigned-s3-url>" \
    -H "Content-Type: text/csv" \
    --data-binary @your_price_book.csv
  3. After the upload is complete, the file will be processed by quote•hapily.


Tips and Best Practices

  1. Save Your API Key: Always store your API key in a secure location. If lost, you will need to generate a new one.

  2. Description: Use descriptive names when creating keys to identify their purpose easily.

  3. File Format: Ensure your Price Book file is in CSV format and follows the required structure. For guidance, refer to this article.

  4. Error Handling: If the upload fails, double-check the API key, file format, and HTTP headers in your request.


More Reading

For further guidance, check out the following resources: