cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Creating Order with API

synsci_devs
First-timer

Hello, I'm hoping I can get some feedback or insight into what's going wrong here. I am attempting to POST an order to the ShipStation API but with little luck. I can GET order details just find no problem, so my authentication isn't the problem I believe.

I'm using Python, and trying to POST the following sample data in this format below. I have converted the results to a json payload but cannot figure out why i'm getting the 400 error. 

 

I'm also a little confused as the Create/Update Order as a note that says it requires all fields, with no partial orders being accepted. As such, I have attempted to populate every field, but is this really necessary? Furthermore, I shouldn't populate read only fields as well, correct?

 

 

{
"advancedOptions": {
"billToAccount": null,
"billToCountryCode": null,
"billToMyOtherAccount": null,
"billToParty": null,
"billToPostalCode": null,
"containsAlcohol": false,
"customField1": null,
"customField2": null,
"customField3": null,
"mergedIds": [],
"mergedOrSplit": false,
"nonMachinable": false,
"parentID": null,
"saturdayDelivery": false,
"source": "Webstore",
"storeId": 00000,
"warehouseId": null
},
"amountPaid": 749.0,
"billTo": {
"city": "Surprise",
"company": null,
"country": "US",
"name": "Test Tester",
"phone": "(123) 456-6263",
"postalCode": "85388",
"residential": true,
"state": "Arizona",
"street1": "11565 N Something Drive",
"street2": null,
"street3": null
},
"carrierCode": "",
"confirmation": "none",
"customerEmail": "NA@NA.com",
"customerNotes": "1",
"customerUsername": "NA",
"dimensions": {
"height": 0,
"length": 0,
"units": "inches",
"width": 0
},
"externallyFulfilled": false,
"externallyFulfilledBy": "",
"gift": false,
"giftMessage": "",
"holdUntilDate": "",
"insuranceOptions": {
"insureShipment": false,
"insuredValue": 0,
"provider": "provider"
},
"internalNotes": "Order # 1123--This was manually sent to Shipstation from Keap/Infusionsoft",
"internationalOptions": {
"contents": "merchandise",
"customsItems": {
"countryOfOrigin": "",
"customsItemId": null,
"description": "",
"harmonizedTariffCode": "",
"quantity": 0,
"value": 0
},
"nonDelivery": "return_to_sender"
},
"items": [
{
"adjustment": false,
"fulfillmentSku": "SS-110-1",
"imageUrl": "",
"lineItemKey": 467817,
"name": "Test123",
"options": {
"name": "",
"value": ""
},
"productId": 21,
"quantity": 1,
"sku": "SS-110-1",
"taxAmount": 0,
"unitPrice": 999.0,
"upc": "",
"warehouseLocation": "",
"weight": {
"units": "pounds",
"value": 0.0
}
}
],
"orderDate": "2021-11-23 12:55:01",
"orderKey": "266483KeapShipstation",
"orderNumber": "266483",
"orderStatus": "awaiting_shipment",
"packageCode": "",
"paymentDate": "2021-11-23 12:55:01",
"paymentMethod": "See Keap for details",
"requestedShippingService": "",
"serviceCode": "",
"shipByDate": "2021-11-23 12:55:01",
"shipDate": "",
"shipTo": {
"city": "Surprise",
"company": null,
"country": "US",
"name": "Test Tester",
"phone": "(123) 456-6263",
"postalCode": "85388",
"residential": true,
"state": "Arizona",
"street1": "11565 N Something Drive",
"street2": null,
"street3": null
},
"shippingAmount": 0,
"tagIds": [
000000
],
"taxAmount": 0,
"userId": "",
"weight": {
"units": "pounds",
"value": 0
}
}
0 REPLIES 0