Skip to main content
Related API: This extension modifies the Get Customer Purchase Order Account operation.
This action manipulates the HTTP request or response after the GetCustomerPurchaseOrderAccount operation occurs in Kibo. This operation retrieves a customer’s purchase order account.
Action TypeHTTP
Full Action IDhttp.commerce.customer.accounts.getCustomerPurchaseOrderAccount.after
Runs multiple custom functions?Yes

JavaScript File Structure

Action files share the following basic structure:
When you code the custom function for an action, you have access to two arguments: callback—This argument follows the established JavaScript callback pattern: it takes an error as the first argument (or null if there is no error) and a result as the second argument (if required). context—This argument provides the function access to relevant objects and methods that interface with Kibo.

Context: HTTP

The methods and objects documented here are available to this action through the use of the context argument. REST API Operation This action corresponds to the Get Customer Purchase Order Account operation. HTTP Request GET api/commerce/customer/accounts/{accountId}/purchaseOrderAccount?responseFields={responseFields} Request Body There is no request body for this GET operation. Response Body Use context.response.body to write the HTTP response body using this action. The response body is a CustomerPurchaseOrderAccount representing the customer’s purchase order account.

Context Objects Available to All HTTP Actions

request

Accesses the current HTTP request. In the case of Before actions, updates can be made to the request before Kibo eCommerce processes it. Example:

response

Accesses the current HTTP response. For both Before and After actions, updates can be made to the response before Kibo eCommerce processes it. Example:

Context Methods Available to All HTTP Actions

request.get

Returns an HTTP header value for the specified header key. Example:
Response:

response.get

Gets a field from the response. Example:
Response:

response.set

Sets the HTTP headers for the response. Example:
Response: N/A

response.set2

Updates a field in the response. Example:
Response: N/A

response.remove

Removes an HTTP header from the response. Example:
Response: N/A

response.redirect

Redirects the incoming URL. Example:
Response: N/A;

response.end

Ends the response so that other actions or Kibo eCommerce logic can run. Also, signals the callback to complete. Example:
Response: N/A

get.resource

Returns the currently persisted value of the requested resource. **Not available for all calls. Example:
Response: N/A

get.resourceStatus

Gets the HTTP resource status. Example:
Response: N/A

items.urlHelper.getUrl

Gets the current URL. Example:

Context Objects Available to All Actions

apiContext

Accesses Kibo eCommerce tenant information. Example:

configuration

Receives a JSON response that contains information about the configuration data set in the Action Management JSON editor. Example: