ShopBase Developers
  • Getting started
  • Build An App
    • Making your first request
      • Authentication
        • Public apps
        • Private apps
        • OAuth
        • API access scopes
      • Rest API References
        • Rate limits
      • Using webhooks
        • Webhook events and topics
      • Response status codes
    • How to submit an app to ShopBase App Store
    • Getting your app approved
      • App requirements
      • Testing your app
      • Submitting your app
      • The review process
  • BUILD A THEME
    • Getting started building themes
    • Theme development resources
      • Connect to your store & start developing
      • Theme structure
      • Theme object, methods, and props
      • Theme editor
        • How to update configure for theme editor
    • How to submit a theme to ShopBase Theme Store
    • Storefront SDK
  • Test and Debug app
    • Debug apps with Postman
  • Tutorial
    • Manage orders and shipping
      • Manage orders with the REST Admin API
        • Transaction
        • Order
      • Edit an existing order with the Admin API
      • Manage fulfillments with Fulfillment and FulfillmentService resources
      • Get a country field using Admin API
  • Integrate a payment gateway
    • How to create your payment gateway on ShopBase
    • Technical Specifications
Powered by GitBook
On this page

Was this helpful?

  1. Build An App
  2. Making your first request

Rest API References

The REST Admin API lets you build apps and other integrations for the ShopBase admin.

PreviousAPI access scopesNextRate limits

Last updated 4 years ago

Was this helpful?

For full details of our Admin Rest API, please visit

Frequent Asked API Questions

Product API

Create a Product

Create a simple product:

POST: /admin/products.json
{
   "product": {
   	"title": "Simple product title"
   }
}

Create a product with multiple product variants and multiple options:

POST: /admin/products.json
{
    "product": {
        "title": "Simple product title",
        "variants": [
            {
                "option1": "Black",
                "option2": "Small",
                "price": "19.99",
                "sku": "sku-189234-123-12-1",
                "compare_at_price": "21.99"
            },
            {
                "option1": "Red",
                "option2": "Large",
                "price": "19.99",
                "sku": "sku-189234-123-12-2",
                "compare_at_price": "21.99"
            },
            {
                "option1": "Red",
                "option2": "Medium",
                "price": "19.99",
                "sku": "sku-189234-123-12-3",
                "compare_at_price": "21.99"
            }
        ],
        "options": [
            {
                "values": [
                    "Black",
                    "Red",
                    "Purple"
                ],
                "name": "Color"
            },
            {
                "values": [
                    "Small",
                    "Medium",
                    "Large"
                ],
                "name": "Size"
            }
        ],
        "images": [
            {
                "metafields": [],
                "src": "https://example.com/image-src-url-001.jpg",
                "alt": "some-alt-text-01"
            },
            {
                "metafields": [],
                "src": "https://example.com/image-src-url-002.jpg",
                "alt": "some-alt-text-02"
            }
        ]
    }
}

Update Product:

Update product title:

PUT admin/products/${product_id}.json
{
  "product": {
    "id": ${product_id},
    "title": "New product title"
  }
}

Update product by adding new product images:

PUT admin/products/${product_id}.json
{
  "product": {
    "id": ${product_id},
    "images": [
      {
        "src": "https://example.com/new-product-image-001.jpg"
      }
    ]
  }
}

Update product by reordering product images:

PUT admin/products/${product_id}.json
{
  "product": {
    "id": ${product_id},
    "images": [
      {
        "id": ${product_image_id_01},
        "position": 2
      },
      {
        "id": ${product_image_id_02},
        "position": 1
      }
    ]
  }
}

Show/hide product:

# Show product
PUT admin/products/${product_id}.json
{
  "product": {
    "id": ${product_id},
    "published": true
  }
}

# Hide product
PUT admin/products/${product_id}.json
{
  "product": {
    "id": ${product_id},
    "published": false
  }
}

Product variant API

Add a new variant with an image for a product:

POST: /admin/products/${product_id}/variants.json
{
  "variant": {
    "option1": "Purple",
    "option2": "Small",
    "image_id": ${product_image_id},
    "price": "19.99",
    "sku": "sku-189234-123-12-4",
    "compare_at_price": "21.99"
  }
}

Update product variant - Add an existing image to an existing variant:

PUT: /admin/variants/${variant_id}.json
{
  "variant": {
    "id": ${variant_id},
    "image_id": ${product_image_id},
    "product_id": ${productID}
  }
}

Update product variant - Update price:

PUT: /admin/variants/${variant_id}.json
{
  "variant": {
    "id": ${variant_id},
    "price": 3.99,
    "product_id": ${productID}
  }
}

Product image API

Create new product image for a product with image attachment:

POST: /admin/products/${product_id}/images.json
{
  "image": {
    "attachment": "Data endcode Base64 of image",
    "filename": "image.jpg"
  }
}

Create a new product image for a product with an image URL:

POST: /admin/products/${product_id}/images.json
{
  "image": {
    "src": "https://example.com/image.jpg"
  }
}

Create a new product image for a product and make it as the main image:

POST: /admin/products/${product_id}/images.json
{
  "image": {
    "src": "https://example.com/image.jpg",
    "position": 1
  }
}

Create a new product image for a product and assign it for product variants:

POST: /admin/products/${product_id}/images.json
{
  "image": {
    "src": "https://example.com/image.jpg",
    "variant_ids": [
      ${variant_1_id},
      ${variant_2_id}
    ]
  }
}

Update product image: assign it for product variants:

PUT: /admin/products/${product_id}/images/${image_id}.json
{
  "image": {
    "id": ${image_id},
    "variant_ids": [
      ${variant_1_id},
      ${variant_2_id}
    ]
  }
}
ShopBase API Docs