-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shopify to square connector template (#358)
* Update template-metadata.json * Create Create a customer in square when a customer created in shopify.yaml * Create Create a customer in square when a customer created in shopify_instructions.md * Update and rename Create a customer in square when a customer created in shopify.yaml to Create a customer in Square when a customer is created in Shopify.yaml correction * Update and rename Create a customer in square when a customer created in shopify_instructions.md to Create a customer in Square when a customer is created in Shopify_instructions.md corrections * Update template-metadata.json corrections --------- Co-authored-by: Deepak Ayilliath <[email protected]>
- Loading branch information
1 parent
79e6005
commit d16ec32
Showing
3 changed files
with
208 additions
and
1 deletion.
There are no files selected for viewing
188 changes: 188 additions & 0 deletions
188
resources/Create a customer in Square when a customer is created in Shopify.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
$integration: http://ibm.com/appconnect/integration/v2/integrationFile | ||
integration: | ||
type: api | ||
trigger-interfaces: | ||
trigger-interface-1: | ||
triggers: | ||
createCustomer: | ||
assembly: | ||
$ref: '#/integration/assemblies/assembly-1' | ||
input-context: | ||
data: Customer | ||
output-context: | ||
data: Customer | ||
retrieveCustomer: | ||
assembly: | ||
$ref: '#/integration/assemblies/assembly-2' | ||
input-context: | ||
data: Customer | ||
output-context: | ||
data: Customer | ||
options: | ||
resources: | ||
- business-object: Customer | ||
model: | ||
$ref: '#/models/Customer' | ||
triggers: | ||
create: createCustomer | ||
retrieve: retrieveCustomer | ||
type: api-trigger | ||
action-interfaces: | ||
action-interface-1: | ||
type: api-action | ||
business-object: customer | ||
connector-type: shopify | ||
actions: | ||
CREATE: {} | ||
action-interface-2: | ||
type: api-action | ||
business-object: customer | ||
connector-type: shopify | ||
actions: | ||
RETRIEVEALL: {} | ||
action-interface-3: | ||
type: api-action | ||
business-object: customers | ||
connector-type: square | ||
actions: | ||
CREATE: {} | ||
assemblies: | ||
assembly-1: | ||
assembly: | ||
execute: | ||
- create-action: | ||
name: Shopify Create customer | ||
target: | ||
$ref: '#/integration/action-interfaces/action-interface-1' | ||
map: | ||
mappings: | ||
- email: | ||
template: '{{$Request.email}}' | ||
- first_name: | ||
template: '{{$Request.first_name}}' | ||
$map: http://ibm.com/appconnect/map/v1 | ||
input: | ||
- variable: Request | ||
$ref: '#/trigger/payload' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
- response: | ||
name: response-1 | ||
reply-maps: | ||
- title: Customer successfully created | ||
status-code: '200' | ||
map: | ||
$map: http://ibm.com/appconnect/map/v1 | ||
input: | ||
- variable: Request | ||
$ref: '#/trigger/payload' | ||
- variable: ShopifyCreatecustomer | ||
$ref: '#/node-output/Shopify Create customer/response/payload' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
mappings: | ||
- id: | ||
expression: '$ShopifyCreatecustomer.id ' | ||
input: | ||
- variable: Request | ||
$ref: '#/trigger/payload' | ||
- variable: ShopifyCreatecustomer | ||
$ref: '#/node-output/Shopify Create customer/response/payload' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
assembly-2: | ||
assembly: | ||
execute: | ||
- retrieve-action: | ||
name: Shopify Retrieve customers | ||
target: | ||
$ref: '#/integration/action-interfaces/action-interface-2' | ||
filter: | ||
where: | ||
id: '{{$api.id}}' | ||
input: | ||
- variable: api | ||
$ref: '#/trigger/api/parameters' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
limit: 10 | ||
allow-truncation: true | ||
pagination-type: TOKEN | ||
allow-empty-output: false | ||
- create-action: | ||
name: Square Create customer | ||
target: | ||
$ref: '#/integration/action-interfaces/action-interface-3' | ||
map: | ||
mappings: | ||
- email_address: | ||
template: '{{$ShopifyRetrievecustomers.email}}' | ||
- given_name: | ||
template: '{{$ShopifyRetrievecustomers.first_name}}' | ||
$map: http://ibm.com/appconnect/map/v1 | ||
input: | ||
- variable: api | ||
$ref: '#/trigger/api/parameters' | ||
- variable: ShopifyRetrievecustomers | ||
$ref: '#/node-output/Shopify Retrieve customers/response/payload' | ||
- variable: ShopifyRetrievecustomersMetadata | ||
$ref: '#/node-output/Shopify Retrieve customers/response' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
- response: | ||
name: response-1 | ||
reply-maps: | ||
- title: Customer successfully retrieved | ||
status-code: '$ShopifyRetrievecustomersMetadata."status-code" ' | ||
map: | ||
$map: http://ibm.com/appconnect/map/v1 | ||
input: | ||
- variable: api | ||
$ref: '#/trigger/api/parameters' | ||
- variable: ShopifyRetrievecustomers | ||
$ref: >- | ||
#/node-output/Shopify Retrieve | ||
customers/response/payload | ||
- variable: ShopifyRetrievecustomersMetadata | ||
$ref: '#/node-output/Shopify Retrieve customers/response' | ||
- variable: SquareCreatecustomer | ||
$ref: '#/node-output/Square Create customer/response/payload' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
mappings: | ||
- id: | ||
expression: '$SquareCreatecustomer.customer_id ' | ||
input: | ||
- variable: api | ||
$ref: '#/trigger/api/parameters' | ||
- variable: ShopifyRetrievecustomers | ||
$ref: >- | ||
#/node-output/Shopify Retrieve | ||
customers/response/payload | ||
- variable: ShopifyRetrievecustomersMetadata | ||
$ref: '#/node-output/Shopify Retrieve customers/response' | ||
- variable: flowDetails | ||
$ref: '#/flowDetails' | ||
name: Create a customer in Square when a customer is created in Shopify | ||
models: | ||
Customer: | ||
name: Customer | ||
properties: | ||
first_name: | ||
required: false | ||
id: false | ||
type: string | ||
id: | ||
required: false | ||
id: true | ||
type: number | ||
email: | ||
required: false | ||
id: false | ||
type: string | ||
plural: Customer | ||
description: ' ' | ||
operations: | ||
create: '#/integration/assemblies/assembly-1' | ||
retrieve: '#/integration/assemblies/assembly-2' | ||
methods: {} |
10 changes: 10 additions & 0 deletions
10
...eate a customer in Square when a customer is created in Shopify_instructions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
To refer to these instructions while editing the flow, open [the GitHub page](https://github.com/ot4i/app-connect-templates/blob/master/resources/markdown/Create%20a%20customer%20in%20Square%20when%20a%20customer%20is%20created%20in%20Shopify_instructions.md) (opens in a new window). | ||
|
||
1. Click **Create flow** to start using the template. | ||
1. Click **Operations**, then click **Edit flow** to edit the operations. | ||
1. Click on the Shopify node, and if you're not already connected, connect to your [Shopify account](https://ibm.biz/acshopify). | ||
1. Click on the Square node, and if you're not already connected, connect to your [Square account](https://ibm.biz/acsquare). | ||
1. Click **Done**. | ||
1. To start the flow, in the banner click **Start flow**. | ||
|
||
For more information about this flow, see the tutorial [Creating flows for an API](https://www.ibm.com/docs/en/app-connect/saas?topic=designer-introduction-creating-flows-api-part-1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters