We’d need a lot more info to look at this, can you send us an email contact@invoiceninja.com along with what you were doing, and what you were expecting?
The webhook just sends a payload of data, so i don’t think you would receive a 500 from that?
We’ll handle it in our application. But question is why payment is allowed in IN for an expired subscription ?
What changes do we need to make in subscription, so that it wont expire for a long time ?
Another question, what are other type of such requests? I did ask the same question earlier (below link) and still didnt get the answers. We’ll need list of all possible events, so that we can handle it in our application.
With “plan_expired”, we’ll have to spend few more hours in implementing it followed by a testing of all the cases (even for tests that passed earlier). Hope you understand the point about efforts in rework/retest and share the list of all the events, so that we can analyse all together and plan our work accordingly. And yes, it will also minimize question for you guys from our end.
case 'trial':
case 'recurring_purchase':
case 'single_purchase':
case 'change_plan':
case 'cancellation':
case 'is_eligible':
case 'plan_expired':
case 'plan_paid':
You can set the subscription to expired based on the frequency of the subscription
Thanks for the information and sorry for delayed reply.
We have implemented webhooks for different contexts to support multiple companies.
We noticed another issue. Let me brief you about it.
We have two companies configured. We configured few subscriptions along with a webhook for both the companies. We are also getting requests whenever client from either company made a payment for a subscription. Application is invoking respective apis (for ex. login, clients, statics, logout etc) using companies url. For one company say (FG Testing), we are getting client information for the client mentioned in a webhook. However, for another company (FG NA1), we are getting below response whenever we invoke the api (https://company2.invoicing.co/api/v1/clients/Ab123c4de5).
{“message”:“You are not authorized to view or perform this action”}
Could you please help us to understand what could be a reason for this error?
Please note that before invoking client api, application is signing in with login api (https://company2.invoicing.co/api/v1/login).
Are we missing any configuration in a company2 to enable to apis or anything else ?
Application follows below steps to process the webhook for all the companies.
Get the token using login api
Fetch the static info (for ex Countries) using statics api by supplying the token generated from the step 1.
Signs out using logout api.
Get the token again using login api
Get the client info using clients/{id} api by using the token received from step 4.
Signs out using logout api.
Application processes further based on the details received from step 5.
Above steps works for Company 1, but we are getting aforementioned message (You are not authorized to view or perform this action) in step 5 for Company 2.
Please do let us know if you want us to share more details.
No, we are retrieving token before every request as mentioned earlier. We also using company specific URLs to invoke the APIs. So, using other company’s token is not a case here, hence we wrote to you.
Thing is everything working as expected for Company1, but client API doesnt return client info for Company2 (only step 5 in above steps).
Any pointers ? Let us know if you need more ddetails.
Could you please provide pointers on our issue ? We have set up 2 companies. Application is processing payment for clients for both the companies with company specific urls as mentioned below. We dont see any issues for company1. But we see “unauthorised to perform” error for company2.
Yes. Different URLs, based on company subdomain, for different companies. Its working fine with first company, so we enhanced our application to support multiple company.
Based on your reply, this is not the right way. We understood the url will remain same for all companies but token will be different for each company. If so, please help us for below:
Quick update. We made the changes in our application based on your valuable inputs and it worked well. Application is receiving webhook requests without any error related to authorization (as mentioned in the earlier messages).
However, we noticed below for the request received for different companies.
Company1 - No issue in our application as well as in IN. Smooth processing.
Company2 - No issue in our application. But on IN, we see error 500 even after success response from our application.
Could you please help us by providing any pointers ? Any issue related to timeout? Earlier we were not reaching to this stage bcaz of authorization error, now we made progress, but got error 500 only for company2. Hence we’ll need your inputs.