Class Fulfillment

Updated: March 5, 2020
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.

ParamTypeDescription
clientConnectClientAn 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.

ParamTypeDescription
queryobjectA 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
reasonstringThe 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
requestobjectThe 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

ParamTypeDescription
requestobjectThe 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
paramsArrayArray of Parameter objects to update.
notestringAn 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
requestobjectThe request body.
paramsArrayAn array of Parameter objects to update.
notestringAn 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
templateIdstringThe unique identifier of the Template object.
paramsArrayAn array of Parameter objects to update.
notestringAn 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
requestobjectThe 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
templateIdstringThe 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.

ParamTypeDescription
idstringThe 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.

ParamTypeDescription
idstringThe 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.

ParamTypeDescription
queryobjectA RQL query.

fulfillment.failTierConfigRequest(id, reason)

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

Kind: instance method of Fulfillment

ParamTypeDescription
idstringThe unique identifier of the TierConfigurationRequest object.
reasonstringThe 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.

ParamTypeDescription
idstringThe unique identifier of the Request object.
requestobjectThe 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.

ParamTypeDescription
idstringThe unique identifier of the TierConfigurationRequest object.
templateIdstringThe 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.

ParamTypeDescription
idstringThe unique identifier of the TierConfigurationRequest object.
requestobjectThe 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.

ParamTypeDescription
idstringThe unique identifier of the TierConfigurationRequest object.
paramsArrayArray of Parameter objects to update.
notesstringAn optional notes for the TierConfigurationRequest.

fulfillment.createTierConfigRequest(request)

Creates a new TierConfigurationRequest object.

Kind: instance method of Fulfillment

ParamTypeDescription
requestobjectThe TierConfigurationRequest object to create.

fulfillment.createUpdateTierConfigRequest(configId, params)

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

Kind: instance method of Fulfillment

ParamTypeDescription
configIdstringThe TierConfigurationRequest unique identifier.
paramsArrayAn 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

ParamTypeDescription
idstringThe unique identifier of the Request object.
paramsArrayAn array of Parameter objects to update.
notesstringAn 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.

ParamTypeDescription
idstringThe 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.

ParamTypeDescription
idstringThe 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.

ParamTypeDescription
productIdstringThe unique identifier of the Product.
hubIdstringThe unique identifier of the Hub.
Is this page helpful?
Translate with Google
Copied to clipboard