Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New webhooks documentation #1024

Merged
merged 14 commits into from
Mar 4, 2024
4 changes: 2 additions & 2 deletions docs/auth-flow/authorize-hosted-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We recommend that you populate the name value with the ID that you use for the m
- `companyId`, because you will need it for directing your customers to Link and managing their connections;
- `redirect` URL value, because you will use this URL in your app to direct the customer to start their Link journey.

Once your customer finishes the Link flow, they will be redirected back to the URL you have set in the [Link settings](/auth-flow/customize/set-up-redirects). You can also present your customer with a confirmation screen that shows [the integrations they have set up](using-the-api/webhooks/core-rules-types#company-data-connection-status-changed).
Once your customer finishes the Link flow, they will be redirected back to the URL you have set in the [Link settings](/auth-flow/customize/set-up-redirects). You can also present your customer with a confirmation screen that shows [the integrations they have set up](using-the-api/webhooks/event-types).

Review the parameters in the example response to creating a new company:

Expand All @@ -47,7 +47,7 @@ Review the parameters in the example response to creating a new company:
}
```

To enhance your Hosted Link experience, [set up a webhook](/auth-flow/customize/set-up-webhooks) to monitor the connection status of the newly created company. We recommend that you set up a webhook for when a user authorizes a data connection so that you can action it within your app.
To enhance your Hosted Link experience, [set up a webhook](/using-the-api/webhooks/create-consumer) to monitor the connection status of the newly created company. We recommend that you set up a webhook for when a user authorizes a data connection so that you can action it within your app.

:::note Use the `redirect` Link URL for existing customers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ We recommend that you populate the name value with the ID that you use for the m
:::

2. From the response to step 1, retain the company ID (hereafter referred to as `companyId`) (see an example below). It is crucial that you retain this value as you will need it for directing your customers to Link and managing their connections.
3. _(Optional)_ [Set up a webhook](/auth-flow/customize/set-up-webhooks) to monitor the connection status of the newly created company.
3. _(Optional)_ [Set up a webhook](/using-the-api/webhooks/create-consumer) to monitor the connection status of the newly created company.

### 2. Display a list of integrations for your users to select, including the integration name and logo

Expand Down Expand Up @@ -113,7 +113,7 @@ A company may link a single source of accounting data but multiple sources of ba

### 4. Confirm successful authorization and data synchronization

1. Once the connection is complete (for guidance on how to monitor the connection, read [Set up webhooks](/auth-flow/customize/set-up-webhooks)), mark the connection as authorized and confirm to your user the successful authorization of the connection.
1. Once the connection is complete (for guidance on how to monitor the connection, read our [webhooks documentation](/using-the-api/webhooks/overview)), mark the connection as authorized and confirm to your user the successful authorization of the connection.
2. Monitor the synchronization of data (also available in <a href="/platform-api#/operations/get-company-data-status">our API</a>):

```http
Expand Down
2 changes: 1 addition & 1 deletion docs/bank-feeds/pushing-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ QBO automatically polls Codat daily for updates, and users can also manually tri

### Monitor request status

After you submit your request to create bank transactions to our API, it will have a status of `Pending`. Use the [Push Operation Status Changed](/bank-feeds/setup#webhooks) webhook to track when the status of your push operation changes to `Success` or `Failed`.
After you submit your request to create bank transactions to our API, it will have a status of `Pending`. Use the [PushOperationStatusChanged](/bank-feeds/setup#webhooks) webhook to track when the status of your push operation changes to `Success` or `Failed`.

If the request is successful, you will receive a webhook like this:

Expand Down
4 changes: 2 additions & 2 deletions docs/bank-feeds/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ The solution lets you tailor the authorization journey to your business needs. Y

## Webhooks

Codat supports a range of [webhooks](/using-the-api/webhooks/core-rules-types) to help you manage your data pipelines. In the <a href="https://app.codat.io" target="_blank">Codat Portal</a>, navigate to **Settings > Webhooks > Rules** and click **Create new rule** to set up the following webhook and get the most out of Bank Feeds API:
Codat supports a range of [webhook events](/using-the-api/webhooks/event-types) to help you manage your data pipelines. In the <a href="https://app.codat.io" target="_blank">Codat Portal</a>, navigate to **Settings > Webhooks > Configure consumer** and click **Add endpoint** to set up an endpoint to listen to the following event type and get the most out of Bank Feeds API:

- [Push operation status has changed](/using-the-api/webhooks/core-rules-types#push-operation-status-has-changed)
- [PushOperationStatusChanged](/using-the-api/webhooks/event-types)

Use this webhook to track the completion of the operation to create bank transactions in the target platform. When you receive a notification from this webhook, check the `status` value in the body. A `Success` status means the `transactions` array has been successfully pushed to the accounting software. In case of errors, resolve the issue and resend the payload.

Expand Down
2 changes: 1 addition & 1 deletion docs/configure/portal/dashboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Most configuration of your Codat solution happens via the Portal, and you can do
This is where the bulk of your configuration occurs. There are 4 main settings areas:

- Auth flow - Settings relating to your authorization flow, whether your using embedded & hosted link, or your own solution
- Webhooks - Create webhook rules and email notifications
- Webhooks - Configure webhook consumers and check available event types
- Integrations - Enable and configure integrations, and manage the data you're retrieve from them
- Organization - [Invite users](/configure/user-management/adding-users) and manage their roles, [manage your plan](/configure/create-account) and see your billable usage, and enable products

Expand Down
2 changes: 1 addition & 1 deletion docs/configure/user-management/user-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _Onboarding_ users have the ability to add companies to the Codat portal and lin

## Analyst

_Analyst_ users have all the abilities of the _Onboarding_ users (adding and linking companies) as well as the ability to view the financial data that is uploaded, view webhooks that have been set, and resolve raised events in the portal.
_Analyst_ users have all the abilities of the _Onboarding_ users (adding and linking companies) as well as the ability to view the financial data that is uploaded, view webhook consumers that have been configured, and resolve raised events in the portal.

## Developer

Expand Down
2 changes: 1 addition & 1 deletion docs/enterprise/tech-implementation/consent/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ When a customer connects, Codat will start extracting and caching relevant data

**How does Codat highlight a completed sync?**

Codat generates a webhook once a data sync has been completed. A webhook can be set up to trigger for specific data types or once all data-types have synced.
Codat generates a [webhook event](/using-the-api/webhooks/overview) once a data sync has been completed. A webhook consumer can be set up to trigger for specific data types or once all data types have synced.

**How can users manage their ongoing connections and revoke access to platforms?**

Expand Down
6 changes: 3 additions & 3 deletions docs/expenses/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Moving your existing integrations to Sync for Expenses lets you leverage the fol
<Question
question="How do I reconnect a company?"
answer={`
If a user disconnects, you can use a <a href="https://docs.codat.io/using-the-api/webhooks/core-rules-types#company-data-connection-status-changed">webhook</a> and redirect your user to the <code>linkUrl</code> of the accounting connection to re-authenticate. If a company changes accounting platforms, it is better to remove the accounting connection completely and create a new one.
If a user disconnects, you can use a <a href="https://docs.codat.io/using-the-api/webhooks/event-types">webhook</a> and redirect your user to the <code>linkUrl</code> of the accounting connection to re-authenticate. If a company changes accounting platforms, it is better to remove the accounting connection completely and create a new one.
`}
/>
<Question
Expand All @@ -82,13 +82,13 @@ If you want to use the accounting platform logos in your user interface, you can
question="How can I resync a failed transaction when I resolve the issue with the transaction?"
answer={`
<p>Once you resolve the issue with the transaction, you can create a new dataset for that transaction Id. You can't resync the transaction with the same dataset because Codat checks the transaction metadata to avoid duplicates. If a transaction Id has a status of completed, it is not synced again.</p>
<p>The following error will appear if a transaction has been previously synced: <code>error: One or more transactions have previously been processed: {Transaction Id}}</code><p>
<p>The following error will appear if a transaction has been previously synced: <code>error: One or more transactions have previously been processed: {Transaction Id}</code>.</p>
`}
/>
<Question
question="How can I detect if an expense account has been deactivated?"
answer={`
You can create a webhook in the Codat portal to inform you when the chart of accounts has been changed. By querying the Chart of Accounts data type and using the <code>isDeleted</code> flag, you can identify which accounts have been deleted before a sync occurs. For more information, please refer to the <a href="https://docs.codat.io/using-the-api/webhooks/core-rules-types">documentation</a> on creating and updating webhook rules.
You can create a webhook consumer in the Codat portal to inform you when the chart of accounts has been changed. By querying the Chart of Accounts data type and using the <code>isDeleted</code> flag, you can identify which accounts have been deleted before a sync occurs. For more information, please refer to the <a href="https://docs.codat.io/using-the-api/webhooks/overview">documentation</a> on creating and updating webhook consumers.
`}
/>
<Question
Expand Down
16 changes: 8 additions & 8 deletions docs/expenses/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,27 @@ The solution lets you tailor the authorization journey to your business needs. Y

### Webhooks

Codat supports a range of [webhooks](/using-the-api/webhooks/core-rules-types) to help you manage your data pipelines. In the <a href="https://app.codat.io" target="_blank">Codat Portal</a>, navigate to **Settings > Webhooks > Rules** and click **Create new rule** to set up the following webhooks and get the most out of Sync for Expenses:
Codat supports a range of [event types](/using-the-api/webhooks/event-types) to help you manage your data pipelines. In the <a href="https://app.codat.io" target="_blank">Codat Portal</a>, navigate to **Settings > Webhooks > Configure consumer** and click **Add endpoint** to set up the following webhook consumers and get the most out of Sync for Expenses:

- [New company synchronized](/using-the-api/webhooks/core-rules-types#new-company-synchronized)
- [NewCompanySynchronized](/using-the-api/webhooks/event-types)

Use this webhook to track the completion of all enabled data type syncs for a newly connected company. When you receive a notification from this webhook, you can proceed to the next steps of the expense management process.
Use this event to track the completion of all enabled data type syncs for a newly connected company. When you receive a notification from the webhook consumer, you can proceed to the next steps of the expense management process.

- [Expenses sync failed](/using-the-api/webhooks/core-rules-types#expenses-sync-failed)
- [SyncFailed](/using-the-api/webhooks/event-types)

Use this webhook to track any failures that might occur during the sync process. When you receive a notification from this webhook, you need to review the error details and reprocess the failed transactions.
Use this event to track any failures that might occur during the sync process. When you receive a notification from the webhook consumer, you need to review the error details and reprocess the failed transactions.

- [Expenses sync completed](/using-the-api/webhooks/core-rules-types#expenses-sync-completed)
- [SyncCompleted](/using-the-api/webhooks/event-types)

Use this webhook to track that the expense transactions have been synced successfully. When you receive a notification from this webhook, you can proceed to the next steps of the expense management process - for example, checking the transactions or informing your SMB customer of the completion.
Use this event to track that the expense transactions have been synced successfully. When you receive a notification from the webhook consumer, you can proceed to the next steps of the expense management process - for example, checking the transactions or informing your SMB customer of the completion.

### Client libraries

Use our comprehensive [Sync for Expenses library](/get-started/libraries) to kick-start and simplify your build. Simply install the library in one of the supported languages and pass your base64-encoded API key to the constructor.

:::tip Recap

You have enabled Sync for Expenses, set up the relevant integrations, configured auth flow parameters, and noted the recommended webhook. This completes the initial setup of the product.
You have enabled Sync for Expenses, set up the relevant integrations, configured auth flow parameters, and noted the recommended event types. This completes the initial setup of the product.

Next, you will create a company and its connections to build out the core infrastructure required to manage expenses with Codat.

Expand Down
8 changes: 4 additions & 4 deletions docs/expenses/sync-process/syncing-expenses.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Once you have initiated the sync, you may want to check whether the sync was com

### Webhook events

We recommend you use webhooks to track the sync status, navigate to **Settings > Webhooks > Rules** in the [Codat Portal](https://app.codat.io/settings/webhooks/rules) and click **Create new rule** to set up the following webhooks:
We recommend you use webhooks to listen to events and track the sync status. To set up a [webhook consumer](/using-the-api/webhooks/create-consumer), navigate to **Settings > Webhooks > Configure consumer** in the [Codat Portal](https://app.codat.io/settings) and click **Add endpoint** that listens to the following events:

* **Expenses sync failed** webhook of `Sync Failed` type is triggered if any failures occurred during the sync process.
* **Expenses sync completed** webhook of `Sync Completed` type is triggered when a sync completes.
* **Expenses sync failed** event of `SyncFailed` type is triggered if any failures occurred during the sync process.
* **Expenses sync completed** event of `SyncCompleted` type is triggered when a sync completes.

You can [read more](/using-the-api/webhooks/core-rules-types) about webhooks at Codat and various trigger events we offer to monitor.
You can [read more](/using-the-api/webhooks/overview) about webhooks at Codat and various events we offer to monitor.

<details>
<summary>Sync status codes</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ While Codat handles the initial connection to Xero via the Codat Link UI, Xero r
| Display the name of the tenant that has been connected | This can be retrieved from our [Get company info](/accounting-api#/operations/get-company-info) endpoint. |
| Display the current status of the connection. If disconnected, provide a button to reconnect to Xero | Use our [Get connection](/platform-api#/operations/get-company-connection) endpoint to check the `status` of the connection and use the `linkUrl` to reconnect.|
| Provide a button to terminate the connection | When a user clicks on the button, use our [Unlink connection](/platform-api#/operations/unlink-connection) endpoint to disconnect from Xero. |
| Handle a disconnect from Xero's side | Use our [Data connection status changed](/using-the-api/webhooks/core-rules-types#company-data-connection-status-changed) webhook to identify when a disconnect happens. When the alert is triggered, change the connection status in your UI and display a "Reconnect" or "Connect" button. Xero recommends setting a regular daily sync of light data types so you can check each connected company's connection status every day.|
| Handle a disconnect from Xero's side | Use a webhook to listen to our [DataConnectionStatusChanged](/using-the-api/webhooks/event-types) event that identifies when a disconnect happens. When the alert is triggered, change the connection status in your UI and display a "Reconnect" or "Connect" button. Xero recommends setting a regular daily sync of light data types so you can check each connected company's connection status every day.|
| Support one-to-one or multi-organizational connection | Codat allows your customers to select their Xero organization using the native Xero UI. You can enable them to connect to multiple organizations within Xero by creating a separate Codat company per organization. |
| Provide a disconnection process for off-boarding | Use our [Unlink connection](/platform-api#/operations/unlink-connection) endpoint to prevent further syncs or the [Delete connection](/platform-api#/operations/delete-company-connection) endpoint to prevent further syncs and querying of historically synced data.|

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ While Codat handles the initial connection to Xero via the Codat Link UI, Xero r
| Display the name of the tenant that has been connected | This can be retrieved from our [Get company info](/accounting-api#/operations/get-company-info) endpoint. |
| Display the current status of the connection. If disconnected, provide a button to reconnect to Xero | Use our [Get connection](/platform-api#/operations/get-company-connection) endpoint to check the `status` of the connection and use the `linkUrl` to reconnect|
| Provide a button to terminate the connection | When a user clicks on the button, use our [Unlink connection](/platform-api#/operations/unlink-connection) endpoint to disconnect from Xero. |
| Handle a disconnect from Xero's side | Use our [Data connection status changed](/using-the-api/webhooks/core-rules-types#company-data-connection-status-changed) webhook to identify when a disconnect happens. When the alert is triggered, change the connection status in your UI and display a "Reconnect" or "Connect" button. Xero recommends setting a regular daily sync of light data types so you can check each connected company's connection status every day.|
| Handle a disconnect from Xero's side | Use a webhook to listen to our [DataConnectionStatusChanged](/using-the-api/webhooks/event-types) event that identifies when a disconnect happens. When the alert is triggered, change the connection status in your UI and display a "Reconnect" or "Connect" button. Xero recommends setting a regular daily sync of light data types so you can check each connected company's connection status every day.|
| Support one-to-one or multi-organizational connection | Codat allows your customers to select their Xero organization using the native Xero UI. You can enable them to connect to multiple organizations within Xero by creating a separate Codat company per organization. |
| Provide a disconnection process for off-boarding | Use our [Unlink connection](/platform-api#/operations/unlink-connection) endpoint to prevent further syncs or the [Delete connection](/platform-api#/operations/delete-company-connection) endpoint to prevent further syncs and querying of historically synced data.|

Expand Down
Loading
Loading