@pdigital In my opinion, both URL structures you mentioned are valid, and the best one will depend on the specifics of your project. If you want to strike a balance, consider the following approach:
- For listing or creating credentials associated with a shop:
api/users/{uuid}/shops/{shopUuid}/credentials - For direct operations on a known credential:
api/credentials/{credentialUuid}
I personally prefer this api/credentials/{credentialUuid} approach because the key advantage here is simplicity. Besides, can directly access without passing through the user and shop hierarchy. The only downside is that the URL doesn't immediately reflect the hierarchical relationship between users, shops, and credentials. However, in many practical situations, this might not be a significant drawback.