• Resolved afrolottogh

    (@afrolottogh)


    I am working on a Raffle Lottery WordPress site (https://afrolottogh.com/) which runs on the WooCommerce Lottery and WooCommerce Lottery Pick Number plugins. I am trying to externally make ticket orders or purchases to the site using the WordPress REST API Endpoint for order requests.

    I aim to have the plugin automatically assign lottery ticket numbers to orders made via the API based on the order quantity.

    Could someone provide guidance or examples on how to structure order requests using the WP REST API in a way that aligns with the WooCommerce Lottery plugin’s ticket assignment mechanism? Any insights or code snippets would be greatly appreciated.

    So I tested out the order request via the WP REST API and realized that in using the WordPress REST API Endpoint to make orders to the lottery site, ticket selection or assigning is not possible.

    Orders made via the API are created successfully but then no ticket is assigned and when you check the lottery history tabs all purchases or orders via the API have ZERO as their ticket numbers.

    But for ticket purchases or orders made directly on the site, everything works as it should

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @afrolottogh,

    To assign lottery ticket numbers to orders made via the API, you would need to modify the order data before creating the order through the API. The WooCommerce Lottery plugin probably uses specific metafields to store the ticket number information.

    You can check the order metadata of a manually created order in the WordPress admin to see what metafields are being used. Once you find the correct meta fields, you can add them to your API request.

    However, if the plugin automatically generates the ticket numbers, you may need to create a custom endpoint or modify the existing one to support this feature. This would require custom coding, which is beyond the scope of our support.

    Also, since these are third-party plugins which we don’t provide support for (please see our Support Policy), it would be best to reach out to the plugin’s developers for further assistance. I am sure they will have no problem supporting you there.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter afrolottogh

    (@afrolottogh)

    Thanks so much for the info @shameemreza

    Much appreciated

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @afrolottogh,

    I’m glad we were able to help! I will mark this thread as resolved. Should you have further inquiries, kindly create a new topic here.

    Meanwhile, if it isn’t too much to ask for – would you mind leaving us a review here?

    It only takes a couple of minutes but helps us tremendously. It would mean so much to us and would go a really long way.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Make Order Requests with WP REST API to Utilize WooCommerce Lottery Plugins’ is closed to new replies.