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.
Is this the right guide for you?
This page describes how to construct HTTP web requests. The intended audience is software developers. Use this survey to find the best method of adding inventory:
Find out which method is right for you
Answer a few questions and find out which method will work best for your dealership.
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.
Plugin | Where to get | What it is |
inventory-presser | https://wordpress.org/plugins/inventory-presser/ | The core dealership plugin. Registers the vehicle post type, meta fields, and taxonomies. |
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. |
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.
Sample Requests
Use Basic Auth to provide the user name and application password you created earlier during POST
or DELETE
requests.
Vehicle Requests
Use the list of meta fields and an example vehicle post to build requests.
Insert a Vehicle
POST
https://fridaydemo.wpengine.com/wp-json/wp/v2/inventory
List 100 Vehicles
GET
https://fridaydemo.wpengine.com/wp-json/wp/v2/inventory?per_page=100
Retrieve or Update a Specific Vehicle
POST
to update a vehicle by post ID. GET
to retrieve a vehicle by post ID.
POST
/GET
https://fridaydemo.wpengine.com/wp-json/wp/v2/inventory/8171
Media Requests
Insert a Photo
Specify the meta fields on attachments and the parent post in the body of the request.
POST
https://fridaydemo.wpengine.com/wp-json/wp/v2/media
Retrieve or Update a Specific Photo
POST
to update a photo with the attachment post ID. GET
to retrieve an attachment by post ID.
POST
/GET
https://fridaydemo.wpengine.com/wp-json/wp/v2/media/75370
List 100 Photos of a Specific Vehicle
Requires authentication.
GET
https://fridaydemo.wpengine.com/wp-json/wp/v2/media?parent=8171&page=1&per_page=100