# Order creation + process

**URL:** <https://integration.keap.com/t/order-creation-process/82015>\
**Category:** API Q&A\
**Created:** [February 2, 2021, 11:46pm UTC](https://integration.keap.com/t/order-creation-process/82015 "2021-02-02T23:46:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Smith](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/christopher_smith/32/12515_2.png) [@Christopher\_Smith](https://integration.keap.com/u/Christopher_Smith)\
**Post date:** [February 2, 2021, 11:46pm UTC](https://integration.keap.com/t/order-creation-process/82015/1 "2021-02-02T23:46:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![TomScott](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/tomscott/32/67_2.png) [@TomScott](https://integration.keap.com/u/TomScott)\
**Post date:** [February 9, 2021, 7:04pm UTC](https://integration.keap.com/t/order-creation-process/82015/2 "2021-02-09T19:04:56Z")

</div>

You need to initiate a payment on the order with [Create Payment via POST](https://developer.infusionsoft.com/docs/rest/#!/E-Commerce/createPaymentOnOrderUsingPOST) via “charge\_now”: true.

---

<div class="post-metadata">

**Author:** ![Christopher\_Smith](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/christopher_smith/32/12515_2.png) [@Christopher\_Smith](https://integration.keap.com/u/Christopher_Smith)\
**Post date:** [February 9, 2021, 7:49pm UTC](https://integration.keap.com/t/order-creation-process/82015/3 "2021-02-09T19:49:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Andrew\_Porter](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/andrew_porter/32/12615_2.png) [@Andrew\_Porter](https://integration.keap.com/u/Andrew_Porter)\
**Post date:** [February 16, 2021, 6:06pm UTC](https://integration.keap.com/t/order-creation-process/82015/4 "2021-02-16T18:06:04Z")

</div>

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](https://developer.infusionsoft.com/docs/rest/#!/E-Commerce/createPaymentOnOrderUsingPOST)

---

<div class="post-metadata">

**Author:** ![Christopher\_Smith](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/christopher_smith/32/12515_2.png) [@Christopher\_Smith](https://integration.keap.com/u/Christopher_Smith)\
**Post date:** [February 16, 2021, 6:19pm UTC](https://integration.keap.com/t/order-creation-process/82015/5 "2021-02-16T18:19:36Z")

</div>

Oh I see it now! Derp. Thanks!

---

<div class="post-metadata">

**Author:** ![Andrew\_Porter](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/andrew_porter/32/12615_2.png) [@Andrew\_Porter](https://integration.keap.com/u/Andrew_Porter)\
**Post date:** [February 17, 2021, 7:29am UTC](https://integration.keap.com/t/order-creation-process/82015/6 "2021-02-17T07:29:25Z")

</div>

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](https://developer.infusionsoft.com/docs/rest/#!/E-Commerce/createPaymentOnOrderUsingPOST), I get a “no response from server” message.

 ![Screen Shot 2021-02-16 at 11.27.54 PM](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/9/941638c0095e64d59b33d243f22529ffe6b76bdb.jpeg)

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](http://Authorize.net) if I want to test?

---

<div class="post-metadata">

**Author:** ![Adrian\_Drysdale](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Adrian\_Drysdale](https://integration.keap.com/u/Adrian_Drysdale)\
**Post date:** [June 2, 2021, 4:53pm UTC](https://integration.keap.com/t/order-creation-process/82015/7 "2021-06-02T16:53:02Z")

</div>

Having the same issue. I’m getting a no response from the server. Any ideas?

---

<div class="post-metadata">

**Author:** ![Andrew\_Porter1](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/andrew_porter1/32/12677_2.png) [@Andrew\_Porter1](https://integration.keap.com/u/Andrew_Porter1)\
**Post date:** [June 2, 2021, 9:48pm UTC](https://integration.keap.com/t/order-creation-process/82015/8 "2021-06-02T21:48:46Z")

</div>

According to Support, they basically act as a pass-through for each of the different payment gateway merchants and you have to sign into Infusionsoft to check the actual error message. That’s what I understood, anyway. Nothing helpful comes through the API call.
