Order creation + process

I’ve got an endpoint to create orders and the flow is:

  1. get refresh token
  2. validate all form input
  3. look up user by email
  4. if no email, create user
  5. add credit card to user
  6. create an order

However, it seems the order is in DRAFT if it costs anything more than 0.

Do I need to add a 7th step to process the order?

Thanks!

You need to initiate a payment on the order with Create Payment via POST via “charge_now”: true.

1 Like

Ok, so create a payment no problem.

How do I tie the payment to the order I’ve just created? There’s not schema info for that?

I could add the order_id to notes, but then do I need to update the order to be “paid”???

A bit confusing and I’m new to the API, I apologize

You pass the order ID in the URL like you pass the contact ID in the URL to create a credit card:

POST /orders/{orderId}/payments

Oh I see it now! Derp. Thanks!

I am trying to create a payment against an order in my developer sandbox using the REST API. Currently, I successfully:

  • Create a contact
  • Create a credit card
  • Create an order

I set up Stripe as a Payment Type. The credit card I created is a test card (4242 4242 4242 4242).

Using the interactive REST API documentation, I get a “no response from server” message.

Here is my request:

    {
  "apply_to_commissions": false,
  "charge_now": true,
  "credit_card_id": 13,
  "date": "2021-02-16T17:54:00.578Z",
  "notes": "",
  "payment_amount": "199.0",
  "payment_gateway_id": "5",
  "payment_method_type": "CREDIT_CARD"
}

My guess is that there actually is an error occurring—something to do with the fact that my credit card is not a real card (but a test card) and Stripe is attempting to process in production mode.

I also set up a WePay account. Neither Stripe nor WePay seem to have a way to switch to test mode. I know that Stripe can be set to test mode by using the test keys on my Stripe account, but how do I configure Infusionsoft to use those keys?

Do I have to use Authorize.net if I want to test?