Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all 25503 articles
Browse latest View live

Shipping enbedded app by Vico G

$
0
0

Hey guys,

I have an app to show my shipping method that is working without problems, but the staff of Shopify disabled my app from the store for two reasons:

1.- They doesn't want that the owners of the shop need's to complete their installation calling to my company they want that the app will be automated.

2.- The app needs a section to explain how it works inside the app.

So, I find the embedded sdk to solve my problems, but in the documentation not explain how  the files needs to save as.

Can i save as the files with .html extension? the extension is .ejs?

My app is now in php coding.

, this app is not using the embedded app SDK, but the 


Thanachao commented on [iOS SDK BUY 2.0] Error code: domain: @"BUYShopifyErrorDomain" - code: 412

$
0
0

It is my careless mistake how to use xCode editor to see the error detail when debugging......

Here is what I got

UserInfo={errors={
    checkout =     {
        base =         (
                        {
                code = "does_not_require_shipping";
                message = "You don't have any items that require shipping";
                options =                 {
                };
            }

 

Custom product identifier by MaplePost

$
0
0

Good evening,

I am looking for a way of including a custom description of my products for the purposes of shipping. For example, if I have a product title called "Shopify x Paper Jam Press - 24/7 T-Shirt" I would like to be able to name it, say, "men's cotton t-shirt" as the shipping description.

I see in the API that it return the product NAME and product TITLE. For me this returns the product title in both variables. So it seems that I am able to change the product name but I simply cannot find where to specify this.

Could someone shed some light on how to do this, or otherwise, solve this problem?

Thanks!
Aaron from Ottawa

Jordan commented on AJAX API Only sends error with jQuery

$
0
0

Hey Luke,

Good news. The piece of code that honours the inventory uses .xhr? as a condition. This returns true if the “X-Requested-With” header contains “XMLHttpRequest” (case-insensitive), which in your case (using Fetch) will be needed to be added manually.

- Jordan

Wish to use API, bug on Partner Sign-up Page by Chris

$
0
0

Hi, I Wish to use the Shopify API,

However, there is a bug on Partner Sign-up page. 

There is no way to get past the registration form. There is a "confirm password" field missing, so the confirm error always shows.

Pleeeeeease help.

Passing extra query param http://myshopify.com/admin/api/auth?api_key= by Clement

$
0
0

Is it possible to pass extra query params to http://myshopify.com/admin/api/auth?api_key=<api_key> such that they will be forwarded to my app url?

As far as I can see they are not being passed to my app url, but it would be quite handy to be able to pass a redirect parameters in order to bring the user into a specific page right after they install the app (deep linking).

Any ideas?

Adam Schaffer commented on Change Status of Order

$
0
0

Can anyone from shopify help me figure out why the transaction "kind: sale" would respond with "sale is not a valid transaction"?

Here's a sample of my post request:

POSTing to: /admin/orders/3980863237/transactions.json

{
"transaction":{
  "amount":"113.42",
  "kind":"sale",
  "user_id":72,
  "currency":"USD",
  "gateway":"manual"
  }
}

I've tried with and without passing the last 3 fields.

Single call to Order API only returns 49 orders by Brendin

$
0
0

Hi Everyone,

I'm not sure what exactly is happening, but as im trying to make a call through the Order API via created_at_min I am only getting back 49 orders. No matter how much I change the date, I get 49 orders max. Everything seemed to be functioning well as I was testing yesterday, but not anymore. Thinking it had to be an error in my code, Ive dug back though it over and over but cant seem to find any isses. 

So then I decided to see what response I would get if I went directly to the URL in my browser. I followed the format of " https://[API key]:[API pw]@[storename].myshopify.com/admin/orders.json?created_at_min=2016-12-07T00:15:47-08:00 ". Doing so still only gave a JSON response with 49 orders. 

I can't seem to figure out what is going on. Checking the headers shows that I am indeed making only 1 call, so there is no way im hitting the limit. And the call is getting less than 250 orders, so im not hitting that limit either. 

Any input would be great!
Thanks!


Webhook automatically dissappearing from admin portal by Tewell

$
0
0

Hey everyone,

I'm using both order creation and cancellations webhooks to pull into our external web app. It works, and orders are coming through, however, the order creation endpoint that I've provided randomly disappears from the admin/settings/notifications portal. The cancellation enpoint is solid and has not disappeared.

It worked great for a few weeks, then disappeared. No one on our team deleted it.

I readded it, worked great for another week or so.

Then happened a third time yesterday (I noticed this morning and readded it)

Like I said, no one on our team is deleting it. Of this I'm certain.

I will note that, however, we do have two different enpoints for order creation, could this be the issue? Can shopify not handle the same webhook to two different enpoints? I removed the second url, as it was a previous testing endpoint for another app that's not needed anymore. I'm hoping this fixes it, but I'm not sure.

Any insight into this would be great.

Cheers

T

Alexander Dzhus commented on Shopify refund API

$
0
0

Hello, Jordan, here is what I tried and what I got.

1.  

{
  "refund": {
    "restock": true,
    "notify": true,
    "note": "wrong size",
    "transactions": [
      {
        "parent_id": 4672584259,
        "amount": "2.65",
        "kind": "refund",
        "gateway": "bluesnap"
      }
    ]
  }
}

Result: 422 Unprocessable Entity. Message: {"errors":{"base":["Order cannot be refunded"]}}

 

2. (however this product doesn't have shipping )

{
  "refund": {
    "restock": true,
    "notify": true,
    "note": "wrong size",
 "shipping": {
      "full_refund": true
    },

    "transactions": [
      {
        "parent_id": 4672584259,
        "amount": "2.65",
        "kind": "refund",
        "gateway": "bluesnap"
      }
    ]
  }
}

Result: 422 Unprocessable Entity. Message: {"errors":{"base":["Order cannot be refunded"]}}

 

3. (I don't really understand what is refund_line_items  and where can i find its ID, so I took a default from your example )

{
  "refund": {
    "restock": true,
    "notify": true,
    "note": "wrong size",
 "shipping": {
      "full_refund": true
    },
 "refund_line_items": [
      {
        "line_item_id": 518995019,
        "quantity": 1
      }
    ],
    "transactions": [
      {
        "parent_id": 4672584259,
        "amount": "2.65",
        "kind": "refund",
        "gateway": "bluesnap"
      }
    ]
  }
}

Result: 422 Unprocessable Entity. Message: {"errors":{"refund_line_items.line_item":["can't be blank"],"refund_line_items.quantity":["cannot refund more items than were purchased"]}}

Josh Brown commented on Single call to Order API only returns 49 orders

$
0
0

Hey Brendin,

By default that Orders API endpoint can give you a maximum of 50 orders. You can increase the limit to 250 orders by adding &limit=250 to the URL. If your query has more than 250 results then you can page through them by using the page URL parameter: https://help.shopify.com/api/reference/order#index

Hope this helps!

Brendin commented on Single call to Order API only returns 49 orders

$
0
0

Josh.... i have read through that doc so many times its not even funny... I have no clue how I missed that!! 

Thank you very much!

Josh Brown commented on Single call to Order API only returns 49 orders

Creating Cart Page - getting Product & Variant info from BUYCartLineItem by Austerly

$
0
0

I'm building a cart page from a simple table view, and have run into a snag.  I've got a cart created, with an array of BUYCartLineItem in there.  I can get the variantId of each line item, but how does one get the product title & variant image for each variant?  Unfortunately, there's no getVariantById function... surely there's a better way than having to create an array of all the store's products, then checking each variant of every product in the store for a match on the variantId?  Any help would be greatly appreciated.  Thanks!

How to sort Fulfilled orders by Status (Confirmed, In Transit, Out for Delivery, and Delivered by 1340

$
0
0

We are trying to find out a way to sort orders after we Fulfill orders.   

When Fulfilled, we cannot not find a way to sort by Status  

Confirmed

In Transit

Out for Delivery

Delivered

Any ideas?


How to call "getOrdersForCustomerCallback" API? by Sandeep Mundra

$
0
0

I have using iOS 10, When i treid to call "getOrdersForCustomerCallback" API, then Application crashed. Here i mention my code.

My Code :- 

[[AppDelegate objAppDelegate].client getOrdersForCustomerCallback:^(NSArray<BUYOrder *> * _Nullable orders, NSError * _Nullable error) {

        if (error) {

            NSLog(@"%@",error.userInfo);

        }

        else

        {

            NSLog(@"%@",orders);

            if (orders.count == 0) {

            }

            else

            {

                self.mutArryOrderList = orders.mutableCopy;

                NSLog(@"All Order Data %@",self.mutArryOrderList);

                

            }

        }

    }];

Error is :-  Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithFormat:locale:arguments:]: nil argument'

Muneeb commented on Unable to generate the Access Token

$
0
0

Hi Kristina,

thanks for reply. I also try to generate the access token by following your provided link but still can't get the access token. 

Can you please let me know how can i generate the access token? 

thanks 

Jason commented on Unable to generate the Access Token

$
0
0

The link above should give you a decent step by step process here. Was there a certain part in the process that you didn't understand or need help on. It's hard to troubleshoot this without have more information on what you're sending / receiving.

  • If you're no longer using the old code with depreceated parts, what are you using now?
  • Your app server is using SSL right?

Post as much info as you can, but obviously removing / masking keys or tokens that should remain private.

Muneeb commented on Unable to generate the Access Token

$
0
0

Hi,

thanks for reply. Is ther any sort of code standard to install the new app like as below:

install.php:

<?php

// Set variables for our request

$shop = "testshop";

$api_key = "680798dc2c864xxxxx39b42cxxxx8";

$scopes = "read_orders,read_products,write_products,write_orders";

$redirect_uri = "http://exportleftovers.co/test_leopards/generate_token.php";

// Build install/approval URL to redirect to

$install_url = "https://" . $shop . ".myshopify.com/admin/oauth/authorize?client_id=" . $api_key . "&scope=" . $scopes . "&redirect_uri=" . urlencode($redirect_uri);

// Redirect

header("Location: " . $install_url);

die();

Now what will be code that i need to write for generating the token in 'generate_token.php' 

generate_token.php:

require_once("inc/functions.php");

// Set variables for our request
$shop = "exportleftovers-development-shop";
$api_key = "680798dc2c864xxxxx39b42cxxxx8";
$shared_secret = "83f33c5bxxxxx3d4c37xxxxfe9ece";
$code = $_GET["code"];
$timestamp = $_GET["timestamp"];
$signature = $_GET["signature"];

// Compile signature data
$signature_data = $shared_secret . "code=" . $code . "shop=". $shop . ".myshopify.comtimestamp=" . $timestamp;

$query = array(
        "Content-type" => "application/json", // Tell Shopify that we're expecting a response in JSON format
        "client_id" => $api_key, // Your API key
        "client_secret" => $shared_secret, // Your app credentials (secret key)
        "code" => $code // Grab the access key from the URL
    );

    // Call our Shopify function
    $shopify_response = shopify_call(NULL, $shop, "/admin/oauth/access_token", $query, 'POST');
        

    // Convert response into a nice and simple array
    $shopify_response = json_decode($shopify_response['response'], TRUE);

    //echo var_dump($shopify_response);
    // Store the response
    $token = $shopify_response['access_token'];

    // Show token (DO NOT DO THIS IN YOUR PRODUCTION ENVIRONMENT)
    echo 'Success 1122: MY Token is '. $token;

-------------------------

when i remove the if condition 'if (md5($signature_data) === $signature) {' 

than shopify generate the token. 

Is there any expiry of token? Because something token is expire and i need to generate the token again.

thanks 

 

Can't Upload Files On Root Folder To Activate Web Push Notifications by Vivek

$
0
0

We are building an app for web push notification but we are not able to add files to the root folder of the domain. To implement web push, two files need to be added to the root folder - manifest and service-worker. Shopify directly uploads all files to cdn and not on the root folder. 

How can I find a work around for this one ?

Viewing all 25503 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>