Skip to content

Instantly share code, notes, and snippets.

@Fivell
Forked from af23me/order.js
Created June 13, 2018 11:54
Show Gist options
  • Save Fivell/4913097315271fb50e8047f24beb1356 to your computer and use it in GitHub Desktop.
Save Fivell/4913097315271fb50e8047f24beb1356 to your computer and use it in GitHub Desktop.
$.ajax({
type: 'POST',
url: "https://sandbox-api.didww.com/v3/orders",
data: JSON.stringify({
data: {
type: "orders",
attributes: {
allow_back_ordering: false,
items: [{
type: "did_order_items",
attributes: {
available_did_id: '2ffcad78-ad42-4ae0-ad19-cca48c01d511',
sku_id: '7c047af5-3e2f-47f0-a866-8136f8b80e53'
}
}]
}
}
}),
contentType: 'application/vnd.api+json',
headers: {
'Api-Key': 'xxx',
'Accept': 'application/vnd.api+json'
},
success: function (resultData) {
console.log(resultData);
},
error: function (xhr, textStatus, errorThrown) {
console.log(xhr);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment