File Structure

The Processor Template provides various files that allows configuring your API, connect your product and customize your request processing logic. The following table represents the Processor file structure:

File Description
processor.pyThis is the main program; fetch the pending requests via Connect OpenAPI client
config.jsonAPI endpoint and Connect API token specification
globals.pyGlobal constants configuration (e.g., Product ID and Activation Template)
utils.pySupporting functionalities
cancel.pyBusiness logic to process the cancel subscription requests
change.pyBusiness logic to process the change subscription requests ( items or their quantity adjustments)
dynamic_validation.pyValidate the ordering parameters provided during order placement
purchase.pyBusiness logic to process the purchase subscription requests
report_usage.pyHelps upload the usage report files
resume.pyBusiness logic to process the resume subscription requests
suspend.pyBusiness logic to process the suspend subscription requests
tier_fulfilment.pyThe business logic to process the tier request (e.g., reseller account creation)

Running Tests

The Processor uses unittest for testing operations. Test your project and your configuration by executing the following command from your specified Processor directory:

$ python -m unittest discover tests

Processor Example

The Processor Template repository also includes an example project that uses a Mock API Endpoint created in Therefore, this allows emulating API requests from a Vendor system and preview provided use cases. is a tool to design, document, and test APIs. Access the corresponding Community page article to learn more about Apiary API design tool.

The Mock API created via can be accessed by using the following link:

The example project covers the following use cases: Subscription Activation, Cancellation, Suspension, Resumption, Change.

The example project uses a product that is configured on the Connect platform as follows:

  • Capabilities: The Administrative Hold capability is enabled to support Subscription Suspension and Resumption use cases.
  • Items: The product provides one item (SKU) with the “MPN-A” manufacturer part number.
  • Parameters: The product features one fulfillment parameter with all available constraints. Therefore, providing unique value is mandatory and this value can be used as a primary reconciliation ID for matching with Vendor systems.

The parameter ID is used by the Processor to call the Connect API and provide the parameter value before approving a purchase request. Furthermore, it is used to retrieve the parameter value and successfully validate change request.

Is this page helpful?
Translate with Google
Copied to clipboard