|
Zapier Integration
|
1) SSO oauth for zapier (+scopes)
Add oAuth 2.0 APIs
- Authorization
- Access Token Request
- Refresh Token Request
Retrieved Bearer token should get access to Treepl CMS APIs created specially for Zapier (for the site that should be determined by domain)
Request Domain field on Zapier in order to retrieve access token to the particular site only
2) Extension rule
Add new Extension to the portal and to extension JSON file so portal user could enable and disable extension on the ‘Site’ -> ‘Extensions’ tab in the Portal
- Title
- Zapier Integration (beta)
- Short Description
- Allows handling the connection between Treepl CMS and apps that Zapier supports.
- Information
Triggers (should be performed by Treepl once appropriate action is made in the CMS):
-New Module Item
-Updated Module Item
-New CRM Member
-Updated CRM Member
-New CRM Form Submission
-Updated CRM Form Submission
-New CRM Event Booking
-Updated CRM Event Booking
-New Order
-Updated Order
-New Gift Voucher
-Updated Gift Voucher
-Triggered Workflow
Actions:
-Create Module Item
-Update Module Item
-Create CRM Member
-Update CRM Member
-Create CRM Form Submission
-Update CRM Form Submission
-Create CRM Event Booking
-Update CRM Event Booking
-Update Order Details
-Create Gift Voucher
-Update Gift Voucher
Searches:
-Find Module Item
-Find CRM Member
-Find CRM Form Submission
-Find CRM Event Booking
-Find Order
-Find Gift Voucher
- Pricing
- Free during the beta period
3) Triggers
Return models for triggers:
- Module Item
{ "Id":5661,
"Name":"Item 1",
"URL":"/svsdv/sdv/sdv/sdv/ad/item-1",
"URL_List":[
"/svsdv/sdv/sdv/sdv/ad/item-1"
],
"URLSlug":"item-1",
"ParentId":5654,
"ParentId_List":[
-1
],
"ParentName":"",
"ParentUrl":"",
"TemplateName":"Don't Use Template",
"Module_Alias":"MyModule",
"Module_Id":5654,
"Enabled":true,
"ReleaseDate":"2023-03-03T01:00:00",
"ExpiryDate":"9999-12-31T18:59:00",
"SiteSearchKeywords":[
],
"Description":"desc 1",
"Weighting":0,
"DisableForSiteSearch":false,
"SKUCode":"",
"Price":0,
"CreatedByMemberId":"0",
"ItemCategories":[
],
"ItemCategoryIdList":[
],
"ItemTags":[
],
"Author":0,
"Author_Name":"",
"Author_Url":"",
"ShowPageForSearchEngine":true,
"MetaTitle":"",
"SEOTitle":"",
"MetaDescription":"",
"CanonicalLink":"",
"SocialMetaTags":"",
"SeoPriority":0.5,
"EnableAMP":false,
"AMPContent":"",
"OpenGraphProperties":{
"Title":"test",
"Type":"test",
"Url":"test",
"Locale":"test",
"Image":""
},
"EventProperties":{
" | HideWhenFull":false,
" | AllowMultipleSubscriptionPerEmail":false,
" | Capacity":0,
" | Allocation":0,
" | EventDateStart":"2022-04-26T08:07:54",
" | EventDateEnd":"2022-04-26T08:07:54"
},
"ProductProperties":{
" | SmallImage":"/Images/productimages/books/computers/flashmx_small.jpg",
" | LargeImage":"/Images/productimages/books/computers/flashmx_large.jpg",
" | OnSale":true,
" | IsGiftVoucher":false,
" | ProductWeight":0,
" | ProductWidth":0,
" | ProductHeight":0,
" | ProductDepth":0,
" | EnableDropShipping":false,
" | UnitType":"",
" | MinimumUnits":1,
" | MaximumUnits":0,
" | RecurringType":"None",
" | IsShippable":false,
" | IsDownloadable":false,
" | NumberOfPossibleDownloads":0,
" | Supplier":"test@test.test"
},
"CustomProperties":{
" | Custom Property name 1":"",
" | Custom Property name 2":0
} }
- CRM Member
{
"Id":1442,
"Email":"test@test.com",
"FirstName":"Jhon",
"LastName":"Doe",
"Address":"",
"City":"",
"State":"",
"ZipCode":"",
"Country":"",
"BillingAddress":"",
"BillingCity":"",
"BillingState":"",
"BillingZipCode":"",
"BillingCountry":"",
"Site":"",
"Phone":"123456789",
"Status":"",
"Notes":"",
"Type":"Consumer",
"CreatedDateTime":"2019-06-12T17:28:59.07",
"UpdatedDateTime":"2020-08-07T06:56:27.713",
"CrmType":"Member",
"CrmGroup":{
" | My Group Name 1 | ":{
"My Field Name 1.1":"field Value 1",
"My Field Name 1.2":"field Value 2"
},
" | My Group Name 2 | ":{
"My Field Name 2.1":"field Value 1",
"My Field Name 2.2":"field Value 2"
}
}
}
- CRM Form Submission
{
"Id":1442,
"Form":"form_alias",
"Email":"test@test.com",
"FormField":{
" | My Field Name 1":"field Value 1",
" | My Field Name 2":"field Value 2"
},
"CrmGroup":{
" | My Group Name 1 | ":{
"My Field Name 1.1":"field Value 1",
"My Field Name 1.2":"field Value 2"
},
" | My Group Name 2 | ":{
"My Field Name 2.1":"field Value 1",
"My Field Name 2.2":"field Value 2"
}
}
}
- CRM Event Booking
{
"Id":1442,
"Form":"form_alias",
"Email":"test@test.com",
"ModuleItem":123,
"Allocation":1,
"FormField":{
" | My Field Name 1":"field Value 1",
" | My Field Name 2":"field Value 2"
},
"CrmGroup":{
" | My Group Name 1 | ":{
"My Field Name 1.1":"field Value 1",
"My Field Name 1.2":"field Value 2"
},
" | My Group Name 2 | ":{
"My Field Name 2.1":"field Value 1",
"My Field Name 2.2":"field Value 2"
}
}
}
- Order
{
"Id":1442,
"Email":"test@test.com",
"OrderName":"Checkout",
"Status":"Paid",
"InvoiceNumber":"1234",
"InvoiceDate":"2022-01-01T13:34:44",
"AWBNumber":"",
"TrackingURL":"",
"ShippingAddress":"",
"ShippingCity":"",
"ShippingState":"",
"ShippingZip":"",
"ShippingCountry":"",
"CrmGroup":{
" | My Group Name 1 | ":{
"My Field Name 1.1":"field Value 1",
"My Field Name 1.2":"field Value 2"
},
" | My Group Name 2 | ":{
"My Field Name 2.1":"field Value 1",
"My Field Name 2.2":"field Value 2"
}
},
"PaymentType":"CreditCard",
"FormId":13,
"MemberId":47,
"CaseId":89,
"AmountPending":"0.0000",
"AmountPaid":"10.0500",
"PaymentIntentId":"XXXXXXXXXXXXXX",
"PaymentIntentClientSecret":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"FormatSetting":{
"Name":"AU",
"Culture":"en-AU",
"DecimalsQuantity":2,
"Currency":{
"Code":"AUD",
"Symbol":"$",
"DigitalCode":"36",
"Name":"Australian Dollar"
}
},
"DomainCountry":{
"Name":"AUSTRALIA",
"Code":"AU"
},
"DestinationCountry":{
"Name":"AUSTRALIA",
"Code":"AU"
},
"ShippingOption":{
"Id":"12252410371037462605",
"ShippingOptionId":"7361027874612052004",
"Name":"AustraliaPost - Parcel Post",
"Price":8.1364,
"TaxPercent":10,
"TaxRate":0.1,
"TaxPrice":0.81,
"TotalPrice":8.95,
"SubTotalPrice":8.14
},
"Discount":{
"Id":null,
"Code":null,
"Type":null,
"Amount":0
},
"GiftVoucher":{
"Id":null,
"Code":null,
"Amount":0,
"Balance":0
},
"SubTotalPrice":"1.0000",
"TaxPercent":"10.0000",
"TaxRate":"0.1000",
"TaxPrice":"0.9100",
"DiscountPrice":"0",
"TotalPrice":"10.0500",
"ShippingPrice":"8.1364",
"ShippingTaxRate":"0.1000",
"ShippingTaxPrice":"0.81",
"ShippingSubTotalPrice":"8.14",
"ShippingTotalPrice":"8.95",
"GiftVoucherPrice":"0",
"SubTotalTaxPrice":"0.1000",
"DiscountedSubTotalTaxPrice":"0.1000",
"GrandTotalPrice":"1.1000",
"TotalPriceExcludingTax":"9.1400",
"TotalPriceExcludingTaxAndGiftVoucherAmount":"9.1364",
"TaxCode":"GST",
"Items":[
{
"Id":"15049017874163171386",
"EcommerceItemId":2139,
"SmallImage":null,
"Name":"product 1",
"Type":"ModuleItem",
"ModuleId":0,
"SKUCode":"39207d4d-c9c0-4a9d-a435-f2c8f8778e68/Size/Large",
"Quantity":1,
"ProductFileLink":null,
"URL":"/shop/product1",
"TaxCode":"GST",
"OnSalse":false,
"Price":0,
"TaxPercent":10,
"UnitPrice":1,
"TaxPrice":0.1,
"UnitTotalPrice":1.1,
"TotalPrice":1.1,
"UnitTaxPrice":0.1,
"TaxRate":0.1,
"TotalPriceExcludingTax":1,
"UnitRecommendedPrice":0,
"UnitRecommendedTaxPrice":0,
"UnitRecommendedTotalPrice":0,
"AttributesString":"Size: Large; Color: Green,Yellow",
"Attributes":{
"Size":[
"Large"
],
"Color":[
"Green",
"Yellow"
]
}
},
{
"Id":"435",
"EcommerceItemId":3453,
"SmallImage":null,
"Name":"product 2",
"Type":"ModuleItem",
"ModuleId":0,
"SKUCode":"39207d4d-c9c0-4a9d-a435-f2c8f8778e68/Size/Large",
"Quantity":1,
"ProductFileLink":null,
"URL":"/shop/product1",
"TaxCode":"GST",
"OnSalse":false,
"Price":0,
"TaxPercent":10,
"UnitPrice":1,
"TaxPrice":0.1,
"UnitTotalPrice":1.1,
"TotalPrice":1.1,
"UnitTaxPrice":0.1,
"TaxRate":0.1,
"TotalPriceExcludingTax":1,
"UnitRecommendedPrice":0,
"UnitRecommendedTaxPrice":0,
"UnitRecommendedTotalPrice":0,
"AttributesString":"Color: Red",
"Attributes":{
"Color":[
"Red"
]
}
}
]
}
- Gift Voucher
{
"Id":27729,
"OrderId":27725,
"Balance":15.04,
"Country/Currency":"US/USD",
"Country":"US",
"Currency":"USD",
"Name":"GV000001",
"Amount":34.04,
"Enabled":true,
"Type":"ViaShop",
"RecipientName":"test 1",
"RecipientEmail":"receiver1@test.test",
"RecipientMessage":"svssv"
}
- Workflow
{
"Id":27877,
"Name":"Custom Workflow name",
"FromEmail":"sender@test.test",
"FromName":"sender@test.test",
"Recipients":[
"receiver1@test.test",
"receiver2@test.test"
],
"EmailSubject":"Workflow Email Subject",
"EmailBody":"Workflow Email Body"
}
- Comment
{
"Id":27877,
"ModuleItemId":6212,
"ParentId":null,
"ThreadId":27877,
"Rating":60,
"Comment":"test3",
"DateAdded":"2021-12-01T04:13:48.620183",
"AuthorId":24071,
"AuthorFirstName":"Jhon",
"AuthorLastName":"Doe",
"AuthorEmail":"testauthor@test.test",
"AuthorIsAdmin":false
}
Public Triggers (should be performed by Treepl once appropriate action is made in the CMS):
- New Module Item
- Module [dropdown (multiple)]
- Update Module Item
- Module [dropdown (multiple)]
- New CRM Member
- Updated CRM Member
- New CRM Form Submission
- Form Name [dropdown (multiple)]
- Updated CRM Form Submission
- Form Name [dropdown (multiple)]
- New CRM Event Booking
- Form Name [dropdown (multiple)]
- Updated CRM Event Booking
- Form Name [dropdown (multiple)]
- New Order
- Updated Order
- New Gift Voucher
- Updated Gift Voucher
- Triggered Workflow
- Workflow [dropdown (multiple)]
- New Comment
- Module [dropdown (multiple)]
- Updated Comment
- Module [dropdown (multiple)]
4) Actions
Once module item created/updated
- add rollback with new source "Zapier"
Dropdowns in zapier forms
- Secure Zone
- Value: SecureZoneId
- Display Name: SecureZoneName
- Country
- Value: CountryCode
- Display Name: CountryName
- Form
- Value: FormAlias
- Display Name: FormName
- Module
- Value: ModuleId
- Display Name: ModuleName
- ModuleItem
- Value: ModuleItemId
- Display Name: ModuleItemName
- ContactCRMType
- Value: TypeName (Consumer/Wholesaler)
- Display Name: TypeName (Consumer/Wholesaler)
- CRMRecord property
- Value: Email
- Display Name: Email
- Datasource property
- Value: ModuleItemId
- Display Name: ModuleItemName
- Tags property
- Value: TagName
- Display Name: TagName
- Categories property
- Value: CategoryFullName
- Display Name: CategoryFullName
- Template property
- Value: TemplateId
- Display Name: TemplateName
- Detail layout property
- Value: DetailLayoutId
- Display Name: DetailLayoutName
- Country/Currency
- Value: Country/Currency string
- Display Name: Country/Currency string
- Order Status
- Value: OrderStatusName
- Display Name: OrderStatusName
- Parents
- Value: -1 or ModuleItemId
- Display Name: / or Module Item Url
- Workflow
- Value: WorkflowId
- Display Name: WorkflowName
- Recurring Type
- Value: RecurringTypeName
- Display Name: RecurringTypeName
Public Actions (allows to create or edit items in Treepl performed by Zapier):
- Create Module Item
- Update Module Item
- Module [dropdown REQUIRED]
- Item Name [string REQUIRED]
- URL Slug [string]
- Description [string (multiline)]
- System Fields (dynamic list of property names)
Add an info block with the name of the group of fields (before listing of fields)
- Parents [dropdown (or dropdown multiple)]
- list of parent module items
- Template [dropdown]
- Detail Layout [dropdown]
- Enabled [boolean]
- Disable from site search [boolean]
- Release Date [date]
- Expiry Date [date]
- Weighting [string]
- Site Search Keywords [string]
- Added by [string]
- value is email
- if not found in CRM - skip this value
- Secure Zones [dropdown]
- list of secure zones
- adds an item to secure zones
- Tags [dropdown]
- Categories [dropdown]
- flat list of categories (labels are path-like: "/category/subcategory")
- Author [dropdown]
- Event Fields (dynamic list of property names).
Show these fields only if the selected module has "Enable bookings == true" in (Module details => advanced settings).
Add an info block with the name of the group of fields (before listing of fields).
- Hide When Full [boolean]
- Allow Multiple Bookings Per Email [boolean]
- Capacity [number]
- Event Date Start [date]
- Event Date End [date]
- Product Fields (dynamic list of property names).
Show these fields only if the selected module is Product. Add an info block with the name of the group of fields (before listing of fields)
- Small Image [string]
- Large Image [string]
- On Sale [boolean]
- Is Gift Voucher [boolean]
- Product Weight [number]
- Product Width [number]
- Product Height [number]
- Product Depth [number]
- Enable Drop Shipping [boolean]
- Unit Type [string]
- Minimum Units [number]
- Maximum Units [number]
- Recurring Type [dropdown]
- Is Shippable [boolean]
- Is Downloadable [boolean]
- Number Of Possible Downloads [number]
- Supplier [string]
- Custom fields (dynamic list of property names).
Each Zapier field should have the same type as the module property. Add an info block with the name of the group of fields (before listing of fields)
- Create CRM Member
- Update CRM Member
- First Name
- Last Name
- Email [REQUIRED]
- Address
- City
- State
- Zip
- Country [dropdown]
- Site
- Phone
- Status
- Notes
- Type [dropdown]
- Billing Address
- Billing City
- Billing State
- Billing Zip
- Billing Country [dropdown]
- Advanced Fields (dynamic list of property names).
Each Zapier field should have the same type as advanced CRM group property. For each advanced CRM group add an info block with the Advanced CRM Group name - https://prnt.sc/kdChsqRILvXT
- Create CRM Form Submission
- Update CRM Form Submission
- Id [REQUIRED - for update form only]
- Email [REQUIRED - for update form only]
- Form Name [dropdown REQUIRED - for create form only]
- Form Fields (dynamic list of property names).
List of all system and custom form fields. Add an info block with the name of the group of fields (before listing of fields)
- Advanced Fields (dynamic list of property names).
Each Zapier field should have the same type as advanced CRM group property. For each advanced CRM group add an info block with the Advanced CRM Group name - https://prnt.sc/kdChsqRILvXT
- Create CRM Event Booking
- Update CRM Event Booking
- Id [REQUIRED - for update form only]
- Email [REQUIRED - for update form only]
- Form Name [dropdown REQUIRED - for create form only]
- Module [dropdown REQUIRED - for create form only]
- list of modules that have Enable Booking = true
- Module Item [dropdown REQUIRED - for create form only]
- Allocation [number (default = 1)]
- Form Fields (dynamic list of property names).
List of all system and custom form fields. Add an info block with the name of the group of fields (before listing of fields)
- Advanced Fields (dynamic list of property names).
Each Zapier field should have the same type as advanced CRM group property. For each advanced CRM group add an info block with the Advanced CRM Group name - https://prnt.sc/kdChsqRILvXT
- Update Order Details
Base information update only
- Id [REQUIRED - for update form only]
- Order Details (group of fields listing all system order fields)
- Order Name [REQUIRED]
- Status [dropdown]
- Invoice Number
- Invoice Date
- AWB Number
- Tracking URL
- Shipping Address
- Shipping City
- Shipping State
- Shipping Zip
- Shipping Country [dropdown]
- Order Details…
Add an info block with the name of the group of fields (before listing of fields)
- Advanced Fields (dynamic list of property names).
Each Zapier field should have the same type as advanced CRM group property. For each advanced CRM group add an info block with the Advanced CRM Group name - https://prnt.sc/kdChsqRILvXT
- Create Gift Voucher
- Update Gift Voucher
- Id [REQUIRED - for update form only]
- Name [string]
- Recipient Name [string]
- Recipient Email [string (email) REQUIRED]
- Recipient Message [string (multiline)]
- Country/Currency [dropdown]
- list of Country/Currency pairs available for the site
- Amount [number]
- Enabled [boolean]
- Create Comment
- Update Comment
- Id [REQUIRED - for update form only]
- Module Item Id
- Thread Id
- Parent Id
- First Name
- Last Name
- Email [REQUIRED]
- Rating
- Comment
5) Searches
Public Searches Form:
- Find Module Item
- Id
- Module [dropdown]
- Item Name [string]
- URL Slug [string]
- Description [string (multiline)]
- System Fields (dynamic list of property names).
Add an info block with the name of the group of fields (before listing of fields).
- Parents [dropdown (or dropdown multiple)]
- list of parent module items
- Release Date [date]
- Expiry Date [date]
- Weighting [string]
- Added by [string]
- value is email
- if not found in CRM - skip this value
- Tags [dropdown]
- Categories [dropdown]
- flat list of categories (labels are path-like: "/category/subcategory")
- Author [dropdown]
- Event Fields (dynamic list of property names).
Show these fields only if selected module has Enable bookings == true in (Module details => advanced settings). Add an info block with the name of the group of fields (before listing of fields)
- Capacity [number]
- Event Date Start [date]
- Event Date End [date]
- Product Fields (dynamic list of property names).
Show these fields only if the selected module is Product. Add an info block with the name of the group of fields (before listing of fields)
- Small Image [string]
- Large Image [string]
- On Sale [boolean]
- Is Gift Voucher [boolean]
- Product Weight [number]
- Product Width [number]
- Product Height [number]
- Product Depth [number]
- Enable Drop Shipping [boolean]
- Unit Type [string]
- Minimum Units [number]
- Maximum Units [number]
- Recurring Type [dropdown]
- Is Shippable [boolean]
- Is Downloadable [boolean]
- Number Of Possible Downloads [number]
- Supplier [string]
- Custom fields (dynamic list of property names).
Each Zapier field should have the same type as the module property. Add an info block with the name of the group of fields (before listing of fields)
- Find CRM Member
- Id
- First name
- Last Name
- Email
- Address
- City
- State
- Zip
- Country [dropdown]
- Site
- Phone
- Status
- Notes
- Type [dropdown]
- Billing Address
- Billing City
- Billing State
- Billing Zip
- Billing Country [dropdown]
- Find CRM Form Submission
- Id
- Form Name [dropdown]
- Email
- Find CRM Event Booking
- Id
- Form Name [dropdown]
- Email
- Find Order
- Id
- Email
- Order Name
- Status [dropdown]
- Invoice Number
- Invoice Date
- AWB Number
- Tracking URL
- Shipping Address
- Shipping City
- Shipping State
- Shipping Zip
- Shipping Country [dropdown]
- Find Gift Voucher
- Id
- Name [string]
- Recipient Name
- Recipient Email
- Recipient Message [string (multiline)]
- Country/Currency [dropdown]
- list of Country/Currency pairs available for the site
- Amount [number]
- Find Comment
- Id
- Module Item Id
- Email
- Rating
- Comment
- Find Workflow
6) Restrictions
Do not allow to process triggers, actions and searches if zapier extension is disabled for the site
|