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

How to retrieve values of Custom Fields from the Invoice objects? #9

Open
alexsherstinsky opened this issue Feb 27, 2014 · 6 comments

Comments

@alexsherstinsky
Copy link

Dear Author of the Zoho_Invoice Gem:

I am a very happy user of this gem -- thanks so much for making it available!

I hope you can help me with this question. Our Invoice records utilize Custom Fields, and I was trying to retrieve the values of these Custom Fields via the zoho_invoice gem utilities; however, I have not been able to figure out how to do that. Is there a way to do so? If yes, could you please share it with me? Or is this the limitation of the underlying Zoho Invoice XML API itself? I have sent an inquiry to their support, but have not heard back yet.

Thank you for your help.

Sincerely,
--Alex Sherstinsky

@neovintage
Copy link
Owner

Right now it's not possible to get information out of the custom fields on the invoice. The base class requires that we be explicit about the fields that are getting returned. My use case at the time didn't include custom fields but I'd be happy to accept a pull request that had that functionality.

@alexsherstinsky
Copy link
Author

Hi, Rimas:

Thank you for replying to me!

Here is the information that the Zoho team gave me:

The API documentation is currently not updated with the documentation for
custom fields. Sorry for the confusion, we will update the documentation
soon. However, the procedure to retrieve the values for invoice custom
fields is simple. Take a look at the explanation below:

The API URL to get the custom fields for the invoices is :

https://invoice.zoho.com/api/v3/settings/customfields/invoice?authtoken=
&organization_id=<organization_id>

Sample response:

  1. {
  2. "code": 0,
    
  3. "message": "success",
    
  4. "customfields": [
    
  5.     {
    
  6.         "index": 1,
    
  7.         "show_in_all_pdf": false,
    
  8.         "label": "custom_label_1"
    
  9.     },
    
  10.     {
    
  11.         "index": 2,
    
  12.         "show_in_all_pdf": false,
    
  13.         "label": "custom_label_2"
    
  14.     },
    
  15.     {
    
  16.         "index": 3,
    
  17.         "show_in_all_pdf": true,
    
  18.         "label": "custom_label_3"
    
  19.     }
    
  20. ]
  21. }

For every GET URL, you will be required to pass parameters like _authtoken_and

organization_id.

I would be happy to try to add this to your gem and then issue a pull
request. Could you please help me by telling me which classes I should be
looking at in order to accomplish this?

Thanks again.

Sincerely,
--Alex

On Tue, Mar 4, 2014 at 2:00 PM, Rimas Silkaitis [email protected]:

Right now it's not possible to get information out of the custom fields on
the invoice. The base class requires that we be explicit about the fields
that are getting returned. My use case at the time didn't include custom
fields but I'd be happy to accept a pull request that had that
functionality.

Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-36683884
.

@alexsherstinsky
Copy link
Author

Dear Rimas:

I created a pull request. Please consider it. It was a lot of fun
learning and working with your gem, while upgrading it to Zoho V3 API.

Thank you.

Sincerely,
--Alex

On Tue, Mar 4, 2014 at 2:53 PM, Alex Sherstinsky <
[email protected]> wrote:

Hi, Rimas:

Thank you for replying to me!

Here is the information that the Zoho team gave me:

The API documentation is currently not updated with the documentation for
custom fields. Sorry for the confusion, we will update the documentation
soon. However, the procedure to retrieve the values for invoice custom
fields is simple. Take a look at the explanation below:

The API URL to get the custom fields for the invoices is :

https://invoice.zoho.com/api/v3/settings/customfields/invoice?authtoken=
&organization_id=<organization_id>

Sample response:

  1. {
  2. "code": 0,
    
  3. "message": "success",
    
  4. "customfields": [
    
  5.     {
    
  6.         "index": 1,
    
  7.         "show_in_all_pdf": false,
    
  8.         "label": "custom_label_1"
    
  9.     },
    
  10.     {
    
  11.         "index": 2,
    
  12.         "show_in_all_pdf": false,
    
  13.         "label": "custom_label_2"
    
  14.     },
    
  15.     {
    
  16.         "index": 3,
    
  17.         "show_in_all_pdf": true,
    
  18.         "label": "custom_label_3"
    
  19.     }
    
  20. ]
  21. }

For every GET URL, you will be required to pass parameters like

authtoken and organization_id.

I would be happy to try to add this to your gem and then issue a pull
request. Could you please help me by telling me which classes I should be
looking at in order to accomplish this?

Thanks again.

Sincerely,
--Alex

On Tue, Mar 4, 2014 at 2:00 PM, Rimas Silkaitis [email protected]:

Right now it's not possible to get information out of the custom fields
on the invoice. The base class requires that we be explicit about the
fields that are getting returned. My use case at the time didn't include
custom fields but I'd be happy to accept a pull request that had that
functionality.

Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-36683884
.

@rept
Copy link

rept commented Oct 17, 2014

@alexsherstinsky do you have your adjusted v3 code available as a fork as well? I'm looking everywhere (in the current gem) how to retrieve a single invoice by just using the id, according to the API it should be very easy, like doing
a get on /invoices/562674000000045111 but I can't see how that's implemented in the gem and there is no documentation.

@neovintage
Copy link
Owner

@alexsherstinsky Thanks for doing that. I'll look through the pull requests and make comments there.

@alexsherstinsky
Copy link
Author

Thank you! Looking forward to learning if it was done well enough to be
integrated in your code, or if you would do it differently. Sincerely,
--Alex

On Tue, Nov 11, 2014 at 6:37 AM, Rimas Silkaitis [email protected]
wrote:

@alexsherstinsky https://github.com/alexsherstinsky Thanks for doing
that. I'll look through the pull requests and make comments there.


Reply to this email directly or view it on GitHub
#9 (comment)
.

Alex Sherstinsky
MustExist, Inc. (http://www.mustexist.com/)
[email protected]
Skype: AlexSherstinsky
http://twitter.com/AlexSherstinsky
650.260.3913
http://www.linkedin.com/in/alexsherstinsky

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

3 participants