PR Intercept: Request Sourcing Flow

sequenceDiagram
    actor Business_User as Business User
    participant ERP_System as ERP/P2P System
    participant ERP_Middleware as ERP Middleware
    participant Fairmarkit_API as Fairmarkit Public API
    participant Fairmarkit_APP as Fairmarkit System
    participant Suppliers as Suppliers

    rect rgb(135,206,250,.2)
      note over Business_User,Fairmarkit_APP: Sourcing Started
        Business_User ->> Fairmarkit_APP: Submit Request
        Fairmarkit_APP-->>Fairmarkit_APP: -
        note over Fairmarkit_APP: Application updates Request status to 'in_progress',<br>sends supplier invitations,<br>and triggers webhook notification.
        Fairmarkit_APP ->> Suppliers: Send supplier invitations via email
        Fairmarkit_APP ->> Fairmarkit_API: **WEBHOOK** event **REQUEST_IN_PROGRESS**
        Fairmarkit_API ->> ERP_Middleware: **WEBHOOK** event **REQUEST_IN_PROGRESS**
        ERP_Middleware-->>ERP_Middleware: -
        note over ERP_Middleware: Middleware: parses the payload,<br>logs the data, and optionally<br>syncs Request information.
        ERP_Middleware ->> ERP_System: Optional: Sync Request status
    end

    rect rgb(144,238,144,.2)
      note over Suppliers,Fairmarkit_APP: Supplier Bidding
        Suppliers ->> Fairmarkit_APP: Submit Bid/Response
        Fairmarkit_APP-->>Fairmarkit_APP: -
        note over Fairmarkit_APP: Application processes the supplier response<br>and triggers webhook notification.
        Fairmarkit_APP ->> Fairmarkit_API: **WEBHOOK** event **RESPONSE_SUBMITTED**
        Fairmarkit_API ->> ERP_Middleware: **WEBHOOK** event **RESPONSE_SUBMITTED**
        ERP_Middleware-->>ERP_Middleware: -
        note over ERP_Middleware: Middleware: receives notification<br>of new supplier response.
    end

    rect rgb(255,218,185,.2)
      note over ERP_Middleware,Fairmarkit_API: ERP Middleware Data Retrieval
        ERP_Middleware ->> Fairmarkit_API: **GET** /self-service/api/v3/responses/request/{request_id}/
        Fairmarkit_API ->> Fairmarkit_APP: Internal API call to get all Responses
        Fairmarkit_APP -->> Fairmarkit_API: Full list of Responses<br>(all submitted bids)
        Fairmarkit_API -->> ERP_Middleware: Full list of Responses<br>(all submitted bids)
        ERP_Middleware-->>ERP_Middleware: -
        note over ERP_Middleware: Middleware: processes response data<br>and retrieves detailed item information.
        ERP_Middleware ->> Fairmarkit_API: **GET** /self-service/api/v3/responses/request/{request_id}/response-items/?response_id={response_id}
        Fairmarkit_API ->> Fairmarkit_APP: Internal API call to get Response Items
        Fairmarkit_APP -->> Fairmarkit_API: Detailed Response Items<br>(with pricing and quantities)
        Fairmarkit_API -->> ERP_Middleware: Detailed Response Items<br>(with pricing and quantities)
        ERP_Middleware-->>ERP_Middleware: -
        note over ERP_Middleware: Middleware: logs and processes<br>detailed bid information for integration.
        ERP_Middleware ->> ERP_System: Sync bid information
        ERP_System -->> Business_User: Display updated sourcing status
    end

Process flow

Sourcing Started Process:

The sourcing process begins when a Request transitions to status to in_progress, indicating that supplier invitations have been sent and bidding has begun.

Steps:

  1. Business User submits Request: A Request is created and submitted through the Fairmarkit UI or API. Check this Guide for Details.

  2. Fairmarkit App initiates sourcing: The Fairmarkit application updates the Request status to "in_progress", sends supplier invitations, and triggers a webhook notification to indicate sourcing has begun. Webhook: REQUEST_IN_PROGRESS with event type "sourcing_started"

  3. Suppliers receive invitations and submit bids: Invited suppliers access the Request through the Fairmarkit platform and submit their responses (bids/quotations).

  4. Fairmarkit App processes supplier responses: As suppliers submit their bids, the Fairmarkit application handles each response and triggers webhook notifications for each submission. Webhook: RESPONSE_SUBMITTED with event type "submitted"

  5. ERP Middleware retrieves response information: The ERP Middleware can retrieve detailed information about submitted responses and their items through API calls:

    Get all responses for a request:

    GET /self-service/api/v3/responses/request/{request_id}/

    Get response items for specific responses:

    GET /self-service/api/v3/responses/request/{request_id}/response-items/?response_id={response_id}

    where:

    • {request_id} is the unique identifier of the Request
    • {response_id} filters response items by specific response IDs (can be multiple)

    Example Response Structure: These endpoints return detailed response and item information including supplier details, pricing, quantities, and any custom schema data.

Additional Notes:

  • The REQUEST_IN_PROGRESS webhook contains the full Request object with all items, allowing the ERP Middleware to sync the latest Request state.
  • Each RESPONSE_SUBMITTED webhook contains minimal response information (id, status, request_id, tenant_id) for efficient processing.
  • This process ensures the ERP system stays synchronized with the sourcing progress and can access detailed bid information for analysis or integration purposes.