Login to TravelPerk -
Step 1: Login to TravelPerk with valid Company Credentials.
TravelPerk - How to Setup Auth.Provider -
Step 2: Login to Salesforce with System Administrator privileges.
Step 3: In the Quick Find box, type "Auth. Providers" and click on the "Auth. Providers"
Step 4: Click the "New" button to create a new Auth Provider.
Step 5: Select TravelPerk as Provider Type.
Step 6: Enter Name (e.g. TravelPerk) and URL Suffix will auto-populate.
- Enter Access Token End Point URL > https://app.sandbox-travelperk.com/accounts/oauth2/token/
- Enter Authorization End Point URL > https://app.sandbox-travelperk.com/oauth2/authorize
Step 8: Copy the Client Id and Secret from TravelPerk ( Goto >TravelPerk>Account Settings>Integration>Salestrip>Manage) and Paste it here.
Step 9: Enter the Redirect URI > your Domain URL + /services/authcallback/TravelPerk
Step 10: Fill in the Details:
- Scope - bookings:read+trips:read+expenses:read
- Secret - accounts
- Registration Handler - Select AuthRegistrationHandler from the lookup.
- Execute as - Select the user for whom you want to configure TravelPerk.
Step 11: Leave the rest as it is and Click Save.
TravelPerk - How to Configure Named Credentials -
Step 1: Navigate to the Setup page and type ‘Named Credentials’ in the Quick Find box and Click the ‘Named Credentials’.
Step 2: Click the ‘New Legacy’ button to create a new named credentials.
Step 3: Fill in the Necessary information:
- Label as TravelPerk.
- The name will auto-populate.
- URL - Copy and paste the travelperk url: https://app.sandbox -travelperk.com
- Identity Type as ‘Named Principal’
- Authentication Protocol as OAuth 2.0 from the dropdown list.
- Select the Authentication Provider as TravelPerk from the lookup.
- Scope as refresh_token full.
- Check the Start Authentication Flow on Save checkbox.
Step 4: Check all the Callout Options checkboxes and Click Save.
Step 5: After clicking the save button. It will redirect to the TravelPerk to authorize and Click ‘Authorize app’.
TravelPerk General Configuration -
Step 01: Sign in to the TravelPerk using their credentials.
Step 02: Click the ‘Account Settings’ on the right top.
Step 03: Click the ‘Integrations’.
Step 04: Verify if SalesTrip Integration is present, if not create a ‘New Integration’.
- Then, Click the ‘Manage’.
Step 05: Click the ‘Edit Integration’ button.
Step 06: Copy the Callback URL and Single Sign-On Initialization URL from the Salesforce Configuration under Auth Provider in Salesforce and paste it to the Redirect URL and External URL below Authorization.
Step 07: Select the required scopes and Click the ‘Save Changes’ button.
TravelPerk - Site Setting Configuration -
Step 01: Navigate to the Setup page and type ‘Sites’ in the Quick find box and Click the ‘Sites’.
Step 02: Click the ‘New’ button to create a new site.
Step 03: Fill the necessary fields:
- Site Label
- Site Name (auto populate)
- Site Contact (auto populate)
- Default Record Owner (auto populate)
- Copy the Default Web Address.
- Active - Mark it as Select. (Make sure the site should be active).
- Active Site Home Page - Select ‘AnswersHome’.
Step 04: Leave the other fields as it is and Click the ‘Save’ button.
Step 05: Once saved, Make sure the Site should be Active and follow the Steps and instructions.
Step I : Go back to the TravelPerk.
Step II : Click the ‘Account Settings’.
Step III : Click the ‘Developers’.
Step IV : Click the ‘Webhooks’. Verify it has Subscribed or not. If not, then Click the ‘Subscribe’ button. If Subscribed, Click the ‘Edit endpoint’ and modify the Endpoint URL.
Step V : Add the new endpoint and fill the necessary inputs:
- Name (e.g. Salesforce integration)
- Secret (Same should be used in the Auth Provider in Salesforce).(e.g. accounts).
- Endpoint URL (Paste the Copied Default Web Address URL from Sites and add ‘ /services/apexrest/salestrip/TravelPerk ’.
- Events to Send - Select the ‘invoices.issued’.
Step 06: Go back to the Sites. Click the Travelperk, then click the ‘Public Access Settings’ button.
Step 07: Click the Enabled Apex Class Access and Click ‘Edit’.
Step 08: Add the salestrip.TravelPerkCallout and salestrip.TravelperkRestAPI class and Click ‘Save’.
Step 09: Click the ‘View Users’.
Step 10: Click the ‘Site Guest User,TravelPerk’ and it will redirect to the user page. Make sure, the site should be Active.
Step 11: Click the ‘Permission Set Assignment’ and Click ‘Edit Assignments’.
Step 12: Add the ‘Site Permission’ and Click the ‘Save’ button.