{"article":{"id":31190653050139,"url":"https://tropicappio.zendesk.com/api/v2/help_center/en-us/articles/31190653050139.json","html_url":"https://help.tropicapp.io/hc/en-us/articles/31190653050139-Getting-Started-with-the-Tropic-API-and-Webhooks","author_id":24264172960667,"comments_disabled":true,"draft":false,"promoted":false,"position":0,"vote_sum":0,"vote_count":0,"upvote_count":0,"downvote_count":0,"section_id":31190632406171,"created_at":"2024-11-22T17:01:42Z","updated_at":"2026-04-20T16:57:04Z","name":"Getting Started with the Tropic API and Webhooks","title":"Getting Started with the Tropic API and Webhooks","source_locale":"en-us","locale":"en-us","outdated":false,"outdated_locales":[],"edited_at":"2026-04-20T16:57:04Z","user_segment_id":null,"permission_group_id":14784776743067,"content_tag_ids":["01JEC5F47YVN4RDBKSZWCNZ16Z","01JEC5FFDEY0GD12RK08SEZ30D","01JEC5FPNSK8QRB6TST0T0Z9W6","01JEC5GE6Q42NH9B75BHT4YSDH","01JEC5GQ898MBQHFZ7658XC1AE"],"label_names":["Verifying a Webhook","Editing a Webhook","Webhook API"],"body":"<h2 id=\"h_01JDAE0MV7C8P716W6HTKVQ5AK\"><span class=\"wysiwyg-underline\">API</span></h2><p>The Tropic API empowers you to programmatically manage your software procurement and spend optimization workflows. Built on REST principles, our API provides predictable, resource-oriented URLs and uses standard HTTP methods.</p><p>All requests and responses are JSON-encoded, with conventional HTTP response codes indicating the success or failure of each operation.</p><p>NOT A DEVELOPER? Tropic seamlessly connects with leading procurement, ERP, and financial systems through our native integrations. Start optimizing your software spend, automating renewals, and managing vendors without writing a single line of code.</p><p style=\"display: none;\" id=\"api-doc-link\"><a href=\"https://app.tropicapp.io/api-docs/api\" target=\"_blank\" rel=\"noopener noreferrer\">View API Documentation</a> | <a href=\"https://app.tropicapp.io/api-docs/webhooks\" target=\"_blank\" rel=\"noopener noreferrer\">View Webhook Documentation</a></p><p style=\"display: none;\" id=\"login-message\">To access the full API and Webhook documentation, please <a href=\"https://app.tropicapp.io/login\" target=\"_blank\" rel=\"noopener noreferrer\">log in to your Tropic account</a>. Once logged in, you can find the full documentation in <strong>Settings -- API Keys &amp; Webhooks</strong> under \"Reference\" at the top of the API Keys and Webhooks tables.</p><h2 id=\"h_01KFNPH1TKQWVMNNZ97A2TNEA2\">API Base URL</h2><p data-start=\"436\" data-end=\"504\">All Tropic API requests must be made against the following base URL: </p><p data-start=\"436\" data-end=\"504\"><a href=\"https://api.tropicapp.io\">https://app.tropicapp.io</a></p><p data-start=\"532\" data-end=\"607\">Include this base URL before the endpoint path in every request.<br><strong><span class=\"wysiwyg-underline\">Example</span></strong>: </p><p data-start=\"532\" data-end=\"607\">GET <a data-start=\"613\" data-end=\"654\" target=\"_new\" rel=\"noopener\">https://app.tropicapp.io/api/v1/contracts</a></p><h2 id=\"h_01JDAE0MV7Z81TKRB3Q9ZGYHFY\">Managing API Keys</h2><p>The API Keys &amp; Webhooks page is designed to provide a self-service way for users with the Admin role to help set up and manage the API Keys and Webhooks.</p><p>Navigate to <strong>Settings &gt; API Keys &amp; Webhooks</strong></p><p>You can view the list of API keys and webhooks in each respective tabs. </p><p class=\"wysiwyg-text-align-center\"><img src=\"https://help.tropicapp.io/hc/article_attachments/31191616855451\" width=\"553\" height=\"382\"></p><h3 id=\"h_01K7P6C7SGG2AJY9S5KESEGNF4\" data-start=\"241\" data-end=\"291\">Using Tropic API with Okta Workflows (Example)</h3><p data-start=\"293\" data-end=\"481\">If you’re connecting the Tropic API through <strong data-start=\"337\" data-end=\"355\">Okta Workflows</strong>, make sure your connection uses the correct authorization header. An incorrect header name will cause authentication to fail.</p><p data-start=\"483\" data-end=\"533\">Use the following configuration in Okta Workflows:</p><ul>\n<li data-start=\"537\" data-end=\"560\" data-list-item-id=\"edd3aefb9085796eab8dce314fdab42ca\">\n<strong data-start=\"537\" data-end=\"551\">Auth Type:</strong> Custom</li>\n<li data-start=\"563\" data-end=\"597\" data-list-item-id=\"e433321cba4fc6a071b1162f117d188eb\">\n<strong data-start=\"563\" data-end=\"579\">Header Name:</strong> <code data-start=\"580\" data-end=\"595\">Authorization</code>\n</li>\n<li data-start=\"600\" data-end=\"634\" data-list-item-id=\"e3c34f9e8f63fae8c6207a5e1a2984996\">\n<strong data-start=\"600\" data-end=\"617\">Header Value:</strong> <code data-start=\"618\" data-end=\"634\">Bearer (token)</code>\n</li>\n</ul><p data-start=\"600\" data-end=\"634\"><strong style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\" data-start=\"638\" data-end=\"652\">Important: </strong>Do not use <code data-start=\"668\" data-end=\"681\">bearer_auth</code> as the header name. The Tropic API only accepts <code data-start=\"730\" data-end=\"745\">Authorization</code> with the bearer token format.</p><h2 id=\"h_01JDAE0MV7R7DJJ831GK260HAH\">Creating an API Key</h2><p>API keys are unique identifiers used to authenticate your requests to the Tropic API. Think of them as passwords that allow our systems to verify your identity and grant appropriate access to API resources.</p><p>To generate a new API key:</p><ul>\n<li data-list-item-id=\"e47672d1b690e1611424288bc26037f10\">Navigate to the <strong>API Keys tab</strong>\n</li>\n<li data-list-item-id=\"ea4fbcda2739be408b39dc8ceb7f60acf\">Click the <strong>Generate API Key</strong> button in the top right corner of the table</li>\n<li data-list-item-id=\"e0812f6d0c49d8033576807b18b50490a\">Enter a name for your API key in the dialog</li>\n<li data-list-item-id=\"edc643e863bbf829f043dd880254e7723\">Click <strong>Create</strong>\n</li>\n<li data-list-item-id=\"eee0973b6d805c2171ff7fa35493b77cb\">Copy your new API key immediately</li>\n</ul><p class=\"wysiwyg-text-align-center\"><img src=\"https://help.tropicapp.io/hc/article_attachments/31191634930331\" width=\"601\" height=\"150\"></p><h2 id=\"h_01JDAE0MV73VGF574AW8Y695DK\">Revoking an API Key</h2><p>To revoke a new API key:</p><ul>\n<li data-list-item-id=\"e6c4cfa8869120066af5cb1707a1bf11c\">Click <strong>Revoke API Key</strong> in the line</li>\n<li data-list-item-id=\"ec6300f9afb07436780afda38ddb0b2eb\">Click <strong>Yes, revoke API Key</strong> in the dialog</li>\n</ul><p>Revoking an API key is not a reversible action, once a API key is revoked we can't set it to be active again.</p><h2 id=\"h_01JDAE0MV7GKNB50828W2XT870\"><span class=\"wysiwyg-underline\">Webhooks</span></h2><p>The Webhook API enables real-time event-driven integrations with your existing systems and workflows. Built on industry-standard web protocols, our webhook system provides reliable event delivery, secure payload transmission, and easy-to-implement endpoint management. All webhook notifications are JSON-encoded, with detailed event types and comprehensive payload data to help you respond to changes instantly.</p><h2 id=\"h_01JDAE0MV7REWJAXYH5PT7Z5Q4\">Managing Webhooks</h2><p>The API Keys &amp; Webhooks page is designed to provide a self-service way for users with the Admin role to help set up and manage the API Keys and webhooks.</p><p>Navigate to <strong>Settings &gt; API Keys &amp; Webhooks</strong></p><p>You can view the list of API Keys and webhooks in each respective tabs.</p><p class=\"wysiwyg-text-align-center\"><img src=\"https://help.tropicapp.io/hc/article_attachments/31191634932123\" width=\"596\" height=\"412\"></p><h2 id=\"h_01JDAE0MV7NR5XPAKK2RBDWXG1\">Creating a Webhook</h2><p>Webhooks enable seamless integration by allowing your application to be notified about changes or actions happening in the Tropic app, such as purchase request task status changes, or new contract being created. When you create a webhook, we automatically generate a unique secret key for that webhook. This secret can be used to verify that the requests you receive are authentic and originated from our application, enhancing security and ensuring the integrity of the data being shared.</p><p>To create a new webhook:</p><ul>\n<li data-list-item-id=\"e5a8e6d870eea2f5c9a367911ae5637db\">Navigate to the <strong>Webhooks tab</strong>\n</li>\n<li data-list-item-id=\"ecd8518de25df52c32856666582f8ac92\">Click the <strong>Add Webhook</strong> button in the top right corner of the table</li>\n<li data-list-item-id=\"e7c144dcfffd828f48140ebe60f865a43\">Enter the required fields</li>\n<li data-list-item-id=\"eb52f493dbc0214d74b515d98b098e3d9\">Click <strong>Add Webhook</strong>\n</li>\n<li data-list-item-id=\"e303a9ff4c48bb34db43172ebe9b43185\">Find your webhook secret in the details panel below</li>\n<li data-list-item-id=\"e97282ba9412b92dfb273e8d1bbbde016\">To activate webhook, toggle on in the index</li>\n</ul><p class=\"wysiwyg-text-align-center\"><img src=\"https://help.tropicapp.io/hc/article_attachments/31191616870555\" width=\"261\" height=\"439\"><img src=\"https://help.tropicapp.io/hc/article_attachments/31191634938395\" width=\"279\" height=\"469\"></p><h2 id=\"h_01JDAE0MV73WTV4V1YXBSPENWZ\">Verifying a Webhook</h2><p>To verify that a webhook request is authentic and sent from the Tropic application, you can use the provided signature and the secret key associated with your webhook. Here’s how the verification process works:</p><p>To verify a webhook:</p><ul><li data-list-item-id=\"e9d37b020a0c50d7142a1d0e53562f405\">Recreate the Signed Payload: Combine the timestamp from the <strong>Tropic-Timestamp header </strong>and the raw request body using the format:</li></ul><pre class=\"wysiwyg-code-block\"><code class=\"language-auto\">signed_payload = \"#{timestamp}.#{payload}\"</code></pre><ul><li data-list-item-id=\"ee112011f21a50370d16830440e2cc85c\">Generate the Expected Signature: Use the webhook secret and the SHA-256 HMAC algorithm to hash the signed payload:</li></ul><pre class=\"wysiwyg-code-block\"><code class=\"language-auto\">expected_signature = OpenSSL::HMAC.hexdigest(\"SHA256\", YOUR_WEBHOOK_SECRET, signed_payload)</code></pre><ul><li data-list-item-id=\"ee20bbe300bc38bc8ff72be6cc35a8327\">Compare the Signatures: Check if the <strong>expected signature</strong> matches the signature sent in the <strong>Tropic-Signature</strong> header. If they match, the request is verified and came from the Tropic application.</li></ul><p>Here's a snippet for performing the validation in Ruby:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-auto\">timestamp = request.headers[\"Tropic-Timestamp\"]\npayload = request.body\nsigned_payload = \"#{timestamp}.#{payload}\"\nexpected_signature = OpenSSL::HMAC.hexdigest(\"SHA256\", YOUR_WEBHOOK_SECRET, signed_payload)\nif expected_signature == request.headers[\"Tropic-Signature\"]   \n# Request is verified\nelse   \n# Request is not authentic\nend</code></pre><p>This process is consistent across programming languages, so developers can adapt it to their preferred stack while ensuring the security of the webhook integration.</p><h2 id=\"h_01JDAE0MV7C8P4NVSRWZVJ9AGS\">Editing a Webhook</h2><p>Webhook name, URL and resource actions can be modified at any point, however the secret will not change even if a webhook's information is updated.</p><p>To edit a new webhook:</p><ul>\n<li data-list-item-id=\"e6d9abf02926db76891e6bb3301232613\">Click the ellipsis [<strong>...</strong>] button in line.</li>\n<li data-list-item-id=\"ec3061e2a3d86bbd3981e006fc8b670e4\">Click <strong>Edit.</strong>\n</li>\n<li data-list-item-id=\"e79b719c10aa574f880b178f85c243e5b\">Update your information.</li>\n<li data-list-item-id=\"ee0969cb812f0eb59ead6170b7749be69\">Click <strong>Save.</strong>\n</li>\n</ul><h2 class=\"p1\" id=\"h_01JK8X32YZHKNSZ2B2F0FSWZ2P\">API Logs and Webhook Events</h2><p class=\"p2\">You can view <strong>API Logs</strong> and <strong>Webhook Events</strong> under <strong>Settings → API Keys &amp; Webhooks</strong>.</p><p><span class=\"s1\"></span><strong>API Logs:</strong> Track API activity with details like request date, method, path, status code, and error messages. Note that Payloads are <strong>not included</strong> in API Logs.</p><p><span class=\"s1\"></span><strong>Webhook Events:</strong> View webhook event logs with timestamps and statuses. <span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\">Clicking on an event lets you see the </span><strong style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\">full payload</strong><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"> for easier debugging.</span></p><h2 id=\"h_01JKTJR157VE7G8JJMCFGKQSZ6\" data-start=\"429\" data-end=\"452\">Rate Limiting</h2><p data-start=\"453\" data-end=\"634\">The Tropic API uses rate limiting to maintain security and stability. If more than <strong data-start=\"536\" data-end=\"562\">50 requests per minute</strong> are sent, the API will return a <strong data-start=\"595\" data-end=\"622\">429 (Too Many Requests)</strong> response.</p><p data-start=\"636\" data-end=\"817\">To ensure your integration continues to function as expected, we recommend implementing a <strong data-start=\"726\" data-end=\"745\">retry mechanism</strong> with <strong data-start=\"751\" data-end=\"774\">exponential backoff</strong> to reduce request volume when necessary.</p><h2 id=\"h_01JHSTDAAJJ8HJBMY0HC8MRX54\"><span class=\"wysiwyg-underline\">Endpoints</span></h2><p>The Tropic API provides various endpoints to help you manage procurement and spend workflows. Below are some commonly used examples:</p><p><strong>Contracts</strong>:</p><ul>\n<li data-list-item-id=\"e6b136ec93701d422b5c756b381cb56a6\">\n<code style=\"font-size: 15px;\"><strong>GET /api/v1/contracts</strong></code><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\">: Retrieves all contracts.</span>\n</li>\n<li data-list-item-id=\"e5d422148ed2179cbeec69c1b9ee02b5f\">\n<code style=\"font-size: 15px;\"><strong>POST /api/v1/contracts</strong></code><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\">: Creates a new contract.</span>\n</li>\n<li data-list-item-id=\"e24f56c6ea2f82448e049aa1f63dc54ec\">\n<span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"></span><code style=\"font-size: 15px;\"><strong>PUT</strong> <strong>/api/v1/contracts/{contract_id}</strong></code><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>:</strong> Updates a specific contract.</span>\n</li>\n</ul><p><strong>Purchase Requests</strong>:</p><ul>\n<li data-list-item-id=\"eb21258ef579b9ee27999020833684e8d\">\n<code><strong>GET /api/v1/purchase_requests</strong></code>: Retrieves all purchase requests.</li>\n<li data-list-item-id=\"efd6393fdf5f5e42dee91178569616a0d\">\n<code><strong>PUT /api/v1/purchase_requests/{purchase_request_id}</strong></code>: Updates a specific purchase request.</li>\n</ul><p><strong>Comments</strong>:</p><ul>\n<li data-list-item-id=\"e4a68a7a039bd60d593dd8a27f824bab5\">\n<code><strong>GET</strong> <strong>/api/v1/purchase_requests/{purchase_request_id}/comments</strong></code><strong>:</strong> Retrieves all comments for a purchase request.</li>\n<li data-list-item-id=\"e3d5d5bcbc0ad32e03f7259b6a94f1ed8\">\n<code><strong>POST /api/v1/purchase_requests/{purchase_request_id}/comments</strong></code><strong>:</strong> Adds a comment to a purchase request.</li>\n</ul><p><strong>Suppliers</strong>:</p><ul>\n<li data-list-item-id=\"e4b3a7b9e370434c7b4f1309859a84a09\">\n<code><strong>POST /api/v1/suppliers</strong></code><strong>:</strong> Creates a new supplier.</li>\n<li data-list-item-id=\"ee7fb5efb6f9fdeb2fb5b730573f7f23a\">\n<code><strong>GET /api/v1/suppliers/search</strong></code><strong>:</strong> Searches for suppliers by name or other parameters. Provide a query parameter with letters to narrow your search results.</li>\n<li data-list-item-id=\"e8676599f223cc20a8ed717767bfe3a46\">\n<code><strong>GET</strong> <strong>/api/v1/suppliers/{supplier_id}</strong></code>: Retrieves details of a specific supplier using their unique ID.</li>\n<li data-list-item-id=\"eca1816485518eaaaeff0ac38c57f12e0\">\n<code><strong>PUT /api/v1/suppliers/{supplier_id}</strong></code>: Updates information for an existing supplier, such as name, contact details, or custom fields.</li>\n</ul><p><strong>Note</strong>: To see all of our endpoints, <a href=\"https://app.tropicapp.io/api-docs/\" target=\"_blank\" rel=\"noopener noreferrer\" data-stringify-link=\"https://app.tropicapp.io/api-docs/api/index.html\" data-sk=\"tooltip_parent\">click here</a>. If you have trouble viewing it, make sure you are signed into Tropic.</p>","user_segment_ids":[]}}