Search code examples
phpapiquoteinfusionsoft

Create Order for a shipping quote in Infusionsoft


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?


Solution

  • 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.