Search code examples
oauthtokenaccess-tokenrefresh-tokenzoho

How to call zoho invoice rest api after access and refresh token?


I am following the steps mentioned in https://www.zoho.com/invoice/api/v3/oauth/#overview able to get access token and refresh token.

and not clear what to pass for invoice rest API for example How to get the list of invoices?


Solution

  • Zoho's documentation has an example call to list invoices : https://www.zoho.com/invoice/api/v3/invoices/#list-invoices

    curl https://invoice.zoho.com/api/v3/invoices
    -H "X-com-zoho-invoice-organizationid: 10234695"
    -H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"
    

    So it looks like you will need to pass 2 items of information to get a list of invoices:

    1. Your zoho-invoice-organizationid
    2. Your access token

    Here is a pseudo-code example with the 2 items in curly-brackets

    curl https://invoice.zoho.com/api/v3/invoices
    -H "X-com-zoho-invoice-organizationid: {my-zoho-invoice-organizationid}"
    -H "Authorization: Zoho-oauthtoken {my-access-token}"