This question may come off as too vague, and it's very possible it has been answered before, but possibly due to lack of correct terminology, I wasn't able to find anything.
We're building out some automation so that when an Opportunity's StageName is changed to a Closed/Won type, a 3rd party script is being called that should do specific things:
- Generate promo codes for the purchased products that are used in a separate website (in this case, they are promo codes for certification exams for our products)
- Email the client the promo codes
To clarify, this isn't an Apex Class or Lightning Component generating these codes as they aren't equipped to create codes that would be valid on our site.
When the specific criteria on the Opportunity is met, we also need to send certain field values over to the script in order for the script to know which promo codes need to be generated (i.e. which certification exams want to be taken).
So SFDC's role would be to house the data on the certifications being purchased and then send that data through an API call to this 3rd party script, and nothing more.
My question is this: is it possible to accomplish this through a process builder? I'm expecting the process builder to call some aura enabled Apex method that, in turn, would make the external API call, but I'm not sure if it's possible to do it that way or if it has to be in a trigger?
I apologize if this question comes off as ignorant to how external API calls are supposed to work, but I guess that's why I'm asking this question. :)
If I need to add more information to clarify what I'm trying to do, I can do that! Thanks!