Including tip amount in an Order - square

I'm having trouble using the Square Connect API. I need to add the amount for tips but I don't see a place where I can do that in the Transaction Charge endpoint neither in the Order CreateOrder one.
The only place that tip is mentioned is in the Tender object, property tip_money, but we can't send a Tender when creating a Transaction or Order.
https://docs.connect.squareup.com/api/connect/v2#endpoint-charge
Have anyone ever implemented this using the Square Connect v2 API? We're developing an app using a completely customized UI so we can't use webviews from Square or anything.
Thanks a lot.

Currently you cannot add a tip through Square APIs. The only way to add a tip is when taking a payment through the Square POS application, if you have tipping enabled. When you do take such payments, they will show up in the Tender object (which is a part of a Transaction) as you found.

Square has now added the ability to add a tip through the payments API.
See: https://developer.squareup.com/reference/square/payments-api/create-payment#request__property-tip_money

Related

What steps should the add to cart operation go through?

I am planning to make an e-commerce site and there are some steps that I need to think about.
For example, I will add a product to the cart. In your opinion, what stages should this process go through in the background in order for me to take this action? Which checks should be done in what order? For example, if I assume that I will do stock control, should I do this stock control through a separate stock microservice? Other than that, what kind of steps and checks should it go through?
Here's what I'm planning. I have a frontend application and from here I will send a request to my cart service (a rest api) via an ApiGateway when the user presses the add to cart button. The addbasket method of this service will be run. Here I will first check stock from my stock micro service. If there is stock, I will add it to the cart. If not, I'll be back.
What else should I do here? Also where should I store the basket? Should I consider a database or a different option?
Actually, what I want to ask is what steps should I go through and what controls should I do to develop the add to cart operation. At this stage, where should I store the products in the basket, etc.?
Could you please explain what is the best way to make this work?
thank you everyone

How do I access Shopify data without advanced account?

All I'm wanting to do is track sales of certain products from a certain date. My company is wanting to add a banner to track sales goals for raising money for charities. So basically, we'd tag a few products as being part of that goal, set a goal, and then need to update the goal progress by a certain amount every time a sale is made on one of those products. As far as I can tell, without access to Shopify's analytics API, this is not possible. How can I do this?
What you want to build is perfectly possible. However, you need to generate Private App Credentials, so you can use Shopify API. It doesn't matter if you have an account by yourself, someone else can follow these steps and send you the credentials your way.
If you don't actually need to modify anything through the API, you could have them set a webhook (Settings -> Notifications -> Webhook) on Order Creation (or similar) that posts to your server and you can check what product got sold and see if it has got the tag.
The "easy" way to do this is to create an app that receives order webhooks and can check on tagged products and keep a sum of target items sold.
Then the app should have use a script tag to insert a simple script with the current value into the web page at a configured place by css selector
OR the app could update one or more snippet files that you could include until the promo is done.
I'd tend to go with the script tag option since that's a bit more flexible and you should be able to change your theme when the promo is over to report results without having to touch the app again.

Shopify API: Create a Promotion?

Using the Shopify API, is there a way to creation promotions for your store? If not, is there a way to programmatically create promotions in Shopify? (short of using CURL posts to the admin)
That is, I can create a promotion by hand using the admin and navigating to the Promotions and clicking the Add a discount code link. I'd like to be able to do the same thing programmatically, or to know for certain this isn't possible. I don't see any obvious method on the api list, but it seems like something should be an API method.
Unfortunately they don't allow it... I resorted to creating an interface to do so, though:
https://github.com/MartinAmps/Shopify-Private-APIs
Hope it helps
Edit
I also created a blog post about it.
There is no way to create discounts via the API.
If you want we have made an application that can be used to create discount codes.
Otherwise you can use a tool like Mechanize to automate coupon creation for you, but keep in mind theres a good chance that any time in the future it will break since we don't make any promises to keep our admin the same in the future. Any changes have a good chance of breaking whatever script you'd end up writing.
The Price Rules API is now public and allow any app to create price rules and discount codes.
https://help.shopify.com/api/price-rules
If you're familiar with Rails or you're already using ActiveResource for your Shopify API calls, then you can drop in this modified version of Discount < ActiveResource::Base https://gist.github.com/choonkeat/09a56da222f506e627c5

Debug sales order workflow in OpenERP 6.1 web client

I'm testing out the OpenERP 6.1 web client, and I sometimes have a sales order or other kind of document that gets stuck for some reason. I want to be able to look at the workflow diagram for this document to see exactly where it is stuck.
One example that happened to me was a sales order that had shipped and the invoice was paid, but the sales order still wasn't done. After some digging, I found that one of the procurements was still running.
I can still print the workflow from the GTK client, but isn't there some way to print it from the web client?
I found a couple of ways to get at the screen that lets me edit the workflow, but that's not what I'm looking for. I want to print the diagram that shows the current state of the workflow instance for the open document.
Yes I agree with the Ruchir comment that in web-client you can not print workflow, but I would like to remind that from some of the views we have Process View Implemented which are interactive and Useful to show your business process.
To see how you can use it follow the following link Managing your Sales Quotations This will guide at the end how you can use the Process view.
Like When you Draft your Quotation your Some process Ndoe will be in Red End Color other will be Gray then if you move forward the state will keep on changing, and advantage over here is they are interactive you can jump to specific node related view so you can drive you Sale process very fast and interactively.
Hope this will help.
from webclient it is not possible to print workflow . so for that you have to use GTK client.

Setting carrier per product

I'm working on a store that has two types of products: perishable food and general merchandise. The food must always be shipped overnight via FedEx, and the other merchandise must always be shipped via USPS. If somebody orders products from both categories, they must be shipped separately.
Do you know of an existing module or configuration settings that would allow for this?
If not, it sounds like a custom module would be the other solution. In this case, what is the best approach? I'm thinking it would be splitting the order into a multi-address shipment, using the same address for both but with different shipping methods. Unfortunately I'm not sure how to do this programatically, so any tutorials/samples/resources would be greatly appreciated.
Probably the sanest way to handle this would be to create two orders per product type, each shipping with a different carrier to the same address. This also IMO makes more sense from a stores tracking perspective as you can handle each independently from each other.
To get you on the right track(since Magento is especially cryptic in this part of itself) you should read the Inchoo programmatically create order in Magento post and by the same author Programatically create customer and order in Magento with full blown one page checkout.
Basically as I see this going is:
Get the customer order
Itinerate through each product inside the order and split it up in two arrays for each product type
Create a separate order for each product type and use the different shipping methods for each.
You will probably have to extend a some controllers OR do it the non-standard way and use helper functions for this, the hard parts will be integrating the payment/shipping modules inside your order process. Going this way will have you creating the full checkout process as the one page checkout Magento provides won't really work and is too much pain to get to work because of the way it uses AJAX.
Also another alternative is to hook in to Magento's pre-create order events and create the orders there using already defined order data split it up in two orders, but this is something I never heard or saw implemented at the moment so you'd have to do it "blindfolded" so to speak.
An easier approach would be to use a custom field that defines your product's shipping method, this way you just add that and don't care about custom orders. You just react with that, however tracking will become mostly impossible IMO.
Over-ride the Free Shipping module.
You can setup a sales rule that applies to certain products and makes them 'Free Shipping', leaving the other products to your chosen main shipment provider.
You will need to see how this works, however, the point is that Magento does have something built in to split an order into two shipping categories, albeit only a sales rule on free shipping. But you have source code...