This guide walks you through the initial setup needed to use the GraphQL methodology for syncing data using the Tinx connector. After this initial setup, which is required for all integrations, it shows configuration examples such as order import and product synchronization.
Shopify's GraphQL API allows the Tinx Connector to retrieve complex data structures more efficiently than traditional REST calls. This means faster synchronization between your Shopify store and Business Central, with less network overhead.
The instructions below will guide you through setting up GraphQL integration in your Tinx Connector for optimal performance.
Prerequisites:
- Latest version of the Tinx app from AppSource.
- Admin access (SUPER rights) to create integrations and sales channels.
- 'TINX E-Com Admin' role selected for your BC user account.
General GraphQL Setup
Here are the steps you need to take to initialize GraphQL for your Shopify connector:
- Navigate to Setup > Feature Management. Enable GraphQL.
- Navigate to Integration -> Sales Channel > New > Webshop Connectors. Then select the SHOPIFY line and click on New > Create Sales Channel.
- Next, go back to the main screen, go to Integration > Integrations, and click New.
- Ensure the GraphQL Endpoint ends with
/admin/api/2025-XX/graphql.json. In this case, XX depends on the API version you install in the next step. Make sure the version matches. In this case, it is2025-01.On the same screen, create a new Authentication code. Add Username and Password with Basic authentication. - On the same page, in the ribbon, go to Integration > Integration > API > Install API Version. Select the most recent version (2025-01 in this example), then select Yes. Once you are done, review the queries to make sure everything is set up correctly. You can do this by going to Integration > GraphQL > GraphQL Queries in the ribbon.
- Now you can fill in the Sales Channel details. Enter the same authentication details you created in the Authentication code. In the Sales Channel page, enter the same details as before (user, password, and endpoint
/admin/api/2025-01/graphql.json. - Add the GraphQL Endpoint. You can copy this from step 2.
- Ensure the code units for the inbound and outbound on the card page are filled in. Last section on the page > Processing request and response. Select the code unit in the dropdown. There should only be one.
Now we are done with the Basic setup!
Examples: Order Download and Product Export
Step 1: Create Dashboard
- Create a new Dashboard to contain messages.
- Example names:
GRAPH_PROD_OUTorORDER_IN.
- Example names:
- Dashboard Configuration:
- Integration Code: Shopify.
- API Type: GraphQL.
- Direction: Inbound.
- Populate all required details (reference other environments for examples).
Step 2: Create Your First Message
- In the Dashboard, create a new message starting with
GQL-###. - Message Configuration:
- GraphQL Query Type:
- Mutation: For POST, PUT, PATCH operations.
- Query: For GET operations.
- For Items: GraphQL Query name must be "Productset".
- GraphQL Query Type:
Step 3: Configure Table Mappings
Table Setup
- Go to the Dashboard for your message.
- Add tables for data processing:
- Step 1: Enter the table number.
- Click the Element Name field to access the GraphQL selection menu.
- For Orders: Select "Orders.Nodes".
- For Products: Select "Input".
Field Mapping
- Step 2: Map fields in the Definition section.
- Select the appropriate field (Entity ID for orders, Tinx ID for products).
- Click the Webshop field v2 column to see available options.
- Example: Select "Name" for Order ID.
- For Products: This will show Input options (verify selection).
- Field Configuration:
- Go to Message line field → Field → Setup.
- Check the GID checkbox (for identifiers like ID only).
Step 4: Add Additional Mappings (optional)
Repeat the Step 7 process to add more table and field mappings as needed.
Step 5: Configure Request Parameters for Orders (Inbound Messages only)
Basic Parameter Setup
- Navigate to the message line and select Request Parameters.
- Click the dash in the GraphQL Argument column.
- Select required arguments from the window.
Configure Specific Parameters
- "after" parameter:
- Argument Type: Text.
- Click "after" to add to the GraphQL Argument list.
- "first" parameter:
- Argument Type: Integer.
- Error Correction: Use Setup in the ribbon to change argument types if needed.
Advanced Configuration: Line Items
To download Line Items within Orders (going deeper into Orders parent):
- Click the dots (⋯) on the right side in the GraphQL Argument Selector.
- On the "first" line:
- Select type: Integer.
- Click "first" to add to list.
Complete Orders Configuration
Set up the following parameters for order processing:
- after: Text
- first: Integer
- orders:
- reverse: Boolean
Pro Tip for Existing Environments:
- Set reverse = True to download from the latest orders.
- Example: If ID 6750 is the latest, the system downloads IDs 6701-6750.
- After the initial download, edit the second line with ID 6750.
- The system will auto-update the ID after each order download.
Need help? Contact our support team with your specific integration requirements.
Related to