Error Creating an Order Through the API


#1

Using the api to create an order, it gives a strange error when trying to use tags - the error given is:

{“error_message”: “The input must be dict-like (not a : ‘text’)”, “param”: “tags-0”}

Below is a sample data of the request used that causes the error. Everything else works fine except when we attempt to add tags:

$data = array(

The order ID should be unique

‘order_id’ => ‘123456661’,
‘order_date’ => date(‘Y-m-d’),
‘discount_amount’ => ‘6.66’,
‘shipping_type’ => ‘NotSure’,
‘tags’ => array(
‘text’ => ‘promo code’
),
//‘additional_cart_info’ => ‘Free Gift for Customer for Signing Up’,
‘billing_address’ => array(
‘name’ => ‘Test Gifted Billing’,
‘street1’ => ‘1020 Bay Area Blvd’,
‘street2’ => ‘Suite 109’,
‘city’ => ‘Houston’,
‘state’ => ‘Texas’,
‘zip’ => ‘77058’,
‘email’ => ‘test@texaslawshield.com’,
‘country’ => ‘United States’,
‘company’ => ‘Texas Law Shield Test’,
‘phone’ => ‘666-666-6666’,
‘fax’ => ‘666-666-6666’
),
‘shipping_address’ => array(
‘name’ => ‘Test Gifted Shipping’,
‘street1’ => ‘1020 Bay Area Blvd’,
‘street2’ => ‘Suite 109’,
‘city’ => ‘Houston’,
‘state’ => ‘Texas’,
‘zip’ => ‘77058’,
‘email’ => ‘test@texaslawshield.com’,
‘country’ => ‘United States’,
‘company’ => ‘Texas Law Shield Test’,
‘phone’ => ‘666-666-6666’,
‘fax’ => ‘666-666-6666’
),
‘lines’ => array(
array(

The product will be created in Ordoro if the SKU doesn’t already exist

‘product’ => array(
‘sku’ => ‘Promo Gift 666’,
‘name’ => ‘Gift Cap with 666 printed on the forehead’
)
)
)
);


#2

Hi @webmastertls,

I think the pasted sample data had some formatting issues.

While I can infer some of the shape of the code, if you could include some request data as well as fixing up the formatting that would help out a ton.