Shopify

Version: 4

Official OneStock connector for Shopify

Documentation

Installation

  • Install the Shopify X OneStock connector directly from the Shopify apps marketplace.
  • Pre-requists
    • Configured OneStock environment
    • OneStock API credentials
    • SFTP for stock synchronization

Proxy routes

OneStock Connector has two app proxy routes: one for delivery promises and one for stock export. App proxies take requests to Shopify links, and redirect them to external links. This allows you to fetch and display data on a merchant's store from an external source. For more information about proxy app, refer to app proxies.

Our app proxies take the content in the payload parameter and overload it with the authentication parameters (token and site_id), allowing a security abstraction that the system integrators don't need to manage using the connector.

Delivery promise

POST /apps/onestock/proxy/delivery_promises

Returns estimates about the delivery of a product or a basket. A list of delivery options may be requested, providing the most detailed information possible about the delivery location. Based on these parameters and configurations, OneStock will estimate the delivery and return this estimate.

To learn more about the payload field, refer to OneStock API documentation

Request example

fetch('/apps/onestock/proxy/delivery_promises', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(
        {
            "payload": {
                "line_items": [
                    {
                        "item_id": "1000000000",
                        "qty": 1
                    }
                ],
                "sales_channel": "sc_1",
                "delivery_options": [
                    {
                        "delivery_method": "ckc",
                        "destination": {
                            "endpoint_id": "store_001"
                        }
                    },
                    {
                        "delivery_method": "SDD",
                        "destination": {
                            "location": {
                                "country": "US",
                                "state": "NY",
                                "zip_code": "11378"
                            }
                        }
                    }
                ],
                "fields": [
                    "delivery_options.delivery_routes",
                    "delivery_options.cost"
                ]
            }
        }
    )
})

Response exemple

{
    "delivery_options": [
        {
            "carbon_footprint": 0,
            "cost": 0,
            "delivery_method": "ckc",
            "destination": {
                "endpoint_id": "store_002"
            },
            "eta_end": 1716200077,
            "eta_start": 1716200077,
            "shipment_number": 0,
            "status": "valid"
        },
        {
            "carbon_footprint": 0,
            "cost": 0,
            "delivery_method": "ckc",
            "destination": {
                "endpoint_id": "store_004"
            },
            "reason": "no_eligible_route",
            "shipment_number": 0,
            "status": "none"
        }
    ]
}

Stock Request

POST /apps/onestock/proxy/stock_export

Stock exports allow fetching a snapshot of stock at the current point in time.

To learn more about the payload field, refer to OneStock API documentation.

Request exemple

fetch('/apps/onestock/proxy/stock_export', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(
        {
            "payload": {
                "aggregates": {
                    "all": {
                        "deduction": {
                            "attributes": [
                                "not_in_stock"
                            ]
                        },
                        "item_filter": {
                            "request_name": "all_ids"
                        },
                        "endpoint_filter": {
                            "request_name": "all_ids"
                        }
                    }
                }
            }
        }
    )
})

Response exemple

{
    "stocks": [
        {
            "item_id": "1000000000",
            "endpoint_id": "store_003",
            "quantity": 22,
            "type": "on_hand"
        },
        {
            "item_id": "1000000000",
            "endpoint_id": "store_001",
            "quantity": 22,
            "type": "on_hand"
        },
        {
            "item_id": "1000000000",
            "endpoint_id": "store_002",
            "quantity": 22,
            "type": "on_hand"
        }
    ]
}

Ecommerce features

Integrated Modules

Delivery promiseE-reservationUnified click and collect

Data Synchronization

ItemsOrdersUnified stocks