Constructor
# new Fulfillment(client) → {Fulfillment}
Creates an instance of the Fulfillment class.
Parameters:
Name | Type | Description |
---|---|---|
client |
ConnectClient | An instance of the ConnectClient class. |
An instance of the Fulfillment class.
Methods
# async approveRequest(id, request) → {object}
Updates the Request and set its status to 'approved'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
request |
object | The request body. |
The updated Request object.
Examples
// request body using a template id
{
template_id: 'TL-827-840-476'
}
// request body using an activation tile
{
activation_tile: '<rendered text>'
}
# async approveRequestWithTemplate(id, templateId) → {object}
Updates the Request and set its status to 'approved' using an activation template.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
templateId |
string | The template id to use for Request approval. |
The updated Request object.
# async approveTierConfigRequest(id, request) → {object}
Updates the TierConfigurationRequest and set its status to 'approved'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
request |
object | The request body. |
The rendered template.
Example
// request body using a template id
{
template: {
id: 'TL-827-840-476'
}
}
# async approveTierConfigRequestWithTemplate(id, templateId) → {object}
Updates the TierConfigurationRequest and set its status to 'approved' using an template.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the TierConfigurationRequest object. |
templateId |
string | The template id to use for TierConfigurationRequest approval. |
The rendered template.
# async createRequest(request)
Creates a new Request object.
Parameters:
Name | Type | Description |
---|---|---|
request |
object | The Request object to create. |
# async createTierConfigRequest(request)
Creates a new TierConfigurationRequest object.
Parameters:
Name | Type | Description |
---|---|---|
request |
object | The TierConfigurationRequest object to create. |
# async createUpdateTierConfigRequest(configId, params)
Creates a new TierConfigurationRequest object of type="update".
Parameters:
Name | Type | Description |
---|---|---|
configId |
string | The TierConfigurationRequest unique identifier. |
params |
Array | An array of parameters. |
# async failRequest(id, reason) → {object}
Changes the status of the Request object to 'fail'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
reason |
string | The reason for which the Request has been failed. |
The updated Request object.
# async failTierConfigRequest(id, reason)
Changes the status of the TierConfigurationRequest object to 'fail'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the TierConfigurationRequest object. |
reason |
string | The reason for which the TierConfigurationRequest has been failed. |
# async getConnectionIdByProductAndHub(productId, hubId) → {string|null}
Search a connection by a product and a hub and if found returns the connection identifier otherwise returns null.
Parameters:
Name | Type | Description |
---|---|---|
productId |
string | The unique identifier of the Product. |
hubId |
string | The unique identifier of the Hub. |
The Connection identifier or null.
# async getRequest(id) → {object}
Retrieve the Request object identified by its id.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
The Request object.
# async getTierConfigRequest(id) → {object}
Retrieve the TierConfigRequest object identified by its id.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the TierConfigRequest object. |
The TierConfigRequest object.
# async inquireRequest(id, request, params, note) → {object}
Updates the Request object to inquire the provider for ordering parameter. It updates the Parameter object value_error attribute and set the status of the Request to 'inquire'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
request |
object | The request body. |
params |
Array | An array of Parameter objects to update. |
note |
string | An optional 'note' attribute for the Request. |
The updated Request object.
Examples
// example of the params argument.
[
{
id: 'param_a', // id is required
value_error: 'This address is already used. Try another.'
}
]
// request body using a template id
{
template_id: 'TL-827-840-476'
}
// request body using an activation tile
{
activation_tile: '<rendered text>'
}
# async inquireRequestWithTemplate(id, templateId, params, note) → {object}
Updates the Request object to inquire the provider for ordering parameter using an activation template. It updates the Parameter object value_error attribute and set the status of the Request to 'inquire'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
templateId |
string | The unique identifier of the Template object. |
params |
Array | An array of Parameter objects to update. |
note |
string | An optional 'note' attribute for the Request. |
The updated Request object.
# async inquireTierConfigRequest(id, params, notes)
Updates the TierConfigRequest object to inquire the tier for ordering parameter. It updates the Parameter object value_error attribute and set the status of the TierConfigRequest to 'inquire'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
params |
Array | An array of Parameter objects to update. |
notes |
string | An optional 'notes' attribute for the Request. |
Example
// example of the params argument.
[
{
id: 'param_a', // id is required
value_error: 'This address is already used. Try another.'
}
]
# async pendingRequest(id) → {object}
Updates the Request and set its status to 'pending'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
The updated Request object.
# async pendingTierConfigRequest(id) → {object}
Updates the TierConfigRequest and set its status to 'pending'.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the TierConfigRequest object. |
The updated TierConfigRequest object.
# async searchRequests(query) → {Array}
Returns a list of Request objects that match the provided filters. If no filter is passed, a page of Request in 'pending' status is returned.
Parameters:
Name | Type | Description |
---|---|---|
query |
object | A RQL query. |
An array of Request objects that match the provided filters.
# async searchTierConfigRequests(query) → {Array}
Returns a list of at most limit TierConfigurationRequest objects that match the provided filters. If no filter is passed, a page of Request in 'pending' status is returned.
for further information about the filters object.
Parameters:
Name | Type | Description |
---|---|---|
query |
object | A RQL query. |
An array of TierConfigurationRequest objects that match the provided filters.
# async updateRequest(id, request) → {object}
Updates a Request object. Only a partial update can be performed on a Request object: developers can update only the note attribute of the Request and/or the asset parameters value or value_error attributes.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
request |
object | The body of the request. |
The updated Request object.
Example
{
note: 'Test Note',
asset: {
params: [
{
id: 'param_a', // id is required
value: 'value_of_param_a',
value_error: 'This address is already used. Try another.'
}
]
}
}
# async updateRequestParameters(id, params, note) → {object}
Updates the asset parameters of a Request object.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the Request object. |
params |
Array | Array of Parameter objects to update. |
note |
string | An optional note for the Request. |
The updated Request object.
# async updateTierConfigRequest(id, request) → {object}
Updates a TierConfigurationRequest object. Only a partial update can be performed on a TierConfigurationRequest object: developers can update only the notew attribute of the TierConfigurationRequest and/or the config parameters value or value_error attributes.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the TierConfigurationRequest object. |
request |
object | The body of the request. |
The updated TierConfigurationRequest object.
Example
{
notes: 'Test Note',
params: [
{
id: 'param_a', // id is required
value: 'value_of_param_a',
value_error: 'This address is already used. Try another.'
}
]
}
# async updateTierConfigRequestParameters(id, params, notes) → {object}
Updates the parameters of a TierConfigurationRequest object.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The unique identifier of the TierConfigurationRequest object. |
params |
Array | Array of Parameter objects to update. |
notes |
string | An optional notes for the TierConfigurationRequest. |
The updated Request object.