Actions

Fetch Product Variables

You may want to add a way to search your variants to the frontend. An endpoint has been set up so you can query this via JavaScript.

Usage

SITEURL/!/shopify/variants/{product}?option1=VALUE&option2=VALUE&option3=VALUE
OptionDescriptionRequired
productProduct slug as stored in StatamicY
option1Value to search option1 forN
option2Value to search option2 forN
option3Value to search option3 forN

Returned Data

[{
  title: 'Example Title',
  storefront_id: '1234',
  price: '10.00',
  inventory_quantity: 10
}]

Create a Customer Address

If you want to create a Shopify Address for a customer you can POST to

Usage

SITEURL/!/shopify/address
ParametersDescriptionRequired
customer_idcustomer_id in Shopify. Defaults to the logged in user's customer_idN
first_nameAddress first nameY
last_nameAddress last nameY
companyAddress companyN
address1Address line 1Y
address2Address line 2N
cityAddress cityY
provinceAddress province / stateY
zipAddress zip / postal codeY
countryAddress country nameN
country_codeAddress country code (length 2)N
phoneAddress phone numberN
nameName or identifier for the addressN
defaultMake this the default address (boolean)N

Returned Data

[{
  message: 'Address created',
  address: {...}
}]

Update a Customer Address

If you want to create a Shopify Address for a customer you can POST to

Usage

SITEURL/!/shopify/address/{id}
ParametersDescriptionRequired
customer_idcustomer_id in Shopify. Defaults to the logged in user's customer_idN
first_nameAddress first nameY
last_nameAddress last nameY
companyAddress companyN
address1Address line 1Y
address2Address line 2N
cityAddress cityY
provinceAddress province / stateY
zipAddress zip / postal codeY
countryAddress country nameN
country_codeAddress country code (length 2)N
phoneAddress phone numberN
nameName or identifier for the addressN
defaultMake this the default address (boolean)N

Returned Data

[{
  message: 'Address updated',
  address: {...}
}]

Delete a Customer Address

If you want to delete a Shopify Address for a customer you can send a DELETE request to

Usage

SITEURL/!/shopify/address/{id}
ParametersDescriptionRequired
customer_idcustomer_id in Shopify. Defaults to the logged in user's customer_idN

Returned Data

[{
  message: 'Address deleted',
}]
Edit this page on GitHub Updated at Mon, Oct 23, 2023