Class Fulfillment

Updated: March 10, 2021
Contents

Fulfillment

The Fullfilment class exposes specialized methods to help
developers to achive common use cases for the fulfillment
workflow.

Kind: global class
Category: Operations

new Fulfillment(client)

Creates an instance of the Fulfillment class.

Returns: Fulfillment – An instance of the Fulfillment class.

Param Type Description
client ConnectClient An instance of the ConnectClient class.

fulfillment.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.

Kind: instance method of Fulfillment
Returns: Array – An array of Request objects that match the provided filters.

Param Type Description
query object A RQL query.

fulfillment.failRequest(id, reason) ⇒ object

Changes the status of the Request object to ‘fail’.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param Type Description
id string The unique identifier of the Request object.
reason string The reason for which the Request has been failed.

fulfillment.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.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param Type Description
id string The unique identifier of the Request object.
request object The body of the request.

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.'
}
]
}
}

fulfillment.createRequest(request)

Creates a new Request object.

Kind: instance method of Fulfillment

Param Type Description
request object The Request object to create.

fulfillment.updateRequestParameters(id, params, note) ⇒ object

Updates the asset parameters of a Request object.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param 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.

fulfillment.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’.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param 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.

Example

// example of the params argument.
[
{
id: 'param_a', // id is required
value_error: 'This address is already used. Try another.'
}
]

Example

// request body using a template id
{
template_id: 'TL-827-840-476'
}

Example

// request body using an activation tile
{
activation_tile: '<rendered text>'
}

fulfillment.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’.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param 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.

fulfillment.approveRequest(id, request) ⇒ object

Updates the Request and set its status to ‘approved’.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param Type Description
id string The unique identifier of the Request object.
request object The request body.

Example

// request body using a template id
{
template_id: 'TL-827-840-476'
}

Example

// request body using an activation tile
{
activation_tile: '<rendered text>'
}

fulfillment.approveRequestWithTemplate(id, templateId) ⇒ object

Updates the Request and set its status to ‘approved’
using an activation template.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param Type Description
id string The unique identifier of the Request object.
templateId string The template id to use for Request approval.

fulfillment.pendingRequest(id) ⇒ object

Updates the Request and set its status to ‘pending’.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param Type Description
id string The unique identifier of the Request object.

fulfillment.getRequest(id) ⇒ object

Retrieve the Request object identified by its id.

Kind: instance method of Fulfillment
Returns: object – The Request object.

Param Type Description
id string The unique identifier of the Request object.

fulfillment.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.

Kind: instance method of Fulfillment
Returns: Array – An array of TierConfigurationRequest objects that match the provided filters.

Param Type Description
query object A RQL query.

fulfillment.failTierConfigRequest(id, reason)

Changes the status of the TierConfigurationRequest object to ‘fail’.

Kind: instance method of Fulfillment

Param Type Description
id string The unique identifier of the TierConfigurationRequest object.
reason string The reason for which the TierConfigurationRequest has been failed.

fulfillment.approveTierConfigRequest(id, request) ⇒ object

Updates the TierConfigurationRequest and set its status to ‘approved’.

Kind: instance method of Fulfillment
Returns: object – The rendered template.

Param Type Description
id string The unique identifier of the Request object.
request object The request body.

Example

// request body using a template id
{
template: {
id: 'TL-827-840-476'
}
}

fulfillment.approveTierConfigRequestWithTemplate(id, templateId) ⇒ object

Updates the TierConfigurationRequest and set its status to ‘approved’
using an template.

Kind: instance method of Fulfillment
Returns: object – The rendered template.

Param Type Description
id string The unique identifier of the TierConfigurationRequest object.
templateId string The template id to use for TierConfigurationRequest approval.

fulfillment.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.

Kind: instance method of Fulfillment
Returns: object – The updated TierConfigurationRequest object.

Param Type Description
id string The unique identifier of the TierConfigurationRequest object.
request object The body of the request.

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.'
}
]
}

fulfillment.updateTierConfigRequestParameters(id, params, notes) ⇒ object

Updates the parameters of a TierConfigurationRequest object.

Kind: instance method of Fulfillment
Returns: object – The updated Request object.

Param 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.

fulfillment.createTierConfigRequest(request)

Creates a new TierConfigurationRequest object.

Kind: instance method of Fulfillment

Param Type Description
request object The TierConfigurationRequest object to create.

fulfillment.createUpdateTierConfigRequest(configId, params)

Creates a new TierConfigurationRequest object of type="update".

Kind: instance method of Fulfillment

Param Type Description
configId string The TierConfigurationRequest unique identifier.
params Array An array of parameters.

fulfillment.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’.

Kind: instance method of Fulfillment

Param 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.'
}
]

fulfillment.pendingTierConfigRequest(id) ⇒ object

Updates the TierConfigRequest and set its status to ‘pending’.

Kind: instance method of Fulfillment
Returns: object – The updated TierConfigRequest object.

Param Type Description
id string The unique identifier of the TierConfigRequest object.

fulfillment.getTierConfigRequest(id) ⇒ object

Retrieve the TierConfigRequest object identified by its id.

Kind: instance method of Fulfillment
Returns: object – The TierConfigRequest object.

Param Type Description
id string The unique identifier of the TierConfigRequest object.

fulfillment.getConnectionIdByProductAndHub(productId, hubId) ⇒ string | null

Search a connection by a product and a hub and if found returns
the connection identifier otherwise returns null.

Kind: instance method of Fulfillment
Returns: string | null – The Connection identifier or null.

Param Type Description
productId string The unique identifier of the Product.
hubId string The unique identifier of the Hub.
Is this page helpful?
Translate with Google
Copied to clipboard