Fluent Commerce Logo
Docs

How Sourcing Profile GraphQL API works

Topic

Author:

Kirill Gaiduk

Changed on:

17 Sept 2025

Overview

The Sourcing Profile GraphQL API allows technical users to manage sourcing logic within the Fluent platform.
PrerequisitesYou should have knowledge of:

Sourcing Profile GraphQL API Overview

Author:

Kirill Gaiduk

Changed on:

2 Oct 2025

Overview

This article provides technical users with information about the Sourcing Profile GraphQL API, which enables configuration and querying of Sourcing Profiles within the Fluent Platform.

Key points

  • Specific permissions are required for Sourcing Profile operations
  • Use the `createSourcingProfile` mutation to create new Sourcing Profiles or generate updated versions
  • Activate a profile version with the `activateSourcingProfile` mutation; this sets it to `ACTIVE` and automatically sets the previous `ACTIVE` profile version to `INACTIVE`
  • Retrieve Profiles using the `sourcingProfile` query (single Sourcing Profile by Reference) or `sourcingProfiles` query (multiple, with filters)
  • Every update creates a new version of the Sourcing Profile, ensuring full version history is preserved

What is the Sourcing Profile GraphQL API for?

The Sourcing Profile GraphQL API allows technical users to manage sourcing logic within the Fluent Platform:
  • Create, update, activate, and query Sourcing Profiles
  • Define Primary and Fallback Sourcing Strategies
  • Configure Sourcing Conditions and Criteria within each Sourcing Strategy

Sourcing Profile Management

The following diagram explains the key steps of Sourcing Profile management:No alt provided

Permissions

The following permissions are required for different operations on Sourcing Profiles:
  • `SOURCINGPROFILE_CREATE`
  • `SOURCINGPROFILE_UPDATE`
  • `SOURCINGPROFILE_VIEW`

Decision Flow

The following diagram explains the Sourcing Profile GraphQL API behavior:No alt provided

Features

The Sourcing Profile GraphQL API provides the following functionalities:

Create or Update Sourcing Profile

The `createSourcingProfile` mutation creates a Sourcing Profile (or its newer version) for a Retailer:
  • If the provided `ref` is unique, it creates the first version with `ACTIVE` status
  • If a `SourcingProfile` with the same `ref` already exists, it creates a new version with `DRAFT` status

Activate Sourcing Profile

The `activateSourcingProfile` mutation activates a specific version of a Sourcing Profile. When called, it performs the following actions:
  • Sets the specified version status to `ACTIVE`
  • Updates the previously `ACTIVE` version to `INACTIVE`

Get Sourcing Profile

The `sourcingProfile` query retrieves a Sourcing Profile by its Reference:
  • If a version is provided, the query returns that specific version
  • If no version is provided, the query returns the latest available version

Search Sourcing Profiles

The `sourcingProfiles` query retrieves existing Sourcing Profiles and supports multiple filters and pagination. For example, you can use it to:
  • Return active Profiles by applying the `ACTIVE` status filter
  • Review the audit history of inactive versions with the `INACTIVE` status filter
  • Access drafts that are still in progress with the `DRAFT` status filter

Reference Usage

Here is a collection of common scenarios for the Sourcing Profile GraphQL API usage:

Create or Update Sourcing Profile

Author:

Kirill Gaiduk

Changed on:

2 Oct 2025

Overview

The `createSourcingProfile` mutation creates a Sourcing Profile (or its newer version, i.e., updates) for a Retailer:
  • If the provided `ref` is unique, it creates the first version with `ACTIVE` status
  • If a `SourcingProfile` with the same `ref` already exists, it creates a new version with `DRAFT` status

Key points

  • Prerequisites: User should have `SOURCINGPROFILE_CREATE` and `SOURCINGPROFILE_VIEW` permissions
  • Retailer association is permanent: After a Retailer is assigned to a Profile, reassignment to another Retailer is not possible
  • Use clear refs and names: Follow recommended formats (e.g., `GLOBAL_DEFAULT`)
  • Order defines priority: The order of Sourcing Strategies and Criteria determines their application

Inputs

The Input fields for creating a Sourcing Profile are defined with the `CreateSourcingProfileInput`:
FieldTypeDescriptionNotes
`ref``String!`Unique reference of the Sourcing ProfileProvide a business-readable reference (in order to make the `ref` value more self-descriptive) or an universally unique identifier (UUID)Recommended format: `<SCOPE>_<SLUG>`
Example: `GLOBAL_DEFAULT`
Parts:
  • SCOPE - where the profile applies: GLOBAL, HQ, market/region codes (ANZ, US, EU), or site codes (SYD, CHI01)
  • SLUG - short purpose label. Use uppercase letters, digits, and underscores only. Examples:
    • Operational defaults: DEFAULT, STANDARD, LOW_SPLIT
    • Speed & promise: FAST, EXPRESS, ECONOMY
    • Product/campaign: SHOES_SUMMER, BACK_TO_SCHOOL, BLACK_FRIDAY
    • Business rules: COST_OPTIMIZED, MARGIN_OPTIMIZED, DISTANCE_OPTIMIZED
    • Special flows: RETURNS_ONLY, PREORDER, VIP
The uniqueness of a Sourcing Profile is determined by the combination of `ref` and `version`
`versionComment``String`Comment for the Sourcing Profile version
`name``String!`Human-readable name of the Sourcing Profile
`description``String`Human-readable description of the Sourcing Profile
`retailer``RetailerId!`Retailer to which the Sourcing Profile belongs toThe Sourcing Profile’s Retailer is immutable after it is set by the create mutation; updates are not allowedSee the Access Validation section below for more details
`defaultVirtualCatalogue``VirtualCatalogueKey`Virtual Catalog Reference used by defaultThe Virtual Catalog Reference is required to retrieve Available-to-Sell (ATS) quantities for the requested Items
`defaultNetwork``NetworkKey`Network Reference used by defaultThe Network Reference is required to retrieve the list of available Locations for sourcing request fulfillment
`defaultMaxSplit``Int`Limit of split operations used by default`Max Split = (allowed number of Fulfillments)  - 1`
  • An empty (`null`) input is treated as zero (In this case, the sourcing request can be fulfilled by only one Fulfillment)
  • Negative inputs are invalid
`sourcingStrategies``[CreateSourcingStrategyInput!]`List of Primary Sourcing Strategies of the Sourcing ProfileThe order of inputs defines the `priority` of the Primary Sourcing Strategies
`sourcingFallbackStrategies``[CreateSourcingFallbackStrategyInput!]`List of Fallback Sourcing Strategies of the Sourcing ProfileThe order of inputs defines the `priority` of the Fallback Sourcing Strategies
The Input fields for adding Primary and Fallback Sourcing Strategies are defined with the `CreateSourcingStrategyInput` and `CreateSourcingFallbackStrategyInput`:
FieldTypeDescriptionNotes
`ref``String!`Reference of the Primary / Fallback Sourcing StrategyThe Sourcing Strategy Reference must be unique within a specific Sourcing Profile version
  • When adding a new Sourcing Strategy, provide a new unique `ref`
  • When editing an existing Sourcing Strategy, preserve the same `ref`
Recommendation: use a UUID in order to guarantee uniqueness.

Example: `9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d`
`name``String!`Human-readable name of the Primary / Fallback Sourcing Strategy
`description``String`Human-readable description of the Primary / Fallback Sourcing Strategy
`status``String`Status of the Primary / Fallback Sourcing StrategyThe `status` is `ACTIVE` by default
`virtualCatalogue``VirtualCatalogueKey`Virtual Catalog Reference used by the Primary / Fallback Sourcing Strategy
  • If a Strategy Virtual Catalog is provided, it overrides the `defaultVirtualCatalogue` value
  • If empty (`null`), the Strategy inherits the `defaultVirtualCatalogue` value
`network``NetworkKey`Network Reference used by the Primary / Fallback Sourcing Strategy
  • If a Strategy Network is provided, it overrides the `defaultNetwork` value
  • If empty (`null`), the Strategy inherits the `defaultNetwork` value
`maxSplit``Int`Limit of split operations used by the Primary / Fallback Sourcing Strategy`Max Split = (allowed number of Fulfillments)  - 1`
  • If a Strategy Max Split is provided, it overrides the `defaultMaxSplit` value
  • If empty (`null`), the Strategy inherits the `defaultMaxSplit` value
Negative inputs are invalid
`sourcingConditions``[CreateSourcingConditionInput!]`List of Sourcing Conditions that determine whether a Sourcing Strategy is applicable to a sourcing requestWhen multiple Sourcing Conditions are provided, they are evaluated using a logical AND
`sourcingCriteria``[CreateSourcingCriterionInput!]`List of Sourcing Criteria used to rank Locations during the sourcing processThe order of inputs matters because each subsequent Sourcing Criterion acts as a tie-breaker
The Input fields for adding Sourcing Conditions and Criteria are defined with the `CreateSourcingConditionInput` and `CreateSourcingCriterionInput`:
FieldTypeDescriptionNotes
`name``String!`Name of the Sourcing Condition / CriterionThe Name serves as a unique identifier for Sourcing Conditions and Criteria
`type``String!`Type of the Sourcing Condition / CriterionThe Type is mapped to a specific function in the `util-sourcing` library
`params``Json`Parameters of the Sourcing Condition / CriterionThe Parameters configure Sourcing Conditions and Criteria to support specific customer sourcing logic

Access Validation

Sample Payload

Activate Sourcing Profile

Author:

Kirill Gaiduk

Changed on:

2 Oct 2025

Overview

The `activateSourcingProfile` mutation activates a specific version of a Sourcing Profile. When called, it performs the following actions:
  • Sets the specified version status to `ACTIVE`
  • Updates the previously `ACTIVE` version to `INACTIVE`

Key points

  • Prerequisites: User should have `SOURCINGPROFILE_UPDATE` and `SOURCINGPROFILE_VIEW` permissions
  • Version Control: Activating a new version automatically deactivates the previously `ACTIVE` version, ensuring that only one Sourcing Profile version remains active at any time

Inputs

The Input fields for activating a Sourcing Profile are defined with the `ActivateSourcingProfileInput`:
FieldTypeDescription
`ref``String!`Reference of the Sourcing Profile to activate
`version``Int!`Version number of the Sourcing Profile to activate

Access Validation

Sample Payload

Get Sourcing Profile

Author:

Kirill Gaiduk

Changed on:

2 Oct 2025

Overview

The `sourcingProfile` query retrieves a Sourcing Profile by its Reference:
  • If a version is provided, the query returns that specific version
  • If no version is provided, the query returns the latest available version

Key points

  • Prerequisites: User should have `SOURCINGPROFILE_VIEW` permission
  • Version Handling: If a version is provided, that exact version is returned. If no version is specified, the query automatically retrieves the latest available version, regardless of status
  • Status Filter: An optional `status` argument lets you filter results (e.g., `ACTIVE`, `INACTIVE`, `DRAFT`) so you can target Profiles in a specific lifecycle state

Inputs

The Input arguments for retrieving a single Sourcing Profile:
FieldTypeDescriptionNotes
`ref``String!`Reference of the Sourcing Profile
`version``Int`Version number of the Sourcing Profile
`status``String`Status filterFor example:
  • `ACTIVE`
  • `INACTIVE`
  • `DRAFT`

Access Validation

Sample Payload

Search Sourcing Profiles

Author:

Kirill Gaiduk

Changed on:

2 Oct 2025

Overview

The `sourcingProfiles` query retrieves existing Sourcing Profiles. It supports multiple filters and pagination.

Key points

  • Prerequisites: User should have `SOURCINGPROFILE_VIEW` permission
  • Flexible Filtering: Multiple filters are supported, including `ref`, `version`, `versionComment`, `name`, `description`, `status`, `defaultMaxSplit`, and date ranges (`createdOn`, `updatedOn`). This lets you target specific Profiles or narrow results down by lifecycle state and time window
  • Pagination Support: The query supports cursor-based pagination (`first`, `last`, `before`, `after`), making it efficient to handle large sets of Sourcing Profiles 

Inputs

The Input arguments for retrieving Sourcing Profiles (i.e., filters):
FieldTypeDescriptionNotes
`ref``[String!]`Reference of the Sourcing Profile
`version``[Int]`Version number of the Sourcing Profile
`versionComment``[String]`Comment for the Sourcing Profile version
`name``[String]`Human-readable name of the Sourcing Profile
`description``[String]`Human-readable description of the Sourcing Profile
`status``[String]`Status of the Sourcing ProfileFor example:
  • `ACTIVE`
  • `INACTIVE`
  • `DRAFT`
`createdOn``DateRange`Filter by creation dateSpecify range with `from` and `to`
`updatedOn``DateRange`Filter by last updated dateSpecify range with `from` and `to`
`defaultMaxSplit``[Int]`Limit of split operations used by default
`first``Int`Return the first n results
`last``Int`Return the last n results
`before``String`Return results before the specified global IDThis is a cursor (the value is used for pagination)
`after``String`Return results after the specified global IDThis is a cursor (the value is used for pagination)

Access Validation

Sample Payload