0

I'm developing a shipping site where user inputs origin zip code and destination zip code. The input passes through an API which gets all the available Shippers for that route. The user selects one from that. Now I want to create an Infusionsoft order for it. I looked into https://developer.infusionsoft.com/docs/read/Order_Service#placeOrder but could not find a way to make a product as my shippers differ with routes and also their costs changes. Can any one help me on how will I create an Order for it?

newCodex
  • 72
  • 9

1 Answers1

2

Since you need more flexibility than placeOrder, you'll need to use the InvoiceService. The general process of creating an order will look like the following:

  1. Create an InfusionSoft Contact (or get and update, if the contact already exists)
  2. Create a Blank Order in InfusionSoft (through the Invoice API...not the Order API)
  3. Validate the credit card
  4. Add the card to the database
  5. Add product to invoice (with any product-specific discount IDs). This will be done via addOrderItem.
  6. Add the shipping to the invoice (can also be done via addOrderItem)
  7. Charge the invoice

Of course, you may need to add, remove, or modify steps to fit your use case.

rnevius
  • 26,578
  • 10
  • 58
  • 86
  • @newCodex, if this answers your question, please upvote/select it. Thanks. – rnevius Nov 01 '14 at 11:40
  • @mevius, Everything is going smooth till step 3.For step 4, I think we have to use Data service for it and the codes goes like:[code]$ccDat = array('CardType' => 'Visa', 'ContactId' => $cid, 'CardNumber' => "4111111111111111", 'ExpirationMonth' => '12', 'ExpirationYear' => '2015', 'CVV2' => '123'); $ccID = $app->dsAdd("CreditCard", $ccDat);[/code]. If this is right, then is it safe to pass CC details to IF via my site as my site does not have SSL? Is it compulsory to have SSL for pass ing data to IF?Any alt. solution to it? – newCodex Nov 03 '14 at 13:50
  • You're correct about needing to use dsAdd. This is preferably done after using `$app->validateCard()` to ensure it's valid. You'll definitely want to have an SSL cert for this. – rnevius Nov 03 '14 at 13:55