API setInvoice
After a purchase is completed, Stripe sends the transaction details to our API in Strapi at the endpoint /api/stripe-webhook-handler. This triggers
the creation of a new record in the collection. Once the record is created, a lifecycle event sends a webhook to Zoho. Zoho then generates an invoice in Zoho Books
to associate the Stripe transaction with the corresponding Books invoice. To facilitate this process, we have developed an API for Zoho to send this information.
Below, we will provide a detailed explanation.
API Details
The API can be accessed using the Strapi URL with the endpoint /api/setInvoice via a POST request. This API will only be available if the specific token, referred to in Strapi as Zoho Invoice, is provided. Additionally, the following parameters must be included in the request:
{ "email": "", "number_order": "", "id_invoice": ""}These parameters ensure the correct association of the Stripe transaction with the Zoho Books invoice, allowing a seamless integration between the two systems and saving it in Strapi.