Module shopify.admin

ballerinax/shopify.admin Ballerina library

3.0.0

Overview

Shopify is a leading e-commerce platform that enables users to create, manage, and grow their online stores, offering secure transactions, inventory management, and seamless integrations.

The Ballerina Shopify admin connector allows developers to interact with the Shopify Admin REST APIs. It provides an easy-to-use interface for managing products, orders, customers, and other essential e-commerce functionalities. The module supports Shopify API versions up to the 2026-01 release.

Setup guide

Follow these steps to generate an access token for Shopify Admin APIs using the Ballerina Shopify connector.

1. Sign up for a Shopify developer account

  1. Create a Shopify account via the Shopify signup portal.

    Signup

  2. Join the Shopify partner program to access development tools.

    Partner program

2. Create a new organization

New organization

In the Shopify partner dashboard, you can either connect to an existing organization or create a new one. If you don’t already have an organization, follow these steps to create one.

  1. Follow the on-screen instructions and provide the necessary details.

    Main focus

  2. Provide business contact details and finalize the setup.

    Business contact info

3. Create a development store

  1. In the Shopify partner dashboard, select Stores section from the left navigation panel.

    Stores

  2. Then you will be redirected to Developer Dashboard. Select Create store to proceed.

    Create Store

  3. Complete the store setup by following the instructions. You can customize store settings as needed.

    Store Configurations

4. Create a new app

To start developing on your store, you need to create an app.

  1. In the home page of the new store, select Settings at the bottom.

    Settings

  2. Then proceed to the Apps section, and select Develop apps.

    Develop Apps

  3. Select Allow custom app development.

    Develop apps

  4. Click Create an app, enter an app name, and confirm.

    Create app

5. Generate an access token

  1. Once the app is created, select Configure Admin API scopes and apply the necessary scopes for your REST APIs.

    Configure API scopes

  2. Click Install app to generate an Admin API access token.

    Add access token

  3. Click Reveal token once to copy and save the token securely. This token will be required for authentication when using the Ballerina Shopify connector.

    Reveal token

Your development store is now ready, and you can integrate it with Shopify using the Ballerina Shopify connector.

Quickstart

To use the Shopify connector in your Ballerina project, modify the .bal file as follows.

Step 1: Import the module

Import the ballerinax/shopify.admin module into your Ballerina project.

Copy
import ballerinax/shopify.admin as shopadmin;

Step 2: Instantiate a new connector

Create a shopadmin:Client instance with necessary configurations.

Copy
configurable string xShopifyAccessToken = ?;
configurable string serviceUrl = ?;

shopadmin:Client shopify = check new (
   {
      xShopifyAccessToken
   },
   serviceUrl
);

Step 3: Invoke the connector operation

You can now utilize the operations available within the connector.

Copy
public function main() returns error? {
   shopadmin:CustomerResponse result = check shopify->createACustomer({
      customer: {
         firstName: "John",
         lastName: "Doe",
         email: "john.doe@example.com"
      }
   });
}

Step 4: Run the Ballerina application

Use the following command to compile and run the Ballerina program.

Copy
bal run

Examples

The ballerinax/shopify.admin connector provides practical examples illustrating usage in various scenarios.

  1. Create new order : This is a guide to use the Shopify connector to connect to a Shopify store, register a customer, and place an order.

Import

import ballerinax/shopify.admin;Copy

Other versions

See more...

Metadata

Released date: about 2 months ago

Version: 3.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.13.0

GraalVM compatible: Yes


Pull count

Total: 2896

Current verison: 8


Weekly downloads


Source repository


Keywords

Shopify

E-Commerce

Admin

Vendor/Shopify

Area/E-Commerce

Type/Connector


Contributors