Title: custom post type invoices -&gt; Empty array
Last modified: March 19, 2019

---

# custom post type invoices -> Empty array

 *  Resolved [Dieter Schummer](https://wordpress.org/support/users/ds888/)
 * (@ds888)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/)
 * Hi,
    with WP Rest API Controller endpoint to [https://demo.einfach-gutschein-verschenken.de/wp-json/wp/v2/invoice](https://demo.einfach-gutschein-verschenken.de/wp-json/wp/v2/invoice)
 * custom post type invoice -> empty array
 * Any ideas?
 * invoices was creted with Woocommerce Germanized Pro Plugin
 * Thanks & Regards
    Dieter
    -  This topic was modified 7 years, 2 months ago by [Dieter Schummer](https://wordpress.org/support/users/ds888/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-post-type-invoices-empty-array%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11330848)
 * Hi Dieter,
 * Are you on the latest version of our plugin (v2.0.0)? If so, have you changed
   anything in the Rest Controller since updating? You shouldn’t need to, but if
   you haven’t done any changes since the update, can you go to the Rest Controller
   settings page and update everything? I just want to make sure there’s not an 
   issue with our plugin’s data before and after the update.
 * A few other things… Are your invoices published posts? (i.e. what is the post
   status of the posts in that CPT?)
 * Who is responsible for creating the invoice CPT? Is it something you’ve written
   or is it registered by a plugin?
 * Is our plugin working for any of your other CPTs?
 * Let me know.
 * Thank you,
    Kevin.
 *  Thread Starter [Dieter Schummer](https://wordpress.org/support/users/ds888/)
 * (@ds888)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11330903)
 * Hi Kevin,
    yes we have the latest plugin version 2.0.0 and we have nothing changes.
   This is a new plugin installation for testing the custom post endpoints.
 * Invoices are not published posts. We have try to call with consumer_key and consumer_secret.
 * It works for example with this cpt
    [https://demo.einfach-gutschein-verschenken.de/wp-json/wp/v2/product](https://demo.einfach-gutschein-verschenken.de/wp-json/wp/v2/product)
 * Thanks & Regards
    Dieter
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11330940)
 * Hi Dieter,
 * If they’re not published posts, do you know what their post status is? I’m referring
   to the column in the `wp_posts` table – this one: [https://developer.wordpress.org/reference/classes/wp_query/#status-parameters](https://developer.wordpress.org/reference/classes/wp_query/#status-parameters).
 * Let me know,
    Kevin.
 *  Thread Starter [Dieter Schummer](https://wordpress.org/support/users/ds888/)
 * (@ds888)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11330961)
 * Hi Kevin,
    the post status for the invoices are wc-gzdp-paid or wc-gzdp-pending.
 * Thanks & Regards
    Dieter
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331010)
 * I am not sure what’s happening but I don’t think it’s a result of our plugin.
   I think there is something in your Invoice post type that is preventing it from
   being added to the REST API. I’ve tried a few things but I can’t seem to figure
   it out yet.
 *  Thread Starter [Dieter Schummer](https://wordpress.org/support/users/ds888/)
 * (@ds888)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331037)
 * Hi Kevin,
    maybe it helps i can give you admin access to the site?
 * Thanks & Regards
    Dieter
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331041)
 * Sure – feel free to email us at plugins [at] yikesinc [dot] com 🙂
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331525)
 * Hi Dieter,
 * I’ve reviewed your site and I still think the issue is with the post status. 
   I’m trying some things locally and if I have a CPT that doesn’t have published
   posts, the WP REST API result will return an empty array.
 * Can you perhaps change one of your invoices to the “publish” status to see if
   that changes things?
 * Let me know.
 * Thank you,
    Kevin.
 *  Thread Starter [Dieter Schummer](https://wordpress.org/support/users/ds888/)
 * (@ds888)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331629)
 * Hi Kevin,
    i don’t know how i can change invoices to “publish”.
 * I will send this to Denis (Woocommerce Germanized Pro Plugin) and ask him where
   can we do that.
 * Thanks & Regards
    Dieter
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331648)
 * Ah, I see.
 * I think you’re going to need to write a custom query to fetch invoices rather
   than rely on WordPress’ default REST API behavior.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘custom post type invoices -> Empty array’ is closed to new replies.

 * ![](https://ps.w.org/wp-rest-api-controller/assets/icon-256x256.png?rev=2489942)
 * [WP REST API Controller](https://wordpress.org/plugins/wp-rest-api-controller/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-rest-api-controller/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-rest-api-controller/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-rest-api-controller/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-rest-api-controller/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-rest-api-controller/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-invoices-empty-array/#post-11331648)
 * Status: resolved