Bigcommerce: edit an existing order shipment address - api

I imported 10k legacy orders with the wrong state. How do I fix it? When I use the order shipment update endpoint PUT /orders/{order_id}/shipments/{id} I get an error that the shipping_address field is not writable. What do I do?
I'm using the API docs here: https://developer.bigcommerce.com/api-reference/orders/orders-api/order-shipments/putordersorderidshipmentsid

It isn't possible to directly write to the order shipment address state field, but for context, that mirrors the behavior you'd see when working with order shipments in the control panel. The best solution would be to delete the shipments with the incorrect state and re-create the shipments.
Edit:
There are 2 options to re-create the shipment with the correct address: The first is to update the order by adding a new shipping address containing the correct state and use that shipping address when you re-make the shipment. Although existing order shipping addresses can't be edited, the order shipping address array is additive. So you can update the order by adding a new shipping address and use that order_address_id to create the new shipment. The second option would be to delete the entire order with the incorrect shipping address and re-import it with the correct data, then re-create the shipment.
On the orders resource, we are scoping a feature request to make shipping addresses editable. (This would align with what you're able to do when editing an order through the control panel). I'll keep you posted in this thread when there's an update on that, although the best solution in the meantime would be to use one of the options outlined above.

Related

Adding new product with category tree - specific price problems

I installed an add-on for bulk action (called ba_importer v 1.1.24), I upload an Excel file with my data and create a group of products.
I can set the categories' tree or manually add ID of main categories and associated. I tried with no luck to use the tree features (like Home/Products/etc) and so I use all the ID of main category and all the associated. The result is a product with the correct categories set, but with no specific price from the customer group linked to a category.
I tried to edit a single product, remove all categories and set it one by one (set one, save, set one, save etc.) and then the specific price from the group linked to a category appears to the product.
Is there a better solution? I'm thinking about make a personal PHP page that reads an Excel file and sets all the information about the product, but I'm scared to face the same problem with the specific price. 
There is no such thing as "category-related specific price",
if you have specific prices tied to customer groups , these are created as a result of the add/update product action with ps_specific_price DB entries having id_group with your restricted ID.
It is likely that the bulk module acts directly with DB queries to speed up things and bypasses this operation, I've seen this behaviour with those kind of modules in the past.
Since you are talking of a paid add-on, I would definitely seek help from the developer.

How to pass Note from Sale Order Line to Transfer (Detailed Operation Line)?

In Sale Order Line, there is an option to write down some notes in the lines as "note". When the Sale Order is confirmed, the data is sent to stock.picking (Transfers) and the lines from Sale Order Line appear in Detailed Operations in the Transfers page, but without the note.
Where should I look for in order to customize and/or configure it to achieve such goal?
There is no differanciation of line types for stock.picking lines as for sales order lines. In sales order lines it's made by the field display_type.
Trying to imitate this feature for pickings could end in a mess. Personally i would try to get all notes and either copy them to a new notes one2many field or just in one new note text field on the created picking. Or maybe even "easier" is to compute all notes, because every picking line (stock.move) has a connection to the original sales line (sale_line_id) and so indirectly to the sales order or even directly by field stock.picking.sale_id.

Retrieve customer related to payment

Anyone know if it's possible to retrieve the customer name related to a transaction from the API?
I see it under "Paid by" if I follow the "payment_url" in the connect v1 https://connect.squareup.com/v1/{{location_id}}/payments/{{payment_id}} endpoint but can't see to find it anywhere else
Background: I'm working on a ticketing system that breaks out items by item_category so a kitchen gets only food items and the bar gets only drink items.
I have queues and itemized tickets by category BUT I can't seem to find the customer's name anywhere
You'll need to utilize the V2 Transactions API. When you call ListTransactions or RetrieveTransaction (ListTransactions), the Transaction object will have an array of Tenders, tenders, which has a field called customer_id. With this id, you will be able to pass it to RetrieveCustomer (RetrieveCustomer) to find out their name. Note that if you're not explicitly filling out their name, the name might not be available (an "instant profile" (Instant Profiles) will be created with whatever information can be retrieve from the card used to pay).
Update: Alternatively, as suggested by #Dan, would be to strip the payment_url from a V1 RetrievePayment (RetrievePayment) which includes the transaction_id at the end of the URL: https://squareup.com/dashboard/sales/transactions/TRANSACTION_ID. This is more efficient as you won't need to loop through transactions, and allow you to send it straight to RetrieveTransaction.

How do I access all the information for a Square transaction?

I am a student (so I am pretty new to all of this stuff) trying to create a database for a coffee shop that uses Square for their register and website. I want the database to update with all the information from a transaction every time one is completed.
I have a webhook that gets me the IDs every time a transaction completes, I can send the transaction ID to the Square API with an http request and get back information about the payment, but I still cannot figure out how to get the rest of the transaction information. We want to query the database about what kinds of items are being sold when and with what modifiers, but so far the only way I can get that is through downloading a csv file with the item line information from the Square Dashboard.
If there is a way to get the line item information in some kind of way that can be automatically added to the database, I would really appreciate the help. I have been looking for a solution and cannot find it on my own.
For in-person payments the only way to see itemizations is to use V1 ListPayments (or RetrievePayment).
In order to see itemizations for online payments, you must utilize Square's Orders API. The workflow would be:
Create an order (CreateOrder) with line_items (can be ad-hoc, or use Catalog ids). Save the order_id for the next step.
When calling Charge, pass in the order_id from the previous step.
Once you are successfully attaching the order_id's, when you retrieve a transaction you will be able to call the BatchRetrieveOrders endpoint with the order_id to see the itemizations.
References:
V1 Payments
Orders Overview
Orders Reference

ebay getOrders API

I am building a .net service to getOrders from ebay. my service runs fine, however I dont know how should I handle data.
For example I am using CreateTimeTo and CreateTimeFrom Filter to return orders from past 24 hours. I save them into my database, now some orders return no Address info.
My question is, Whats the best way to hadnle/update already imported orders into my database. Say for example order imported into my system wa without shiping info, and customer completed shipping info after a week, how would I update that order in my system?
Thanks
I would definitely use modtimefrom modtimeto filter. Ih this way you can get all order that have been modiefied in last "x interval". This way you will get either new orders and modified (checkout complete - paid - shipped) and so on. My favourite filter anyway is NumberOfDays. This one acts as ModTimeFrom/ModTimeTo but is way more simple and you don't have to deal with dates.
An order without address means buyer has not completed checkout (no payment selected so no shipping address as well yet).
Once buyer completes checkout or order is mark as paid the entire address will be avaible.
You can get buyer default address shipping by using call GetSellerTransaction
I hope i understood your question and to be helpful.