I have a web form written in PHP adding users to Splynx, at the time of filling out the web form we take a payment.
I would like to have this payment and invoice created automatically inside Splynx and I am wondering how to achieve this with the API.
I have previously successfully created payments using the API as per Trouble creating payment with API
However I would like to do the following:
Have an invoice be generated and instantly paid (out of credit in splynx is ok because I can use API to generate a payment for the invoice value)
I am not sure what order I should do things in:
Eg. do I need to create a transaction at all? or is it enough to make a payment first for the invoice amount and then generate an invoice to be automatically paid from remaining credit?
If you could please provide some example of the API syntax for invoice and/or transaction that would be very helpful.