Wix/SDK/ecom/orders/createOrder()

I’m trying to make an API to allow merchants to view our inventory and place orders. The SDK docs are fairly helpful but I’m getting an very generic message when submitting the createOrder() method.

One is that it’s expecting an object with no further information, and the other is that it’s expecting a float with no further information. Does anyone have experience working the WIX SDK that has attempted to do something similar?

Any help is very much appreciated!!!

Smith

Can you share the code that is not working and the exact error message?

I’m no longer receiving an error, it turns out that I was using a string instead of a number for the product weight.
I am however have a more elusive problem!
The object below is what I’m submitting to
wixClient.orders.createOrder()
I’m not getting any errors but no order is actually being created in my store.

1 Like

{
“billingInfo”: {
“address”: {
“addressLine1”: “REDACTED”,
“addressLine2”: “REDACTED”,
“city”: “REDACTED”,
“postalCode”: “REDACTED”
},
“contactDetails”: {
“company”: “REDACTED”,
“firstName”: “REDACTED”,
“lastName”: “REDACTED”,
“phone”: “REDACTED”
}
},
“buyerInfo”: {
“contactId”: “REDACTED”,
“email”: “REDACTED”
},
“channelInfo”: { “type”: “BACKOFFICE_MERCHANT” },
“currency”: “USD”,
“lineItems”: [
{
“_id”: “0f7bfdf8-a050-4ef9-8c74-2f294e5fdea4”,
“descriptionLines”: [
{
“name”: { “original”: “description” },
“value”: {
“plainText”: {
“original”: “

The New Axol is now available in 7075-T6 Aluminum. All the benefits of on the fly adjustments at a lighter weight.


}
}
}
],
“itemType”: { “itemTypeData”: { “preset”: “PHYSICAL” } },
“paymentOption”: “FULL_PAYMENT_OFFLINE”,
“physicalProperties”: {
“shippable”: true,
“sku”: “Axol2Blue”,
“weight”: 0
},
“price”: { “amount”: “110.00”, “formattedAmount”: “$110.00” },
“productName”: { “original”: “Axol Pivot” },
“quantity”: 2,
“taxDetails”: {
“taxRate”: “0.00”,
“taxableAmount”: { “amount”: “110.00”, “formattedAmount”: “$110.00” },
“totalTax”: { “amount”: “0.00”, “formattedAmount”: “$0.00” }
},
“totalDiscount”: { “amount”: “33.00”, “formattedAmount”: “$33.00” }
},
{
“_id”: “3b8365f8-530d-491e-afc2-7fbc907ab3cd”,
“descriptionLines”: [
{
“name”: { “original”: “description” },
“value”: {
“plainText”: {
“original”: “

The New Axol is now available in 7075-T6 Aluminum. All the benefits of on the fly adjustments at a lighter weight.


}
}
}
],
“itemType”: { “itemTypeData”: { “preset”: “PHYSICAL” } },
“paymentOption”: “FULL_PAYMENT_OFFLINE”,
“physicalProperties”: {
“shippable”: true,
“sku”: “Axol2Orange”,
“weight”: 0
},
“price”: { “amount”: “55.00”, “formattedAmount”: “$55.00” },
“productName”: { “original”: “Axol Pivot” },
“quantity”: 1,
“taxDetails”: {
“taxRate”: “0.00”,
“taxableAmount”: { “amount”: “55.00”, “formattedAmount”: “$55.00” },
“totalTax”: { “amount”: “0.00”, “formattedAmount”: “$0.00” }
},
“totalDiscount”: { “amount”: “16.50”, “formattedAmount”: “$16.50” }
}
],
“paymentStatus”: “NOT_PAID”,
“priceSummary”: {
“discount”: { “amount”: “49.50” },
“subtotal”: { “amount”: “165.00” },
“total”: { “amount”: “115.50” }
},
“status”: “INITIALIZED”,
“taxIncludedInPrices”: true
}

I have the same problem, I use the function and it returns an order with “number”:“0” and the rest of the parameters that seem to indicate that the order was created, however when I check the orders panel the order does not exist, it is not It has generated.
Have you managed to solve the problem?