1

I'm developing a Wordpress 4.8 site using Angular in a custom theme and needing to save data from my registration Angular model to the Wordpress API for server side storage in the database.

All of the forms, routes and user interface is built within the Angular 5 theme I'm creating. I'm at the point where I need to send data to the WP REST API but need guidance in terms of which endpoint(s) to use for proper storage of this custom data? Fields are over and above typical user metadata and will also need to know which endpoint to use in sending payment data through the REST API.

Should custom endpoints be created to handle the registration and payment processes? If so, does Wordpress have a designated database table structure and the ability to extend the API to handle these use cases?

0

1 Answer 1

1

I'm not a WP API expert.

It sounds like you want to store more information than the API supports, so you will need to add an endpoint - https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/

If you are doing payment processing, I assume you are using a service or plugin + service for that, so you may want your custom endpoints to interact with those DB structures that the plugin creates. (maybe you are using https://wordpress.org/plugins/stripe/ for instance?)

In addition to that, you probably want to update something else on your site, like what they purchased, or what abilities they have now that they have purchased it. So that might mean more endpoints and more DB structures.

--

Wordpress does not have API endpoints that save/load data (like parse or something would.) So you would need to create that by hand.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.