shopbuilder_api v0.1.24 ExSbapi View Source
Elixir Wrapper Around Shopbuilder API
Link to this section Summary
Functions
Creates a product collection to the given website_url
using the provided arguments
Creates a product to the given website_url
with the provided arguments
Creates a product to the given website_url
with a provided product_object
Returns {:ok,_ }
or {:error, %{reason: "unauthorized"}}
Builds a new ExSbapi.Collection
struct using the provided arguments
Builds a new ExSbapi.Product
struct using the provided arguments
Builds a new ExSbapi.ProductVariation
struct using the provided arguments
Fetchs all product collections from the given website_url
Fetchs all product options from the given website_url
Fetchs all products from the given website_url
This function is expecting list_of_uuid
,date
, access_token
and client
Initiates a product bulk operation that can reate, update or delete a set of products (up to 20 products)
in a single requestto the given website_url
Set app settings
Link to this section Functions
Creates a product collection to the given website_url
using the provided arguments.
Arguments
title
- a unique string for the product variation.description
- an interger, quantity of the variationimage
- aExSbapi.Price
structref
- aExSbapi.ProductDimensions
struct
Makes a POST
request to the given website_url
using the OAuth2.AccessToken
.
Creates a product to the given website_url
with the provided arguments.
Arguments
title
- title of the product.variations
- a list ofExSbapi.ProductVariation
structscollections
- a list ofExSbapi.ProductType
structsdescription
- description of the product.status
- “0” or “1”images
- a list of imagesref
- a reference stringlanguage
- language code ex. “en”new
- boolean, to indicate if product is newon_sale
- boolean, to indicate if product is on salesame_price
- boolean, to indicate if all product variations has the same priceprice
- aExSbapi.Price
struct (will apply to all variations)same_weight_dimensions
- boolean, to indicate if all product variations has the same dimensions and weightweight
- aExSbapi.ProductWeight
struct (will apply to all variations)dimensions
- aExSbapi.ProductDimensions
struct (will apply to all variations)suggested_products
- a list of suggested productsseo
- a tupple containing seo fieldstype
- ex. “shop_builder_display”
Makes a POST
request to the given website_url
using the OAuth2.AccessToken
.
Creates a product to the given website_url
with a provided product_object
.
Makes a POST
request to the given website_url
using the OAuth2.AccessToken
.
Returns {:ok,_ }
or {:error, %{reason: "unauthorized"}}
Endpoint:
This function is being called from /lib/RtCheckoutWeb/templates/install/channel.js.eex
by
this.channel.join()
Params:
checkout:checkout_id
, message
, socket
Functionality:
It checks website_id
and order_od
that has been sent from client side
with website_id
and
order_id
that has been verified in user_socket
.
Builds a new ExSbapi.Collection
struct using the provided arguments.
Arguments
title
- a unique string for the product variation.description
- an interger, quantity of the variationimage
- aExSbapi.Price
structref
- aExSbapi.ProductDimensions
struct
Builds a new ExSbapi.Product
struct using the provided arguments.
Arguments
title
- title of the product.variations
- a list ofExSbapi.ProductVariation
structscollections
- a list ofExSbapi.ProductType
structsdescription
- description of the product.status
- “0” or “1”images
- a list of imagesref
- a reference stringlanguage
- language code ex. “en”new
- boolean, to indicate if product is newon_sale
- boolean, to indicate if product is on salesame_price
- boolean, to indicate if all product variations has the same priceprice
- aExSbapi.Price
struct (will apply to all variations)same_weight_dimensions
- boolean, to indicate if all product variations has the same dimensions and weightweight
- aExSbapi.ProductWeight
struct (will apply to all variations)dimensions
- aExSbapi.ProductDimensions
struct (will apply to all variations)suggested_products
- a list of suggested productsseo
- a tupple containing seo fieldstype
- ex. “shop_builder_display”
Builds a new ExSbapi.ProductVariation
struct using the provided arguments.
Arguments
sku
- a unique string for the product variation.stock
- an interger, quantity of the variationprice
- aExSbapi.Price
structdimensions
- aExSbapi.ProductDimensions
structweight
- aExSbapi.ProductWeight
structstatus
- “0” or “1”images
- a list of imagesoptions
- optionsold_price
- aExSbapi.Price
struct
Fetchs all product collections from the given website_url
.
Makes a GET
request to the given website_url
using the OAuth2.AccessToken
Fetchs all product options from the given website_url
.
Makes a GET
request to the given website_url
using the OAuth2.AccessToken
Fetchs all products from the given website_url
.
Makes a GET
request to the given website_url
using the OAuth2.AccessToken
This function is expecting list_of_uuid
,date
, access_token
and client
The format of date should be:
date: %{
start: %{
year: "2018",
month: "4",
day: "12"
},
end: %{
year: "2018",
month: "4",
day: "20"
}
}
Initiates a product bulk operation that can reate, update or delete a set of products (up to 20 products)
in a single requestto the given website_url
.
Makes a POST
request to the given website_url
using the OAuth2.AccessToken
.
Set app settings
Endpoint:
This function is being called from /lib/zaq_web/controllers/auth_controller.ex
by
callback/2
Parameters:
website_url::String
, access_token::String
, body::Map %{scripts: "", html: "", hash_key: ""}
Examples:
iex> set_app_settings(
"http:\merhi.dev.shopbuilder.me",
"01a1f82c447c1ffc19f54a8174ae1b8e648cc864",
%{hash_key: "5tQ4jHbQAqdfjI3cNEqoLAIChw6ZK2BI9tJR9omkzNCAFZS7odwcx+yC5xxTgt47wUg0iaoKuoRyClhU/3+okQ=="}
)
{:ok, %{"success": ["App settings has been updated."]}}