If uniqueness is what you want, then the following is probably sufficient:
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
fake_dataset <- tibble(Shop = c("B2C", "B2C", "B2B", "B2B"),
Product = c("A", "A", "A", "B"))
fake_dataset %>%
group_by(Shop) %>%
mutate(ID = group_indices()) %>%
ungroup()
#> # A tibble: 4 x 3
#> Shop Product ID
#> <chr> <chr> <int>
#> 1 B2C A 2
#> 2 B2C A 2
#> 3 B2B A 1
#> 4 B2B B 1
Created on 2020-02-19 by the reprex package (v0.3.0)