The Inventory Presser dealership plugin was built with a feed-first mentality. Our software & services company feeds inventory updates and photos to hundreds of sites each day. Here’s how we fine-tune sites for efficient Vehicle Post Type updates using the WordPress REST API.
💡 All the usual methods of importing and updating post data will work, too. Inventory Presser vehicles are posts, and plugins like WP All Import can import flat files and populate post meta values.
If you want to build a WordPress REST API client to update vehicles, here’s what we do at Friday Systems…
Install and activate plugins
These essential plugins are required to connect and update the vehicle data.
The REST API provides remote access to the WordPress post object. We extend the REST endpoints for posts and attachments to provide finer control over meta fields on posts and terms. We also need API access to
|Plugin||Where to get||What it is|
|inventory-presser||https://wordpress.org/plugins/inventory-presser/||Our core dealership plugin. We plan to submit to wordpress.org soon, please use this link for now.|
|wp-api-manipulate-meta||https://github.com/csalzano/wp-api-manipulate-meta||Adds routes to the REST API to read, write, and delete post and term meta values separately from posts and terms.|
|wp-api-add-post-parent||https://github.com/csalzano/wp-api-add-post-parent||Adds a field `parent` to the /v2/posts and /v2/media routes of the WP API that allows API clients to view and edit the post_parent attribute of these post types.|
Create a user and Application Password for authentication during updates
We create an administrator user account that will not be used by humans. Then, we generate an Application Password for that user.
- Needs capabilities to insert, update, and delete posts, media attachments, and taxonomy terms.
- Needs an Application Password generated to authenticate requests to the REST API.
💡 Can’t find Application Passwords on your users? WordFence disables Application Passwords by default.
📋 If you’re a Friday Systems customer, you can stop here. Send us the site URL, user name, & application password, and we can begin updating the inventory.
Send requests to /wp-json/wp/v2/inventory
POST to insert a vehicle
Use Basic Auth to provide the user name and application password you created earlier during POST or DELETE requests.
GET a list of vehicles
Retrieve or update a single vehicle
POST to update a vehicle by post ID. GET to retrieve a vehicle by post ID.