Skip to content

Product Integration

Multi-tenant products/services make use of product-level integration to consume event types from other products regardless of the tenant producing events. AIP will route all events of the event type to the consumer webhook defined, thus the consuming service can manage routing to specific tenant based on the payload information.

Here's the request body to send with POST consumer call. First, make sure the consumer is not already registered by querying the collection get /consumers/getbyproduct?productId={id}&eventDefintitionType={type}.

{
    "isProductLevel": true,
    "contactEmail": "email@aptean.co",
    "sourceProductId": "e0683da0-d6a8-4122-ac68-0630f50dc1b8",
    "targetProductId": "287dc3ae-9a54-41d5-aadd-06c2f0607c00",
    "targetSchema": "",
    "subscribedEvents": [
        {
            "eventDefinitionType": "erp-order-created-v1",
            "webhook": "https://webhook",
            "ttl": "00:10:00",
            "attempts": 5
        }
    ]
}
Include targetSchema property if using data mapping.

Sample event delivered to target product. Event should be processed/routed based on the source tenant ID.

{
    "sourceTenantId": "abc",
    "sourceProductId": "e0683da0-d6a8-4122-ac68-0630f50dc1b8",
    "targetProductId": "287dc3ae-9a54-41d5-aadd-06c2f0607c00",
    "eventType": "erp-order-created-v1",
        "payload": {
        "orderId": "358",
        "amount": 618,
        "orderDate": "2024-03-14"
    },
    "configuration":""
}

Product-level Mapping

Standard mapping for data transformation can be setup at product level. The functionality is available from the "AIP Manage - Product Integrations" section in UIB.