Jump to content

Jogex

Newbie
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jogex

  • Rank
    Junior Member
  1. Thanks for the reply ­čśä Yeah the API ecosystem has its flaws it seems. I ended up scaping the entire API integration and will rely on basic SQL queries again. I managed to find the proper relation between an invoice and the product SELECT tblhosting.id as 'rel_id', tblhosting.orderid as 'order_oid', tblproducts.name as 'product_name', tblproducts.id as 'product_id', tblhosting.userid as 'user_id' FROM tblhosting INNER JOIN tblproducts on tblhosting.packageid = tblproducts.id WHERE tblhosting.id = ? Who would have thought the PACKAGE id refers to the PRODUCT id? ­čśé
  2. Hi, I'm going crazy trying to figure out how to properly get an order from the GetOrders call. We have a webhook running on accepted orders, and there are some jobs that only runs on a few select products. So we need to stop orders that shouldn't dispatch these jobs. This is the current logic. An order is accepted A webhook runs the API call GetOrders({orderId}) on the order. We loop through $order->lineitems->lineitem Each lineitem contains a relid. Previously we have taken this, and done a DB lookup on tblcustomfieldsvalues and joined the tblproducts table, which would give us a product name and ID. Then we match the product ID with a list of accepted product IDs. Currently, I'm stuck at step 4. It's been working well for a while, but after we removed some custom fields on the products (not sure if that's the actual cause) it's started returning an empty queryset. I'm not kidding... The relid does not exist in the tblcustomfieldsvalues table AT ALL. So I figured using the API would solve my issues since it's obviously somehow getting the product ID and name when browsing the order. From what I gather, the ID in "/clientsservices.php?userid=1&id=99" is the relid right? But from the looks of it, the API result does not contain the product ID. Which I find odd, as the API call for products (GetProducts) accepts a product ID (pid). It's kind of useless right now without that ID. I'm hoping I'm missing something obvious here. Any help would be greatly appreciated. Also, I hope I posted this in the correct section of the community. With kind regards
  3. Welcome to WHMCS.Community Jogex! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated