All URIs are relative to https://secure.ultracart.com/rest/v2
| Method | HTTP request | Description |
|---|---|---|
| deleteWebhook | DELETE /webhook/webhooks/{webhookOid} | Delete a webhook |
| deleteWebhookByUrl | DELETE /webhook/webhooks | Delete a webhook by URL |
| getWebhookEventCategories | GET /webhook/webhook_event_categories | Retrieve webhook event categories |
| getWebhookLog | GET /webhook/webhooks/{webhookOid}/logs/{requestId} | Retrieve an individual log |
| getWebhookLogSummaries | GET /webhook/webhooks/{webhookOid}/logs | Retrieve the log summaries |
| getWebhooks | GET /webhook/webhooks | Retrieve webhooks |
| insertWebhook | POST /webhook/webhooks | Add a webhook |
| resendEvent | POST /webhook/webhooks/{webhookOid}/reflow/{eventName} | Resend events to the webhook endpoint. |
| updateWebhook | PUT /webhook/webhooks/{webhookOid} | Update a webhook |
deleteWebhook(webhookOid)
Delete a webhook
Delete a webhook on the UltraCart account.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhookOid = 56; // Number | The webhook oid to delete.
apiInstance.deleteWebhook(webhookOid, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhookOid | Number | The webhook oid to delete. |
null (empty response body)
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: Not defined
- Accept: application/json
WebhookResponse deleteWebhookByUrl(webhook)
Delete a webhook by URL
Delete a webhook based upon the URL on the webhook_url matching an existing webhook.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhook = new UltraCartRestApiV2.Webhook(); // Webhook | Webhook to delete
apiInstance.deleteWebhookByUrl(webhook, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhook | Webhook | Webhook to delete |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: application/json; charset=UTF-8
- Accept: application/json
WebhookEventCategoriesResponse getWebhookEventCategories()
Retrieve webhook event categories
Retrieves the available webhook event categories and events with backend-owned metadata (OIDs, names, descriptions, available expansions, flags) independent of whether any webhooks are saved. Used by the New Webhook editor so a merchant with zero webhooks can still see the catalog.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
apiInstance.getWebhookEventCategories((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});This endpoint does not need any parameter.
WebhookEventCategoriesResponse
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: Not defined
- Accept: application/json
WebhookLogResponse getWebhookLog(webhookOid, requestId)
Retrieve an individual log
Retrieves an individual log for a webhook given the webhook oid the request id.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhookOid = 56; // Number | The webhook oid that owns the log.
let requestId = "requestId_example"; // String | The request id associated with the log to view.
apiInstance.getWebhookLog(webhookOid, requestId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhookOid | Number | The webhook oid that owns the log. | |
| requestId | String | The request id associated with the log to view. |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: Not defined
- Accept: application/json
WebhookLogSummariesResponse getWebhookLogSummaries(webhookOid, opts)
Retrieve the log summaries
Retrieves the log summary information for a given webhook. This is useful for displaying all the various logs that can be viewed.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhookOid = 56; // Number | The webhook oid to retrieve log summaries for.
let opts = {
'requestId': "requestId_example", // String | Filter by request id
'beginDate': "beginDate_example", // String | Filter to deliveries on or after this date/time
'endDate': "endDate_example", // String | Filter to deliveries on or before this date/time
'status': "status_example", // String | Filter by HTTP status code
'success': true, // Boolean | Filter by success (true) or failure (false)
'event': "event_example", // String | Filter by an event name contained in the delivery
'orderId': "orderId_example", // String | Filter by an order id contained in the delivery
'request': "request_example", // String | Filter by text contained in the request payload
'duration': 56, // Number | Filter to deliveries that took at least this many milliseconds
'_limit': 100, // Number | The maximum number of records to return on this one API call.
'_offset': 0, // Number | Pagination of the record set. Offset is a zero based index.
'_since': "_since_example" // String | Fetch log summaries that have been delivered since this date/time.
};
apiInstance.getWebhookLogSummaries(webhookOid, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhookOid | Number | The webhook oid to retrieve log summaries for. | |
| requestId | String | Filter by request id | [optional] |
| beginDate | String | Filter to deliveries on or after this date/time | [optional] |
| endDate | String | Filter to deliveries on or before this date/time | [optional] |
| status | String | Filter by HTTP status code | [optional] |
| success | Boolean | Filter by success (true) or failure (false) | [optional] |
| event | String | Filter by an event name contained in the delivery | [optional] |
| orderId | String | Filter by an order id contained in the delivery | [optional] |
| request | String | Filter by text contained in the request payload | [optional] |
| duration | Number | Filter to deliveries that took at least this many milliseconds | [optional] |
| _limit | Number | The maximum number of records to return on this one API call. | [optional] [default to 100] |
| _offset | Number | Pagination of the record set. Offset is a zero based index. | [optional] [default to 0] |
| _since | String | Fetch log summaries that have been delivered since this date/time. | [optional] |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: Not defined
- Accept: application/json
WebhooksResponse getWebhooks(opts)
Retrieve webhooks
Retrieves the webhooks associated with this application.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let opts = {
'_limit': 100, // Number | The maximum number of records to return on this one API call.
'_offset': 0, // Number | Pagination of the record set. Offset is a zero based index.
'_sort': "_sort_example", // String | The sort order of the webhooks. See documentation for examples
'_placeholders': true // Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
};
apiInstance.getWebhooks(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| _limit | Number | The maximum number of records to return on this one API call. | [optional] [default to 100] |
| _offset | Number | Pagination of the record set. Offset is a zero based index. | [optional] [default to 0] |
| _sort | String | The sort order of the webhooks. See documentation for examples | [optional] |
| _placeholders | Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: Not defined
- Accept: application/json
WebhookResponse insertWebhook(webhook, opts)
Add a webhook
Adds a new webhook on the account. If you add a new webhook with the authentication_type set to basic, but do not specify the basic_username and basic_password, UltraCart will automatically generate random ones and return them. This allows your application to have simpler logic on the setup of a secure webhook.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhook = new UltraCartRestApiV2.Webhook(); // Webhook | Webhook to create
let opts = {
'_placeholders': true // Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
};
apiInstance.insertWebhook(webhook, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhook | Webhook | Webhook to create | |
| _placeholders | Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: application/json; charset=UTF-8
- Accept: application/json
WebhookReflowResponse resendEvent(webhookOid, eventName)
Resend events to the webhook endpoint.
This method will resend events to the webhook endpoint. This method can be used for example to send all the existing items on an account to a webhook.
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhookOid = 56; // Number | The webhook oid that is receiving the reflowed events.
let eventName = "eventName_example"; // String | The event to reflow.
apiInstance.resendEvent(webhookOid, eventName, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhookOid | Number | The webhook oid that is receiving the reflowed events. | |
| eventName | String | The event to reflow. |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: Not defined
- Accept: application/json
WebhookResponse updateWebhook(webhookOid, webhook, opts)
Update a webhook
Update a webhook on the account
var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.WebhookApi(apiClient);
// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.
let webhookOid = 56; // Number | The webhook oid to update.
let webhook = new UltraCartRestApiV2.Webhook(); // Webhook | Webhook to update
let opts = {
'_placeholders': true // Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
};
apiInstance.updateWebhook(webhookOid, webhook, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| webhookOid | Number | The webhook oid to update. | |
| webhook | Webhook | Webhook to update | |
| _placeholders | Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
ultraCartOauth, ultraCartSimpleApiKey
- Content-Type: application/json; charset=UTF-8
- Accept: application/json