Module: Infusionsoft::Client::Order

Included in:
Infusionsoft::Client
Defined in:
lib/infusionsoft/client/order.rb

Overview

The Order service allows you to create a new Order.

Instance Method Summary collapse

Instance Method Details

#place_order(contact_id, card_id, plan_id, product_ids, subscription_ids, process_specials, promo_codes, lead_affiliate_id, sale_affiliate_id) ⇒ Hash

Creates a new order.

Parameters:

  • contact_id (Integer)

    ID of the order’s Contact (0 is not a valid ID).

  • card_id (Integer)

    ID of the card to charge. To skip charging a card, set to “0”.

  • plan_id (Integer)

    ID of the payment plan to use when creating the order. If not specified, the default plan is used.

  • product_ids (Array<Integer>)

    A list of integers representing the products to add to the order. This cannot be emtpy if a subscription is not specified.

  • subscription_ids (Array<Integer>)

    A list of integers representing the subscription(s) to add to the order. This cannot be empty if a product ID is not specified.

  • process_specials (Boolean)

    Whether or not the order should consider discounts that would normally be applied if this order was placed through the shopping cart.

  • promo_codes (Array<String>)

    Promo codes to add to the cart; only used if processing of specials is turned on.

  • lead_affiliate_id (Integer)

    ID of the lead affiliate (0 should be used if none).

  • sale_affiliate_id (Integer)

    ID of the sale affiliate (0 should be used if none).

Returns:

  • (Hash)

    The result of order placement with IDs of the order and invoice that were created and the status of a credit card charge (if applicable). => [Boolean], ‘Message’ => [String], ‘RefNum’ => [String], ‘OrderId’ => [String], ‘InvoiceId’ => [String], ‘Code’ => [String]



34
35
36
# File 'lib/infusionsoft/client/order.rb', line 34

def place_order(contact_id, card_id, plan_id, product_ids, subscription_ids, process_specials, promo_codes, lead_affiliate_id, sale_affiliate_id)
  response = xmlrpc('OrderService.placeOrder', contact_id, card_id, plan_id, product_ids, subscription_ids, process_specials, promo_codes, lead_affiliate_id, sale_affiliate_id)
end