Ecommerce Shopify WordPress Discussion

Send data via API after a WooCommerce sale

I am pretty new to API's and can't figure this out! I have courses on Moodle which I sell via Wordpress / woocommerce. Upon a successful sale I need to automatically enrol the user to Moodle. To do this I have been given a post url and data fields in json. The link looks like this: And this is the body text I need to send to it: { "users": [ { "email": XXXX, "firstname": "test", "lastname": "user", "courseid": "2", "address1": "address line 1", "address2": "address line 1", "addresscity": "city", "addresspostcode": XXXX, "addresscounty": XXXX, "addresscountry": "GBR", "dob": "20200629" } ] } I have no idea to integrate this into a function. I have created a plugin to get the data I need and I have the my_order_complete_function( $order_id ) function ready - I just have no clue how to then instruct it to send the body json data to the url. Any help would be greatly appreciated. Thank you.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.