Pass data from Shopify URL to saved order [closed] - shopify

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
What is a method of passing custom data through a Shopify URL and having that data stored with the order (for later extraction through reports, admin access, API pull, etc.)?
For example, I would like to produce URLs like
examplestore.com/products/soccerball?aff=123456
(for an external affiliate tracking system), and have that 123456 be saved with the order. Then I could pull the orders from Shopify and know which orders were associated with which affiliates.
I realize there are affiliate apps for use within Shopify, but they seem to want to own the affiliate definition and data. This isn't what I need, as the IDs I pass in are entirely owned and managed by an external system.

Shopify allows to add some properties to the line items associated with an order. So, You can add properties to the products before adding to cart.
for that you can Refer the URL: https://cartjs.org/pages/reference#core-api-add-item
Now from all your orders you can filter them through the properties in their line items.

I found the answer here: Shopify Permalink Cart Preloading
Using a permalink to create a cart with one or more items in it, extra parameters can be added to the URL that provide additional information (including shipping address, but especially including data such as an affiliate id).
For example,
example-store.myshopify.com/cart/variant_id:quantity?ref=external_referral_id
will result in a cart that, when checked out and completed, will store the referral ID with the order.

Related

REST URL convention [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I have an application table that has columns like quoteId, accountNumber, and few others. I have created a REST endpoint to update the account number on the basis of quoteId i.e Update account no. in the application that has quoteId = {quoteId}. Here is the endpoint:
PUT /applications/quotes/{quoteId}/accountNumber
Is it the correct REST convention?
Is it the correct REST convention?
Maybe.
If your PUT/PATCH/POST request uses the same URI as your GET request, then you are probably on safe ground. If PUT/PATCH/POST are using different URI, then something has Gone Wrong somewhere.
In other words, if /applications/quotes/{quoteId}/accountNumber is a resource that you link to, then it is the right idea that you send unsafe requests to that URI.
But if accountNumber is information normally retrieved via /applications/quotes/{quoteId}, then /applications/quotes/{quoteId} should be the target resource for edits (instead of creating a new resource used for editing only).
The reason for this is cache-invalidation, as explained in RFC 7234.
If this isn't immediately clear to you, then I suggest reviewing Jim Webber's 2011 talk on REST.
You should use PATCH instead of PUT for partial object updates.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH
https://www.infoworld.com/article/3206264/how-to-perform-partial-updates-to-rest-web-api-resources.html
In my opinion, your url must be:
PUT /applications/quotes/{quoteId}
payload: {
accountNumber: <number>,
... any other field...
}
Because you only want to update a part of an object of the list of quotes that you identify uniquely with quoteId.
About the use of PUT or PATCH, it's true that PUT means that you want to keep the object as the updated copy that you are sending (you must send in this case the entire object to make the update) but the fact is (I think) that many of us use PUT like you, to do partial updates of object.

BigCommerce user defined custom fields for address and customer

I need to retrieve custom field values for customers and addresses using the Big Commerce API.
There appears to be a facility for this for custom product fields;
https://developer.bigcommerce.com/api/stores/v2/products/custom_fields
However no documentation exists for customers and addresses. I tried to access with a similar URL to the products custom fields URL (ie. GET /stores/{store_hash}/v2/customers/{customer_id}/custom_fields) with no success
I realise a similair question has been asked on here already, however BigCommerce support asked me to ask the question on here and that a developer will respond. Here's hoping.
Unfortunately there is no endpoint for custom fields on customers/addresses through the BC API. Hopefully that will be something they'll add when they come out with the next version of their API

How can i delete a contact from a list with the mailjet api and php? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I use mailjet api to send newsletter, but i don't know how delete a contact from a list.
Please help me.
I'm a developer evangelist here at Mailjet.
The relation between a contactlist and a contact is represented through the listrecipient entity. You can learn more about this in our guide, here:
To remove a contact from a list, you have two options: either DELETE this entity or unsubscribe the contact from the list. The second solution has the advantage to keep the contact's status in the list. It prevents to send unwanted emails to a contact, if for some reason you add it in the list again later.
First, do a GET request to retrieve the ID of the listrecipient entity.
As described in our reference documentation, here, use the Contact and ContactsList filter.
Once you have the ID, you can either run a DELETE request on it to permanently delete the contact in the list or set the IsUnsubscribed property to true to unsubscribe it.

BigCommerce - Is there a way to write data to a database from store and then retrieve it and display it on Front End?

I'm not sure if this is possible.
I'm looking to create a Question and Answer widget for a BigCommerce store. The idea is the user will type in a question on the product page, the question will get added to a MySQL database on a different server. The store owner would then access an edit page on the other server and either reply and post, reply or delete the question. If the store owner decides to reply and post, the question and answer would then be displayed on the original product page.
The part that I'm not sure how to do is the last part: displaying the question and answer on the original product page.
Thanks,
You won't be able to pull it in via the Bigcommerce platform itself, but why not pull the content in with javascript? It's not ideal, but you should be able to get that to work.

Is there an API to get a list of gmail filters and update them? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Google Apps has an "Google Apps Email Settings API" which allows to create a new mail filter via an API call.
Is there any (perhaps undocumented) way to get the list of current filters and update them?
A Filter object was added to the API that allows for filter processing, including retrieval, creation and deletion.
https://developers.google.com/gmail/api/guides/filter_settings
Specifically:
Listing Filters
GET https://www.googleapis.com/gmail/v1/users/userId/settings/filters
Returns a JSON list of Filter objects
Retrieving a specific Filter
GET https://www.googleapis.com/gmail/v1/users/userId/settings/filters/id
Returns a single JSON Filter object
Deleting a specific Filter
DELETE https://www.googleapis.com/gmail/v1/users/userId/settings/filters/id
Creating a Filter
POST https://www.googleapis.com/gmail/v1/users/userId/settings/filters
With a JSON encoded Filter in the request body.
While the REST URLs have v1 in the address, they are linked from the current documentation. Also note, GMail API migration is currently in progress, and the deprecated API will cease to function as of July 2016. Keep this in mind, as the API may change.
No. There is no API to retrieve filters, only create new ones (as you found).
However, users can export all of their filters from the UI and re-import them into another account manually:
Using Filters
I haven't tried it, but according to the Google Admin SDK docs, it looks like you can:
https://developers.google.com/admin-sdk/email-settings/#retrieving_labels