Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get order comment via API call #15

Closed
affirmative-pl opened this issue Feb 7, 2018 · 15 comments
Closed

get order comment via API call #15

affirmative-pl opened this issue Feb 7, 2018 · 15 comments

Comments

@affirmative-pl
Copy link

Is it possible to download order comment using API?

I'm not an expert unfortunately, but the company that develops an application for me, claims it is not possible, making this module not feasible for my system.
Could you please confirm if this attribute is visible to API calls?

Many thanks!
Kate

@boldsidney
Copy link
Contributor

hi @affirmative-pl

I had a quick look, and it currently doesn't seem possible to retrieve the comment using API.

Let me know if you still need this functionality. I'll be able to make some time next week to add this functionality there is still a need for it.

@affirmative-pl
Copy link
Author

Hi,
we'd love to have the attribute available via API, but we also noticed, while testing the module, that the way it limits comment size is not very user-friendly. It allows entering more characters than the limit states, and displays an error message. When more traditionally limits like this simply do not allow entering more characters, making it instantly obvious to the user, what to do.

obraz

@boldsidney
Copy link
Contributor

hi @affirmative-pl ,
Thank you for your feedback regarding the comment limit functionality. I shall add it to my todo list for next week together with allowing the comments to be visible in the API.

@affirmative-pl
Copy link
Author

hi @boldsidney,
glad to hear you're going to take our feedback and enhance your module.
I look forward to the update.
Best wishes,
Kate

@boldsidney
Copy link
Contributor

hi @affirmative-pl ,
The update to 1.3.0 is now available.

The comment limit functionality should now work as you described and the comment is now visible through the /V1/orders/{id} route of the salesOrderRepositoryV1 API.

@affirmative-pl
Copy link
Author

Thanks @boldsidney
We'll give it a go!

@affirmative-pl
Copy link
Author

Hi @boldsidney
Unfortunately, we are not seeing the comments via /V1/orders/{id} route
Can you give us more details on this field, please
Thanks you
Kate

@boldsidney
Copy link
Contributor

hi @affirmative-pl ,
the data should be part of the extension_attributes field
field_in_api

@andrewbgittus
Copy link

Hi @boldsidney

Our client Nutri-gold has your addon and I believe they're the ones who requested this functionality. Within our product, Zynk, we're making a request to the GET /index.php/rest/default/V1/orders Magento endpoint but within the data we're receiving from the website the field 'bold_order_comment' doesn't appear within the extension attributes collection within the raw JSON data we receive from their site.

{ "items": [ { "applied_rule_ids": "1", "base_currency_code": "GBP", "base_discount_amount": 0, "base_discount_invoiced": 0, "base_grand_total": 69.92, "base_discount_tax_compensation_amount": 0, "base_discount_tax_compensation_invoiced": 0, "base_shipping_amount": 0, "base_shipping_discount_amount": 0, "base_shipping_discount_tax_compensation_amnt": 0, "base_shipping_incl_tax": 0, "base_shipping_invoiced": 0, "base_shipping_tax_amount": 0, "base_subtotal": 58.27, "base_subtotal_incl_tax": 69.92, "base_subtotal_invoiced": 58.27, "base_tax_amount": 11.65, "base_tax_invoiced": 11.65, "base_total_due": 0, "base_total_invoiced": 69.92, "base_total_invoiced_cost": 0, "base_total_paid": 69.92, "base_to_global_rate": 1, "base_to_order_rate": 1, "billing_address_id": 32, "created_at": "2018-04-05 09:05:19", "customer_email": "xxx@xxxxx.co.uk", "customer_firstname": "Kate", "customer_gender": 0, "customer_group_id": 2, "customer_id": 12098, "customer_is_guest": 0, "customer_lastname": "xxxxx", "customer_note_notify": 1, "discount_amount": 0, "discount_description": "Buy 3 Get 1 Free", "discount_invoiced": 0, "email_sent": 1, "entity_id": 17, "global_currency_code": "GBP", "grand_total": 69.92, "discount_tax_compensation_amount": 0, "discount_tax_compensation_invoiced": 0, "increment_id": "500000013", "is_virtual": 0, "order_currency_code": "GBP", "protect_code": "xxxxxxxxxx", "quote_id": 41, "remote_ip": "", "shipping_amount": 0, "shipping_description": "Service - Royal Mail 1st Class Packet Post", "shipping_discount_amount": 0, "shipping_discount_tax_compensation_amount": 0, "shipping_incl_tax": 0, "shipping_invoiced": 0, "shipping_tax_amount": 0, "state": "processing", "status": "processing", "store_currency_code": "GBP", "store_id": 1, "store_name": "Main Website\nMain Website Store\n", "store_to_base_rate": 0, "store_to_order_rate": 0, "subtotal": 58.27, "subtotal_incl_tax": 69.92, "subtotal_invoiced": 58.27, "tax_amount": 11.65, "tax_invoiced": 11.65, "total_due": 0, "total_invoiced": 69.92, "total_item_count": 4, "total_paid": 69.92, "total_qty_ordered": 5, "updated_at": "2018-04-05 09:05:44", "weight": 1.7893, "items": [ { ... }, { ... }, { ... }, { ... } ], "billing_address": { ... }, "payment": { ... ], "amount_ordered": 69.92, "amount_paid": 69.92, "base_amount_ordered": 69.92, "base_amount_paid": 69.92, "base_shipping_amount": 0, "base_shipping_captured": 0, "cc_last4": null, "entity_id": 17, "last_trans_id": "", "method": "realexpayments_hpp", "parent_id": 17, "shipping_amount": 0, "shipping_captured": 0 }, "status_histories": [ { "comment": "Invoiced amount of \u00a369.92 Transaction ID: ", "created_at": "2018-04-05 09:05:43", "entity_id": 65, "entity_name": "order", "is_customer_notified": null, "is_visible_on_front": 0, "parent_id": 17 }, { "comment": "Authorised amount of \u00a369.92 Transaction ID:", "created_at": "2018-04-05 09:05:43", "entity_id": 64, "entity_name": "order", "is_customer_notified": null, "is_visible_on_front": 0, "parent_id": 17 }, { "comment": null, "created_at": "2018-04-05 09:05:19", "entity_id": 63, "entity_name": "order", "is_customer_notified": 1, "is_visible_on_front": 0, "parent_id": 17, "status": "pending" } ], "extension_attributes": { "shipping_assignments": [ { "shipping": { "address": { ... }, "method": "xxxxxxxx", "total": { "base_shipping_amount": 0, "base_shipping_discount_amount": 0, "base_shipping_discount_tax_compensation_amnt": 0, "base_shipping_incl_tax": 0, "base_shipping_invoiced": 0, "base_shipping_tax_amount": 0, "shipping_amount": 0, "shipping_discount_amount": 0, "shipping_discount_tax_compensation_amount": 0, "shipping_incl_tax": 0, "shipping_invoiced": 0, "shipping_tax_amount": 0 } }, "items": [ ... ] } ] } } ], "search_criteria": { "filter_groups": [ { "filters": [ { "field": "increment_id", "value": "500000013", "condition_type": "eq" } ] } ], "page_size": 50, "current_page": 1 }, "total_count": 1 }

@boldsidney
Copy link
Contributor

hi @andrewbgittus,

That looks like the GET /V1/orders call, to display a list of orders.
Can you try with the GET /V1/orders/{id} call, I've only added the field to that one.

If the GET /V1/orders/{id} isnt usable for your workflow i could look into also adding it to the list view GET /V1/orders later at the end of this week.

@andrewbgittus
Copy link

That's definitely the cause of the issue, within Zynk we use the /index.php/rest/default/V1/orders endpoint as it means within integrations we can essentially request new orders without knowledge of the increment_id and then process these orders into the relevant system.

Thanks @boldsidney I'll pass this onto the client.

@dcabrejas
Copy link

dcabrejas commented Apr 10, 2018

Hi @boldsidney

Thank you very much for the module, it works great.
FYI we also find ourselves needing that field in the /rest/default/V1/orders endpoint for an integration.
I think it would be quite a nice addition to the module.

@danslo
Copy link
Contributor

danslo commented Apr 10, 2018

I have a pull request open for this: #18

@boldsidney
Copy link
Contributor

Hi @danslo thank you for building this feature.

@andrewbgittus , @dcabrejas
You can now update to version 1.4.0 to retrieve comments from the /V1/orders endpoint.

@dcabrejas
Copy link

Thanks @danslo @boldsidney

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants