shopbuilder_api v0.1.20 ExSbapi View Source

Elixir Wrapper Around Shopbuilder API

Link to this section Summary

Functions

Returns {:ok,_ } or {:error, %{reason: "unauthorized"}}

This function is expecting list_of_uuid,date, access_token and client

Link to this section Functions

Link to this function add_coupon(code_value, order_id, website_url, access_token, format \\ "json") View Source
Link to this function add_custom_shipping(website_url, access_token, body) View Source
Link to this function add_customer_profile(params) View Source
Link to this function add_customer_profile_to_order(params) View Source
Link to this function add_email(value, order_id, website_url, access_token, format \\ "json") View Source
Link to this function add_payment(value, order_id, website_url, access_token, format \\ "json") View Source
Link to this function add_shipping(value, order_id, website_url, access_token, format \\ "json") View Source
Link to this function authorize_url!(provider, scope, client) View Source

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.

Link to this function check_email(access_token, email, client \\ %{}) View Source
Link to this function delete_custom_shipping(website_url, access_token, method_name) View Source
Link to this function delete_request(arg1, arg2) View Source
Link to this function generate_auto_login_link(user_uuid, destination_url, access_token, client \\ %{}) View Source
Link to this function get_address(user_id, website_url, access_token, format \\ "", option \\ "") View Source
Link to this function get_custom_shipping(website_url, access_token) View Source
Link to this function get_order(order_id, website_url, access_token, format \\ "json") View Source
Link to this function get_payload(your_hash_key, payload, sb_hash, format \\ "") View Source
Link to this function get_payment_options(order_id, website_url, access_token) View Source
Link to this function get_restricted_mode(access_token, client \\ %{}) View Source
Link to this function get_roles(access_token, client \\ %{}) View Source
Link to this function get_sb_countries(website_url, access_token, format \\ "json") View Source
Link to this function get_shipping_options(order_id, website_url, access_token) View Source
Link to this function get_subscribed_emails(access_token, client \\ %{}) View Source
Link to this function get_token!(provider, code, client) View Source
Link to this function list_of_events(access_token, client \\ %{}) View Source
Link to this function order_query(list_of_uuid, date, access_token, client \\ %{}) View Source

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"
  }
}
Link to this function post_request(arg1, arg2) View Source
Link to this function product_redirections(status, access_token, client \\ %{}) View Source
Link to this function redirection_to_product(status, access_token, client) View Source
Link to this function refresh_token(refresh_token, client, params \\ [], headers \\ [], opts \\ []) View Source
Link to this function set_app_settings(website_url, access_token, body) View Source

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."]}}
Link to this function set_restricted_mode(restricted, mode, authorized_roles, access_token, client \\ %{}) View Source
Link to this function subscribe_email(event, endpoint, access_token, client \\ %{}) View Source
Link to this function subscribe_to_event(event, endpoint, access_token, client \\ %{}, object \\ "subscribe") View Source
Link to this function unsubscribe_email(endpoint, access_token, client \\ %{}) View Source
Link to this function unsubscribe_email_all(access_token, client \\ %{}) View Source
Link to this function unsubscribe_from_all_events(access_token, client \\ %{}, object \\ "unsubscribe") View Source
Link to this function unsubscribe_from_event(endpoint, access_token, client \\ %{}, object \\ "unsubscribe") View Source
Link to this function update_custom_shipping(website_url, access_token, body, method_name) View Source