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

Clara commented on Updating application charge

$
0
0

Hey everyone,

If the user and you do not accept and activate the new charge, the old charge continues. We only cancel the old charge on your behalf if there is a new active charge. (Refer to http://docs.shopify.com/api/tutorials/shopify-billing-api#recurring-charge-img for status)

With that being said, we do allow you cancel the old charge as well, independently of the new charge.

If this is not the case, please feel free to email our support staff and we'll get this sorted out.

It is also possible that you have multiple pending/accepted charges that are not activated, that can be all potentially be activated, depending on how you structure your loop of getting the user to accept the charge. In which case, it is possible to cancel "previous" charges that you have just sent, as a result of getting the user to accept new charges.


Clara commented on Updating application charge

$
0
0

Hunkybill: In theory you don't have to do anything, other than to mark that charge on your end as done, and not to ever prompt the user to accept it.

HunkyBill commented on Updating application charge

$
0
0

@Clara... in the charge cycle it is not the APP that prompts the user.. it is Shopify... but that being said, it's clearer now about cases with a change. They accept it, we activate it, and all it well. Otherwise they do not accept it, and they continue the old charge automatically (assuming we don't kill their subscription for not accepting).

Thanks

Luke Hopkins commented on Login with facebook

$
0
0

Super-keen for this too. Have requested beta testing.

Asa Carter commented on Updating application charge

$
0
0

I think maybe the issue then is my database schema where I have a single charge to a single shop. When I try to create the new charge the old charge is overwritten in my DB. I'll update my database and code and see if this resolves the issue.

Thanks!

Asa

HunkyBill commented on Updating application charge

$
0
0

@Asa... why do you persist the charge when you can just get it more accurately from the Shop itself? Seems like an issue where scaling does not come into play. If you lose sync with a charge on a shop in your DB you're bound to inconvenience either you or the merchant. Just curious.

CarrierService Enhancement Recommendation by Lin Borkey

$
0
0

I'd like to suggest an enhancement to the CarrierService API.  It would be great if the cart attributes were passed along with the current payload to the CarrierService URL.  This would allow better customization of the shipping methods available by reading various cart attributes that have been set.  The new node could be set at the same level as "rate".

In my specific case, my customers have a choice on delivery of their products: directly to the user or shipped to a local dealer.  If there isn't a local dealer, I'd like to suppress the dealer shipping method and only offer direct shipping.  The local dealer ID is stored in a cart attribute to be passed along to our fulfillment service.

Asa Carter commented on Updating application charge

$
0
0

I do both, It's just the way I have structured my app.

When I create a charge, I store the charge details, along with whether it is a single or recurring charge in the DB.

Then on each page load, I check from the DB what kind of charge it is, then verify it with the correct API call.

However in that DB query, I was only checking for a single charge. I'm going to move it to a different table and change the code a bit to record all charges. Hopefully it should fix it.

How do you do it?

Edit - The only other way I can think of doing it is - assuming it could be either a charge or a recurring charge, is to try both API's and see if I get a result from either one - but then that's two API calls instead of one. It would be handy if the SHOP endpoint returned the current charge id. That would save a lot of work.


Setting SEO attributes on collections through the json API by derosa

$
0
0

Hi,

I'm working with the json Shopify API to try and create and update custom
collections and I have a question.

I can create a custom collection, but I want to set the page title and
meta description.

The admin interface allows you to set these within the SEO section when
editing a custom collection, but I want to be able to do it through the
API. I've tried various things, but guesswork and trial and error are
getting me nowhere. I've tried setting the SEO values in the admin
interface and then retrieving the custom collection through API afterwards
- to see if the SEO attributes are returned, but they are not.

Can someone describe how I set these through the API, please?

untitled by derosa

$
0
0

Hi,

I'm working with the json Shopify API to try and create and update custom
collections and I have a problem.

I can create a custom collection, but when I try to update it the
"collects" attribute causes it to throw a "422 Unprocessable Entity" error.

I've tried creating a custom collection and then updating it with the same
information used to create it. I've tried retrieving the custom
collection from the API and then sending the update back to the API (with a
couple of small changes). I've even tried using the example you give in
your API docs (the API docs suggest you can pass in "collects", but when
you retrieve a custom collection from the API it doesn't return
"collects"). In all cases, the only way I can get the API to accept the
update is if I remove the "collects" attribute and that's something I need
to include when updating collections. See below for a few examples of calls
that I've tried.

Can you please help me figure out the problem with updating the custom
collection?

From your API docs (with ids changed).

This returns a 422 error

{"custom_collection": {"body_html": "<p>The best selling ipod ever</p>","handle": "ipods","id": 11725393,"products_count": 1,"published_at": "2008-02-01T19:00:00-05:00","published_scope": "global","sort_order": "manual","template_suffix": null,"title": "IPods","updated_at": "2008-02-01T19:00:00-05:00","image": {"created_at": "2013-09-13T09:17:07-04:00","src": "http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg&quot;
},"collects": [
{"product_id": 150146213,"position": 1
}
]
}
}

This returns 200 OK

{"custom_collection": {"body_html": "<p>The best selling ipod ever</p>","handle": "ipods","id": 11725393,"products_count": 1,"published_at": "2008-02-01T19:00:00-05:00","published_scope": "global","sort_order": "manual","template_suffix": null,"title": "IPods","updated_at": "2008-02-01T19:00:00-05:00","image": {"created_at": "2013-09-13T09:17:07-04:00","src": "http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg&quot;
}
}
}


Updating the collection using the same call I used to create it (with the
id included)

This returns a 422 error

{"custom_collection": {"title": "Titanium coated Steel","collects": [
{"product_id": 150146213
}
],"image": {"src": "http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg&quot;
},"published": false,"body_html": "Surgical steel PVD coated in Titanium.","id": 11725393
}
}

Again, if I remove the "collects" I get 200 OK

{"custom_collection": {"title": "Titanium coated Steel","image": {"src": "http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg&quot;
},"published": false,"body_html": "Surgical steel PVD coated in Titanium.","id": 11725393
}
}

 

 

 

Chris Saunders commented on untitled

$
0
0

What does the 422 response body say? What framework/library are you using for your API requests?

There should be some details in the body of the response that can tell you what caused the error.

HunkyBill commented on Setting SEO attributes on collections through the json API

$
0
0

You can always use the API to GET a resource you know well. One where you used the Admin to add the details to the collection like page_description. When you GET that resource, examine it carefully for the attributes. Now do the PUT for that same resource and change the attribute. If it sticks, you're lucky and the endpoint will function fine for you and you now know what to do. If it does not stick, it means that attribute is not available for updating or creation and you'll have to lodge a request to have that changed. 

There really should be no guesswork or trial and error here. It may be that the resource you're trying to edit is actually something different than what you thought it was.

derosa commented on Setting SEO attributes on collections through the json API

$
0
0

Thanks. I did indeed try that approach, but the attributes are not there. That's what I meant by...

I've tried setting the SEO values in the admin
interface and then retrieving the custom collection through API afterwards
- to see if the SEO attributes are returned, but they are not

How do you go about lodging a request for API updates because I have other issues with the API I'd like someone to address?

Thanks again.

derosa commented on untitled

$
0
0

Ah, thanks Chris. Not only did I forget to put a title to this post, I also missed the error detail in the body of the response. The message is...

{"errors"=>{"collects.product_id"=>["already exists in this collection"]}}

So it seems, even though I am updating the collection, it treats the list of "collects" (in the format I am sending them) as being new.

I can work around this by first listing the collects already linked to the collection

/admin/collects.json?collection_id=11725393

and then including the full set of collect attributes returned from that call in the collects array that I pass in when updating the collection (or just exclude that collect from the array completely). Like so

{"custom_collection":{"title":"Titanium coated Steel","collects":[{"collection_id":11725393,"created_at":"2013-09-15T22:49:33+01:00","featured":false,"id":390435321,"product_id":150146213,"sort_value":"0000000001","updated_at":"2013-09-15T22:49:33+01:00","position":1}],"image":{"src":"http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg"},"published":false,"body_html":"Surgical steel PVD coated in Titanium.","handle":"a-test-handle","id":11725393}}

OR

{"custom_collection":{"title":"Titanium coated Steel","collects":[],"image":{"src":"http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg"},"published":false,"body_html":"Surgical steel PVD coated in Titanium.","handle":"a-test-handle","id":11725393}}

Any products not already in the collection can be added just by including the product_id in the array

{"custom_collection":{"title":"Titanium coated Steel","collects":[{"product_id":10767062}],"image":{"src":"http://www.bodyjewellery.co.uk/images/layout/big_image2.jpg"},"published":false,"body_html":"Surgical steel PVD coated in Titanium.","handle":"a-test-handle","id":11725393}}

I'll also need to individually delete each product currently linked to the collection which should no longer be linked.

This will work, but it seems counter-intuitive, especially when Shopify wants you to keep your API calls to a minimum. Can you suggest a better solution? 

Thanks for your help.

Jason commented on Setting SEO attributes on collections through the json API


marcoslimagon commented on Search products from the API

$
0
0

I enabled this 'Json' search for my website. 

I created a custom property for the variant named "cardid" but I don't know how to search over it.

The search funcionality works fine searching by sku directly: http://magictest2.myshopify.com/search?view=json&type=product&q=sku:MTG367689, but how can I find my custom property? 

 

It's getting indexed, because http://magictest2.myshopify.com/search?view=json&type=product&q=xpto bring results.

 

How can I search over specific variant custom field? The following example doesn't work: http://magictest2.myshopify.com/search?view=json&type=product&q=cardid:xpto

Asa Carter commented on Updating application charge

$
0
0

Clara: All is working well now. Thanks for the clarification.

I still think there could be a little more information in the dialog box for the customer about how payments are pro rata when changing plans. The only thing they see is:

"**** would like to charge you $5.00 (USD) for PRO This charge will recur monthly on your Shopify invoice."

It looks like they are going to be charged an additional $5. I just think it would be a little more helpful for them.

Thanks

Asa

iPhone app not updating by JSFain

$
0
0

Seems that the iPhone app is not in sync with the web site. For instance I have 7 Unfulfilled orders I am working on, bu the iPhone app says I have 29 Open orders, very disconcerting and makes me not trust it.

Anyone else have such concerns with the iPhone app?

Random image_soure field showing in line item properties by StitchLabs

$
0
0

Hello, 

A customer of ours is having a random image_soure field showing up each line item of each order in the API. Why is this happening and is there a way in the admin to turn this off, or is it a misc. bug? Please see the raw json below for an example.

Thank you,

brandon

 

{
    "buyer_accepts_marketing": false,
    "cancel_reason": null,
    "cancelled_at": null,
    "cart_token": "a089821db812dafa140c94bd8a302560",
    "checkout_token": "120b6f7d090f4e35cfffe0f6be0c4d4e",
    "closed_at": null,
    "confirmed": true,
    "created_at": "2013-09-19T21:58:09-04:00",
    "currency": "USD",
    "email": "therobsons@sbcglobal.net",
    "financial_status": "paid",
    "fulfillment_status": null,
    "gateway": "shopify_payments",
    "id": 183958031,
    "landing_site": "/",
    "location_id": null,
    "name": "#1683",
    "note": null,
    "number": 683,
    "reference": null,
    "referring_site": "",
    "source": "browser",
    "subtotal_price": "277.00",
    "taxes_included": true,
    "test": false,
    "token": "bc45a4029073c427f5cdd4f177b6b7bf",
    "total_discounts": "0.00",
    "total_line_items_price": "277.00",
    "total_price": "277.00",
    "total_price_usd": "277.00",
    "total_tax": "0.00",
    "total_weight": 0,
    "updated_at": "2013-09-19T21:58:09-04:00",
    "user_id": null,
    "browser_ip": "76.239.29.10",
    "landing_site_ref": null,
    "order_number": 1683,
    "discount_codes": [],
    "note_attributes": [],
    "processing_method": "direct",
    "checkout_id": 134192103,
    "source_name": "web",
    "line_items": [
        {
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "grams": 0,
            "id": 317884683,
            "price": "89.00",
            "product_id": 155284951,
            "quantity": 1,
            "requires_shipping": true,
            "sku": "109-WNO-2S",
            "title": "Nancy",
            "variant_id": 355738011,
            "variant_title": "S / wave-navy-orchid",
            "vendor": "Test",
            "name": "Nancy - S / wave-navy-orchid",
            "variant_inventory_management": "shopify",
            "properties": [
                {
                    "name": "image_soure",
                    "value": "http://cdn.shopify.com/s/files/1/0238/2785/products/109-WNO-1_016c8135-9304-4d96-b405-e0be05e6b9ed_grande.jpg?24745&quot;
                }
            ],
            "product_exists": true
        },
        {
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "grams": 0,
            "id": 317884685,
            "price": "89.00",
            "product_id": 155285683,
            "quantity": 1,
            "requires_shipping": true,
            "sku": "109-MTNO-2S",
            "title": "Nancy",
            "variant_id": 355739319,
            "variant_title": "S / mod-twist-navy-orchid",
            "vendor": "Test",
            "name": "Nancy - S / mod-twist-navy-orchid",
            "variant_inventory_management": "shopify",
            "properties": [
                {
                    "name": "image_soure",
                    "value": "http://cdn.shopify.com/s/files/1/0238/2785/products/109-MTNO-12_grande.jpg?24745&quot;
                }
            ],
            "product_exists": true
        },
        {
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "grams": 0,
            "id": 317884687,
            "price": "99.00",
            "product_id": 155258933,
            "quantity": 1,
            "requires_shipping": true,
            "sku": "111-SDS-2S",
            "title": "Megan",
            "variant_id": 355676327,
            "variant_title": "S / square-dot-sky",
            "vendor": "Test",
            "name": "Megan - S / square-dot-sky",
            "variant_inventory_management": "shopify",
            "properties": [
                {
                    "name": "image_soure",
                    "value": "http://cdn.shopify.com/s/files/1/0238/2785/products/111-SDS-16_ee42a179-2af9-44ec-b675-7980405125a8_grande.jpg?24745&quot;
                }
            ],
            "product_exists": true
        }
    ],
    "shipping_lines": [
        {
            "code": "Standard Shipping",
            "price": "0.00",
            "source": "shopify",
            "title": "Standard Shipping"
        }
    ],
    "tax_lines": [],
    "payment_details": {
        "avs_result_code": "Y",
        "credit_card_bin": "546616",
        "cvv_result_code": "M",
        "credit_card_number": "XXXX-XXXX-XXXX-6083",
        "credit_card_company": "MasterCard"
    },
    "billing_address": {
        "address1": "1814 North Robincrest Lane",
        "address2": "",
        "city": "Glenview",
        "company": "",
        "country": "United States",
        "first_name": "Colleen",
        "last_name": "Robson",
        "latitude": "42.067089",
        "longitude": "-87.804123",
        "phone": "8477720551",
        "province": "Illinois",
        "zip": "60025",
        "name": "Colleen Robson",
        "country_code": "US",
        "province_code": "IL"
    },
    "shipping_address": {
        "address1": "1814 North Robincrest Lane",
        "address2": "",
        "city": "Glenview",
        "company": "",
        "country": "United States",
        "first_name": "Colleen",
        "last_name": "Robson",
        "latitude": "42.067089",
        "longitude": "-87.804123",
        "phone": "8477720551",
        "province": "Illinois",
        "zip": "60025",
        "name": "Colleen Robson",
        "country_code": "US",
        "province_code": "IL"
    },
    "fulfillments": [],
    "client_details": {
        "accept_language": "en-us",
        "browser_ip": "76.239.29.10",
        "session_hash": "4ac3a009893c93fe705f8ec6a43596c24a4e4966bf686486c41d6b26785a20f8",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1"
    },
    "customer": {
        "accepts_marketing": false,
        "created_at": "2013-09-19T21:37:05-04:00",
        "email": "therobsons@sbcglobal.net",
        "first_name": "Colleen",
        "id": 143700781,
        "last_name": "Robson",
        "last_order_id": 183958031,
        "multipass_identifier": null,
        "note": null,
        "orders_count": 1,
        "state": "disabled",
        "total_spent": "277.00",
        "updated_at": "2013-09-19T21:58:10-04:00",
        "verified_email": true,
        "tags": "",
        "last_order_name": "#1683",
        "image_url": "//gravatar.com/avatar/861d4a6cd876352d2468b5ed526b9a28?default=http%3A%2F%2Fcdn.shopify.com%2Fs%2Fimages%2Fadmin%2Fcustomers%2Fcustomers_avatar_usa_mtrushmore.png",
        "default_address": {
            "address1": "1814 North Robincrest Lane",
            "address2": "",
            "city": "Glenview",
            "company": "",
            "country": "United States",
            "first_name": "Colleen",
            "id": 187745581,
            "last_name": "Robson",
            "phone": "8477720551",
            "province": "Illinois",
            "zip": "60025",
            "name": "Colleen Robson",
            "province_code": "IL",
            "country_code": "US",
            "country_name": "United States",
            "default": true
        }
    }
}

Jason commented on Random image_soure field showing in line item properties

$
0
0

(hope that's not real user data)

Are you sure that 'image_soure' (fun typo!) is not some redundant code that's being pushed along with each product order? 

Viewing all 25503 articles
Browse latest View live


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