Create Your Salesforce Connected App for Buy with Prime
Buy with Prime API is now available for early access
Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.
To send events to the Salesforce API, in your Salesforce organization you must create a Salesforce connected app for Buy with Prime. For details about Salesforce connected apps, in the Salesforce documentation see Connected Apps.
Create a Salesforce connected app
To create a Salesforce connected app for Buy with Prime, do the following:
- In your Salesforce organization, open Setup.
- In the search box, enter
app manager
. - Choose App Manager, and then choose New Connected App.
- Choose Create a Connected App, and then choose Continue.
- Under Basic Information, do the following:
- In the Connected App Name box, enter Amazon Buy with Prime.
- In the API Name box, enter Amazon_Buy_With_Prime.
- In the Contact Email box, enter your email address.
- Under API (Enable OAuth Settings), select Enable OAuth Settings, and then do the following:
- In the Callback URL box, enter the URL for your Salesforce organization to which you want to redirect the user after authentication.
- In the Available OAuth Scopes box, select Manage user data via APIs (api), and then choose Add.
- In the Available OAuth Scopes box, select Perform requests at any time (refresh_token, offline_access), and then choose Add.
- Clear Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows.
- Select Enable Client Credentials Flow.
- Choose Save, and then choose Continue.
Assign a user to the client credentials flow
The Salesforce connected app processes events in the context of the user that you choose for the client credentials flow. The package logs show the user performing events such as updating a fulfillment order or creating a return order.
To assign a user to the client credentials flow, do the following:
- In your Salesforce organization, open Setup.
- In the search box, enter
manage connected apps
. - Choose Manage Connected Apps, and then choose Amazon Buy with Prime.
- Choose Edit Policies.
- Under Client Credentials Flow, next to the Run As box, choose the magnifying glass button, which has the tooltip Run As Lookup (New Window).
- Choose the user.
- Choose Save.
Grant permissions to the user of the client credentials flow
If the user of the client credentials flow in your Salesforce connected app isn't an administrator, clone the Amazon Buy with Prime for OMS API User permission set and then assign the cloned permission set to the user. The Amazon Buy with Prime for OMS API User permission set provides access to update orders, handle returns, and perform other API actions. For details, see Understand Permission Sets in the OMS Package for Buy with Prime.
After cloning and modifying the permission set, assign the cloned permission set to a user who isn't an administrator. For details about assigning a permission set to a user, see Understand Permission Sets in the OMS Package for Buy with Prime.
Clone the permission set
By cloning the Amazon Buy with Prime for OMS API User permission set, you can add permissions for objects or fields while leaving the original permission set unchanged as the baseline for future configuration. For each user who needs access, clone the permission set and customize the cloned permission set to be specific to the user.
To clone the permission set, do the following:
- In your Salesforce organization, open Setup.
- In the search box, enter
permission sets
. - Click Permission Sets.
- Next to Amazon Buy with Prime for OMS API User, choose Clone.
- In the Label box, enter a name for the permission set.
- In the API Name box, enter an API name for the permission set.
- Choose Save.
Update the object-level and field-level settings in the cloned permission set
In the cloned permission set, grant field-level permissions to each custom field in your data mapping. The baseline Amazon Buy with Prime for OMS API User permissions set grants broad permissions. You need to grant permissions for any new fields.
For each Salesforce object mapped to an associated Buy with Prime entity, provide the object-level permissions shown in the following table:
Buy with Prime entity | Object-level permission |
---|---|
BWP Update Order | Read, Edit, Delete, Read All, and Modify All |
BWP Update Fulfillment Order | Read, Edit, Delete, Read All, and Modify All |
BWP Update Fulfillment Order Line | Read, Edit, Delete, Read All, and Modify All |
BWP Refund Order | Read, Edit, Delete, Read All, and Modify All |
BWP Refund Return Order | Read, Edit, Create, Delete, Read All, and Modify All |
BWP Refund Return Order Line | Read, Edit, Create, Delete, Read All, and Modify All |
BWP Return Order | Read, Edit, Delete, Read All, and Modify All |
BWP Return Return Order | Read, Edit, Create, Delete, Read All, and Modify All |
BWP Return Return Order Line | Read, Edit, Create, Delete, Read All, and Modify All |
To open the object settings in the cloned permission set, do the following:
- In your Salesforce organization, open Setup.
- In the search box, enter
permission sets
. - Click Permission Sets.
- Choose the label that matches the name you assigned to your cloned permission set.
- Under Apps, choose Object Settings.
For each Salesforce object, to grant object-level and field-level permissions for your data mapping, do the following:
- Choose the Salesforce object in your data mapping, for example Orders.
- Choose Edit.
- Under Object Permissions, select each permission you want to grant.
- Under Field Permissions, select Read Access and Edit Access adjacent to each field to which you want to grant access.
For details on how to map Buy with Prime data to Salesforce objects, see Map Your Buy with Prime Data to Your Salesforce Objects.
Retrieve the consumer key and consumer secret
The Salesforce connected app for Buy with Prime generates a consumer key and consumer secret that you can use to configure the AWS middleware. To retrieve the consumer key and consumer secret, do the following:
- In your Salesforce organization, open Setup.
- In the search box, enter
app manager
, and then choose App Manager. - In the row for Amazon Buy with Prime, open the menu, and then choose View.
- Next to Consumer Key and Secret, choose Manage Consumer Details.
- In the Verification Code box, enter your verification code, and then choose Verify.
- Next to Consumer Key, see the consumer key.
- Next to Consumer Secret, see the consumer secret.
For details about keeping the Salesforce connected app more secure by periodically changing the consumer secret, in the Salesforce documentation, see Rotate the Consumer Key and Consumer Secret of a Connected App.
Retrieve the domain URL for your Salesforce organization
The Salesforce organization shows the domain URL, which you can use to configure the AWS middleware. To retrieve the domain URL, do the following:
- In your Salesforce organization, open Setup.
- In the search box, enter
my domain
. - Choose My Domain.
- Next to Current My Domain URL, see the domain for your Salesforce organization.
Related topics
Configure the Salesforce OMS Package for Buy with Prime
Map Your Buy with Prime Data to Your Salesforce Objects
Updated 16 days ago