【问题标题】:How to insert an order into Infusionsoft via API如何通过 API 将订单插入 Infusionsoft
【发布时间】:2013-09-26 09:30:25
【问题描述】:

我有将商品插入到订单中的代码,如下所示,

$ordId = 1;
$prodId = 221;
$type = '';
$price = 1000;
$qty = 5;
$desc =  DESC;
$notes = "test notes";
$test = $app->addOrderItem($ordId, $prodId, $type, $price, $qty, $desc, $notes);

是否有任何功能/方法可用于将订单直接插入 Infusionsoft?

【问题讨论】:

标签: infusionsoft


【解决方案1】:

如果您使用 InfusionSoft PHP SDK,您有几个选择。 (1) 使用OrderService API's placeOrder() function,(2) 对create a blank invoiceadd line itemscharge it 使用InvoiceService API。 OrderService API 是一个很好的一次性选择;但 InvoiceService 提供了更大的灵活性。

使用 OrderService.placeOrder

$order = $app->placeOrder(
                    (int)$contactId, 
                    (int)$creditCardId, 
                    (int)$payPlanId, 
                    (array(int))$productIds, 
                    (array(int))$subscriptionIds, 
                    (bool)$processSpecials, 
                    (array(str))$promoCodes
               )

注意:OrderService API 要求您已经通过ContactService API 添加了一个联系人,并通过DataService API 添加了一张信用卡(通过将其添加到CreditCard table)。

【讨论】:

    【解决方案2】:

    您可以使用订购服务。详情可以看这里http://help.infusionsoft.com/api-docs/orderservice

    【讨论】:

      【解决方案3】:

      check the complete code here

      $app = new iSDK();
      
      // perform authorization tasks
      
      $carray = array(
        $app->key,
        $contactId,  
        $creditCardId, 
        $payPlanId, 
        array($productId1, $productId2), 
        array($subscriptionPlanId1, $subscriptionPlanId2), 
        $processSpecials,
        array($promoCode1, $promoCode2)) // array of strings
      );
      
      $app->placeOrder($carray);
      

      【讨论】:

        猜你喜欢
        • 2014-11-29
        • 1970-01-01
        • 2012-01-31
        • 2017-10-14
        • 1970-01-01
        • 1970-01-01
        • 2021-09-02
        • 2012-06-10
        • 1970-01-01
        相关资源
        最近更新 更多