Creating an Order with ruby + xml-rpc

Hey All,

I’m trying to add a record to come up in this screen.

From my understanding (please note that I’m new to InfusionSoft (IS) API), I need to create an Order.

To create an Order , I will have to use the Create Order XML-RPC endpoint.

My app is using ruby/rails and I’m trying to do this with ruby.

From my understanding, currently this is not supposed by the infusionsoft ruby gem, so , I’ve checked the ruby example given and followed the example given

This was my first attempt

key = '<Secret Key>'
server = XMLRPC::Client.new2("https://lr300.infusionsoft.com:443/api/xmlrpc")

order = {
"contactID" => 232,
"cardID" => 0,
"productIDs" => ["2"],
"subscriptionIDs" => [],
"processSpecials" => false,
"promoCodes" => [],
"leadAffiliateID" => 4,
"saleAffiliateID" => 0
}
result = server.call("OrderService.placeOrder", key, order)

and I get the following error from the API

XMLRPC::FaultException: No method matching arguments: java.lang.String, java.util.HashMap

This is my second attempt

# same code as above but the call is different
result = server.call("OrderService.placeOrder", <key>, 232, 0, 0, [2], [], 0, [], 4, 0)

and I got

XMLRPC::FaultException: No method matching arguments: java.lang.String, java.util.HashMap

Can I get a help on what is this error means and how can I resolve this.

PS: I couldn’t find any document relating the error codes we are getting etc…

Thanks in advance

So the message you’re getting is definitely due to mis-match in parameters. I believe what you’re missing is the plan id which normally comes before the product id in the parameter list.

Thanks for the quick response @John_Borelli

I’ll check the params again. Do you think I’m sending the empty arrays correct ?

About plan id, from the document I read

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

Thats why I passed 0 assuming it will pick the default plan. BTW, is there an API endpoint that I can see/get all the plans. I’ve check REST and XML-RPC docs and couldnt come up with anything that looks related to getting Plan

Thanks in advance

So this —>

is what I’m referring to but if you’re getting that response with alternate attempt then I think the fields need to be an array not a list of parameters…which is what java.util.HashMap refers to