Create Product Price via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paulina
    Member
    • Feb 2022
    • 50

    #1

    Create Product Price via API

    Hello,

    I need to create Product Price record via Api. I created an API user and trying to create a role. Usually, there is no Product Price entity in the role. So I created a file in Espo/Custom/Resources/metadata/scopes/ProductPrice.json with code
    Code:
    {
        "acl": true
    }
    Now Product Price available in Role and I set access to Create/Read/Edit:
    Click image for larger version

Name:	image.png
Views:	0
Size:	82.1 KB
ID:	122426

    But when I add this role to the API user, no permissions are set for Product Price in the 'Access' window, so the API user cannot create/read/edit Product Price.
    Click image for larger version

Name:	image.png
Views:	0
Size:	130.5 KB
ID:	122427

    What am I missing? Any comments on how I could create and edit Product Price via the API are welcome, or how to manage it so that the API user has access to Product Price. Thank you ​​
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9485

    #2
    Hi Paulina,

    The Product Price access is infered from access to the Price Book scope. I believe you need to revert the customization and try to add access to the Price Book scope in the Role. I hope it will work out.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • Paulina
      Paulina commented
      Editing a comment
      Yes, you are right! I added the Price Book scope to the role and it worked. Thank you
Working...