Skip to content

Instantly share code, notes, and snippets.

@huoxito
Created August 3, 2014 07:22
Show Gist options
  • Select an option

  • Save huoxito/d476670f479bcc2d4387 to your computer and use it in GitHub Desktop.

Select an option

Save huoxito/d476670f479bcc2d4387 to your computer and use it in GitHub Desktop.
Example order to be imported in spree
{
"order": {
"number": "REREGEGERGRRG",
"state": "complete",
"channel": "spree",
"email": "[email protected]",
"currency": "USD",
"completed_at": "2014-08-03T09:08:57Z",
"adjustments_attributes": [
{
"label": "tax",
"amount": 0
},
{
"label": "something",
"amount": 17.9
}
],
"line_items_attributes": {
"0": {
"variant_id": "1",
"quantity": 1,
"price": 50
},
"3": {
"variant_id": "2",
"quantity": 4,
"price": 60
},
"6": {
"variant_id": "3",
"quantity": 1,
"price": 90
},
"7": {
"variant_id": "4",
"quantity": 1,
"price": 30
},
"8": {
"variant_id": "5",
"quantity": 1,
"price": 42
}
},
"shipments_attributes": [
{
"tracking": "track track track",
"stock_location": "default",
"cost": 11,
"shipping_method": "UPS Ground (USD)",
"inventory_units": [
{ "variant_id": "1" },
{ "variant_id": "2" },
{ "variant_id": "2" },
{ "variant_id": "2" },
{ "variant_id": "2" },
{ "variant_id": "3" },
{ "variant_id": "4" },
{ "variant_id": "5" }
]
}
],
"payments_attributes": [
{
"number": "REGE345546FDF",
"state": "completed",
"amount": 480.90,
"payment_method": "Authorize.Net"
},
{
"number": "ERERGREG43534DF",
"state": "void",
"amount": 46.95,
"payment_method": "Authorize.Net"
}
],
"ship_address_attributes": {
"firstname": "Spree",
"lastname": "Commerce",
"address1": "Street",
"address2": "",
"zipcode": "2211",
"city": "Bethesda",
"state": "MD",
"country": "US",
"phone": "9999999999"
},
"bill_address_attributes": {
"firstname": "Spree",
"lastname": "Commerce",
"address1": "Street",
"address2": "",
"zipcode": "2211",
"city": "Bethesda",
"state": "MD",
"country": "US",
"phone": "9999999999"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment