Fluent Commerce Logo
Docs

Get Sourcing Profile

Essential knowledge

Intended Audience:

Technical User

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:

Field

Type

Description

Notes

`ref`

`String!`

Reference of the Sourcing Profile


`version`

`Int`

Version number of the Sourcing Profile


`status`

`String`

Status filter

For example:

  • `ACTIVE`
  • `INACTIVE`
  • `DRAFT`

Access Validation

The GraphQL framework applies the Standard Permission Check for the target operation and entity:

  • Retailer scope: The Retailer associated with the target entity (or provided in the request) defines the scope for evaluation
  • Role-based access: A user can hold one or more user roles. Each `UserRole` contributes:
    • Permissions via its assigned role (e.g., `SOURCINGPROFILE_CREATE`, `SOURCINGPROFILE_UPDATE`, `SOURCINGPROFILE_VIEW`)
    • Contexts (`RoleContext`) that scope those permissions:
      • `ACCOUNT` - applies across all Retailers
      • `RETAILER` - applies only when the context’s Retailer ID (`contextId`) matches the target Retailer

Result: The request succeeds only if at least one user role grants the required permission in a context applicable to the target Retailer; otherwise, the request is denied or the response contains `null`.

Sample Payload

1query sourcingProfile($ref: String!, $version: Int, $status: String) {
2    sourcingProfile(ref: $ref, version: $version, status: $status) {
3        id
4        ref
5        version
6        versionComment
7        name
8        description
9        status
10        user {
11            id
12        }
13        createdOn
14        updatedOn
15        retailer {
16            id
17        }
18        defaultVirtualCatalogue {
19            ref
20        }
21        defaultNetwork {
22            ref
23        }
24        defaultMaxSplit
25        sourcingStrategies {
26            id
27            ref
28            sourcingProfile {
29                id
30            }
31            name
32            description
33            status
34            priority
35            createdOn
36            updatedOn
37            virtualCatalogue {
38                ref
39            }
40            network {
41                ref
42            }
43            maxSplit
44            sourcingConditions {
45                name
46                type
47                params
48            }
49            sourcingCriteria {
50                name
51                type
52                params
53            }
54        }
55        sourcingFallbackStrategies {
56            id
57            ref
58            sourcingProfile {
59                id
60            }
61            name
62            description
63            status
64            priority
65            createdOn
66            updatedOn
67            virtualCatalogue {
68                ref
69            }
70            network {
71                ref
72            }
73            maxSplit
74            sourcingConditions {
75                name
76                type
77                params
78            }
79            sourcingCriteria {
80                name
81                type
82                params
83            }
84        }
85    }
86}
1{
2    "ref": "GLOBAL_DEFAULT",
3    "version": 1,
4    "status": "INACTIVE"    
5}
1{
2    "data": {
3        "sourcingProfile": {
4            "id": "1128",
5            "ref": "GLOBAL_DEFAULT",
6            "version": 1,
7            "versionComment": "Lorem ipsum",
8            "name": "Lorem ipsum",
9            "description": "Lorem ipsum",
10            "status": "INACTIVE",
11            "user": {
12                "id": "1982"
13            },
14            "createdOn": "2025-09-01T10:18:24.113Z",
15            "updatedOn": "2025-09-01T10:21:49.386Z",
16            "retailer": {
17                "id": "1"
18            },
19            "defaultVirtualCatalogue": {
20                "ref": "BASE:1"
21            },
22            "defaultNetwork": {
23                "ref": "CLICK_AND_COLLECT"
24            },
25            "defaultMaxSplit": 5,
26            "sourcingStrategies": [
27                {
28                    "id": "2308",
29                    "ref": "bbc42abb-609b-495a-ab74-d3c6d55ca445",
30                    "sourcingProfile": {
31                        "id": "1128"
32                    },
33                    "name": "Primary Lorem ipsum",
34                    "description": "Primary Lorem ipsum",
35                    "status": "ACTIVE",
36                    "priority": 1,
37                    "createdOn": "2025-09-01T10:18:24.118Z",
38                    "updatedOn": "2025-09-01T10:18:24.118Z",
39                    "virtualCatalogue": null,
40                    "network": null,
41                    "maxSplit": null,
42                    "sourcingConditions": null,
43                    "sourcingCriteria": [
44                        {
45                            "name": "locationDistance",
46                            "type": "fc.sourcing.criterion.locationDistance",
47                            "params": null
48                        }
49                    ]
50                }
51            ],
52            "sourcingFallbackStrategies": [
53                {
54                    "id": "1128",
55                    "ref": "7c194aef-dd50-4d8e-9b8d-b59df4090740",
56                    "sourcingProfile": {
57                        "id": "1128"
58                    },
59                    "name": "Fallback Lorem ipsum",
60                    "description": "Fallback Lorem ipsum",
61                    "status": "ACTIVE",
62                    "priority": 1,
63                    "createdOn": "2025-09-01T10:18:24.115Z",
64                    "updatedOn": "2025-09-01T10:18:24.115Z",
65                    "virtualCatalogue": null,
66                    "network": null,
67                    "maxSplit": null,
68                    "sourcingConditions": null,
69                    "sourcingCriteria": [
70                        {
71                            "name": "locationDistance",
72                            "type": "fc.sourcing.criterion.locationDistance",
73                            "params": null
74                        }
75                    ]
76                }
77            ]
78        }
79    }
80}