This method enables the creation of a new order into the system. The order can be bound to an existing customer or be standalone as implemented in the OrderService. Make sure that you check the Order resource representation. To see an example usage take a look at docs/REST/samples/order-service/create_order.php.
POST https://gambio-shop.de/shop1/api.php/v2/orders
The request body takes a complete GXOrder resource, containing the following writable properties:
{
"addonValues": {
"ccCvv": "",
"ccExpires": "",
"ccIssue": "",
"ccNumber": "",
"ccOwner": "",
"ccStart": "",
"ccType": "",
"customerIp": "",
"downloadAbandonmentStatus": "0",
"serviceAbandonmentStatus": "0"
},
"addresses": {
"billing": {
"additionalAddressInfo": "1. Etage",
"b2bStatus": false,
"city": "Bremen",
"company": "JD Company",
"countryId": 81,
"firstname": "John",
"gender": "m",
"houseNumber": "123",
"lastname": "Doe",
"postcode": "28219",
"street": "Test Street",
"suburb": "",
"zoneId": 0
},
"customer": {
"additionalAddressInfo": "1. Etage",
"b2bStatus": false,
"city": "Bremen",
"company": "JD Company",
"countryId": 81,
"firstname": "John",
"gender": "m",
"houseNumber": "123",
"lastname": "Doe",
"postcode": "28219",
"street": "Test Street",
"suburb": "",
"zoneId": 0
},
"delivery": {
"additionalAddressInfo": "1. Etage",
"b2bStatus": false,
"city": "Bremen",
"company": "JD Company",
"countryId": 81,
"firstname": "John",
"gender": "m",
"houseNumber": "123",
"lastname": "Doe",
"postcode": "28219",
"street": "Test Street",
"suburb": "",
"zoneId": 0
}
},
"comment": "",
"currencyCode": "EUR",
"customer": {
"email": "admin@shop.de",
"id": 1,
"number": "",
"phone": "0421 - 22 34 678",
"status": {
"discount": 0,
"id": 0,
"image": "admin_status.gif",
"isGuest": false,
"name": "Admin"
},
"vatId": ""
},
"items": [
{
"addonValues": {
"productId": 2,
"quantityUnitId": 1
},
"attributes": [
{
"combisId": "null",
"id": 1,
"name": "Farbe",
"optionId": 1,
"optionValueId": 1,
"price": 0,
"priceType": "+",
"value": "rot"
}
],
"checkoutInformation": "Checkout information goes here ...",
"discount": 0,
"downloadInformation": [
{
"countAvailable": 14,
"filename": "Dokument.pdf",
"maxDaysAllowed": 5
}
],
"finalPrice": 11,
"id": 1,
"isTaxAllowed": "true",
"model": "12345-s-black",
"name": "Ein Artikel",
"price": 11,
"quantity": 1,
"quantityUnitName": "Liter",
"shippingTimeInformation": "",
"tax": 19
}
],
"languageCode": "DE",
"paymentType": {
"module": "cod",
"title": "cod"
},
"purchaseDate": "2015-11-06 12:22:39",
"shippingType": {
"module": "flat_flat",
"title": "Pauschale Versandkosten (Standard)"
},
"statusHistory": [
{
"comment": "",
"customerNotified": "true",
"dateAdded": "2015-11-06 12:22:39",
"id": 1,
"statusId": 1
}
],
"statusId": 1,
"totalWeight": 0.123,
"totals": [
{
"class": "ot_subtotal",
"id": 1,
"sortOrder": 10,
"title": "Zwischensumme",
"value": 50,
"valueText": "50,00 EUR"
}
]
}
{
"addonValues": {
"ccCvv": "string",
"ccExpires": "string",
"ccIssue": "string",
"ccNumber": "string",
"ccOwner": "string",
"ccStart": "string",
"ccType": "string",
"customerIp": "string",
"downloadAbandonmentStatus": "string",
"serviceAbandonmentStatus": "string"
},
"addresses": {
"billing": {
"additionalAddressInfo": "string",
"b2bStatus": "boolean",
"city": "string",
"company": "string",
"countryId": "int64",
"firstname": "string",
"gender": "string",
"houseNumber": "string",
"lastname": "string",
"postcode": "string",
"street": "string",
"suburb": "string",
"zoneId": "int64"
},
"customer": {
"additionalAddressInfo": "string",
"b2bStatus": "boolean",
"city": "string",
"company": "string",
"countryId": "int64",
"firstname": "string",
"gender": "string",
"houseNumber": "string",
"lastname": "string",
"postcode": "string",
"street": "string",
"suburb": "string",
"zoneId": "int64"
},
"delivery": {
"additionalAddressInfo": "string",
"b2bStatus": "boolean",
"city": "string",
"company": "string",
"countryId": "int64",
"firstname": "string",
"gender": "string",
"houseNumber": "string",
"lastname": "string",
"postcode": "string",
"street": "string",
"suburb": "string",
"zoneId": "int64"
}
},
"comment": "string",
"currencyCode": "string",
"customer": {
"email": "string",
"number": "string",
"phone": "string",
"status": {
"discount": "int64",
"image": "string",
"isGuest": "boolean",
"name": "string"
},
"vatId": "int64"
},
"items": [
{
"addonValues": {
"productId": "string",
"productType": "string"
},
"attributes": {
"combisId": "int64",
"name": "string",
"optionId": "int64",
"optionValueId": "int64",
"price": "int64",
"priceType": "string",
"value": "string"
},
"checkoutInformation": "string",
"discount": "int64",
"downloadInformation": [
"string"
],
"finalPrice": "int64",
"gxCustomizerData": [
"string"
],
"isTaxAllowed": "boolean",
"model": "string",
"name": "string",
"price": "int64",
"quantity": "int64",
"quantityUnitName": "string",
"shippingTimeInformation": "string",
"tax": "int64"
}
],
"languageCode": "string",
"paymentType": {
"module": "string",
"title": "string"
},
"purchaseDate": "string",
"shippingType": {
"module": "string",
"title": "string"
},
"statusHistory": [
{
"comment": "string",
"customerNotified": "boolean",
"dateAdded": "string",
"statusId": "int64"
}
],
"statusId": "int64",
"totalWeight": "int64",
"totals": [
{
"class": "string",
"sortOrder": "int64",
"title": "string",
"value": "int64",
"valueText": "string"
}
]
}
| Name | Type | Description | Additional |
|---|---|---|---|
| addonValues | object | GXOrderAddonValues | |
| addonValues.ccCvv | string | ||
| addonValues.ccExpires | string | ||
| addonValues.ccIssue | string | ||
| addonValues.ccNumber | string | ||
| addonValues.ccOwner | string | ||
| addonValues.ccStart | string | ||
| addonValues.ccType | string | ||
| addonValues.customerIp | string | ||
| addonValues.downloadAbandonmentStatus | string | ||
| addonValues.serviceAbandonmentStatus | string | ||
| addresses | object | GXOrderAddressMain | |
| addresses.billing | object | GXOrderAddress | Optional |
| addresses.billing.additionalAddressInfo | string | ||
| addresses.billing.b2bStatus | boolean | ||
| addresses.billing.city | string | ||
| addresses.billing.company | string | ||
| addresses.billing.countryId | int64 | ||
| addresses.billing.firstname | string | ||
| addresses.billing.gender | string | ||
| addresses.billing.houseNumber | string | ||
| addresses.billing.lastname | string | ||
| addresses.billing.postcode | string | ||
| addresses.billing.street | string | ||
| addresses.billing.suburb | string | ||
| addresses.billing.zoneId | int64 | ||
| addresses.customer | object | GXOrderAddress | Optional |
| addresses.customer.additionalAddressInfo | string | ||
| addresses.customer.b2bStatus | boolean | ||
| addresses.customer.city | string | ||
| addresses.customer.company | string | ||
| addresses.customer.countryId | int64 | ||
| addresses.customer.firstname | string | ||
| addresses.customer.gender | string | ||
| addresses.customer.houseNumber | string | ||
| addresses.customer.lastname | string | ||
| addresses.customer.postcode | string | ||
| addresses.customer.street | string | ||
| addresses.customer.suburb | string | ||
| addresses.customer.zoneId | int64 | ||
| addresses.delivery | object | GXOrderAddress | Optional |
| addresses.delivery.additionalAddressInfo | string | ||
| addresses.delivery.b2bStatus | boolean | ||
| addresses.delivery.city | string | ||
| addresses.delivery.company | string | ||
| addresses.delivery.countryId | int64 | ||
| addresses.delivery.firstname | string | ||
| addresses.delivery.gender | string | ||
| addresses.delivery.houseNumber | string | ||
| addresses.delivery.lastname | string | ||
| addresses.delivery.postcode | string | ||
| addresses.delivery.street | string | ||
| addresses.delivery.suburb | string | ||
| addresses.delivery.zoneId | int64 | ||
| comment | string | ||
| currencyCode | string | ||
| customer | object | GXCustomer | |
| customer.email | string | ||
| customer.number | string | ||
| customer.phone | string | ||
| customer.status | object | GXCustomerStatus | |
| customer.status.discount | int64 | ||
| customer.status.image | string | ||
| customer.status.isGuest | boolean | ||
| customer.status.name | string | ||
| customer.vatId | int64 | ||
| items[] | array | ||
| items[].addonValues | object | GXOrderItemsAddons | |
| items[].addonValues.productId | string | ||
| items[].addonValues.productType | string | ||
| items[].attributes | object | GXOrderItemAttributes | |
| items[].attributes.combisId | int64 | ||
| items[].attributes.name | string | ||
| items[].attributes.optionId | int64 | ||
| items[].attributes.optionValueId | int64 | ||
| items[].attributes.price | int64 | ||
| items[].attributes.priceType | string | ||
| items[].attributes.value | string | ||
| items[].checkoutInformation | string | ||
| items[].discount | int64 | ||
| items[].downloadInformation[] | array of string | ||
| items[].finalPrice | int64 | ||
| items[].gxCustomizerData[] | array of string | ||
| items[].isTaxAllowed | boolean | ||
| items[].model | string | ||
| items[].name | string | ||
| items[].price | int64 | ||
| items[].quantity | int64 | ||
| items[].quantityUnitName | string | ||
| items[].shippingTimeInformation | string | ||
| items[].tax | int64 | ||
| languageCode | string | ||
| paymentType | object | GXPaymentType | |
| paymentType.module | string | ||
| paymentType.title | string | ||
| purchaseDate | string | ||
| shippingType | object | GXPaymentType | |
| shippingType.module | string | ||
| shippingType.title | string | ||
| statusHistory[] | array | ||
| statusHistory[].comment | string | ||
| statusHistory[].customerNotified | boolean | ||
| statusHistory[].dateAdded | string | ||
| statusHistory[].statusId | int64 | ||
| statusId | int64 | ||
| totalWeight | int64 | ||
| totals[] | array | ||
| totals[].class | string | ||
| totals[].sortOrder | int64 | ||
| totals[].title | string | ||
| totals[].value | int64 | ||
| totals[].valueText | string |
In order to provide the authentication, you must insert the Basic Auth inside the HTTP header. The Basic Auth
is an encrypted base64 string that holds the following content: admin@shop.de:12345 where the structure is
as follows: username:password.
An example header would look as follows:
Authorization: Basic YWRtaW5Ac2hvcC5kZToxMjM0NQ==
This request requires the use of one of following authorisation methods:
BASIC
.
The following HTTP status codes may be returned, optionally with a response resource.
| Status code | Description | Resource |
|---|---|---|
| 201 | Created Upon success, returns the order that was created |
GXOrder |
| 400 | Bad Request (Order data missing) |
defaultErrorResponse |
Here are some example implementations for this operation.
MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}"); Request request = new Request.Builder() .url("https://gambio-shop.de/shop1/api.php/v2/orders") .post(body) .addHeader("accept", "application/json") .addHeader("content-type", "application/json") .addHeader("authorization", "Basic REPLACE_BASIC_AUTH") .build();
Response response = client.newCall(request).execute();
var options = { "method": "POST", "hostname": "gambio-shop.de", "port": null, "path": "/shop1/api.php/v2/orders", "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Basic REPLACE_BASIC_AUTH" } };
var req = http.request(options, function (res) { var chunks = [];
res.on("data", function (chunk) { chunks.push(chunk); });
res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); });
req.write(JSON.stringify({ id: 0, statusId: 0, purchaseDate: '', currencyCode: '', languageCode: '', comment: '', totalWeight: 0, paymentType: { title: '', module: '' }, shippingType: { title: '', module: '' }, customer: { id: 0, number: '', email: '', phone: '', vatId: 0, status: { id: 0, name: '', image: '', discount: 0, isGuest: false } }, addresses: { customer: { gender: '', firstname: '', lastname: '', company: '', street: '', houseNumber: '', additionalAddressInfo: '', suburb: '', postcode: '', city: '', countryId: 0, zoneId: 0, b2bStatus: false }, billing: { gender: '', firstname: '', lastname: '', company: '', street: '', houseNumber: '', additionalAddressInfo: '', suburb: '', postcode: '', city: '', countryId: 0, zoneId: 0, b2bStatus: false }, delivery: { gender: '', firstname: '', lastname: '', company: '', street: '', houseNumber: '', additionalAddressInfo: '', suburb: '', postcode: '', city: '', countryId: 0, zoneId: 0, b2bStatus: false } }, items: [ { id: 0, model: '', name: '', quantity: 0, price: 0, finalPrice: 0, tax: 0, isTaxAllowed: false, discount: 0, shippingTimeInformation: '', checkoutInformation: '', attributes: { id: 0, name: '', value: '', price: 0, priceType: '', combisId: 0, optionId: 0, optionValueId: 0 }, downloadInformation: [ '' ], addonValues: { productId: '', productType: '' }, quantityUnitName: '', gxCustomizerData: [ '' ] } ], totals: [ { id: 0, title: '', value: 0, valueText: '', class: '', sortOrder: 0 } ], statusHistory: [ { id: 0, statusId: 0, dateAdded: '', comment: '', customerNotified: false } ], addonValues: { ccCvv: '', ccExpires: '', ccIssue: '', ccNumber: '', ccOwner: '', ccStart: '', ccType: '', customerIp: '', downloadAbandonmentStatus: '', serviceAbandonmentStatus: '' } })); req.end();
var options = { method: 'POST', url: 'https://gambio-shop.de/shop1/api.php/v2/orders', headers: { authorization: 'Basic REPLACE_BASIC_AUTH', 'content-type': 'application/json', accept: 'application/json' }, body: { id: 0, statusId: 0, purchaseDate: '', currencyCode: '', languageCode: '', comment: '', totalWeight: 0, paymentType: { title: '', module: '' }, shippingType: { title: '', module: '' }, customer: { id: 0, number: '', email: '', phone: '', vatId: 0, status: { id: 0, name: '', image: '', discount: 0, isGuest: false } }, addresses: { customer: { gender: '', firstname: '', lastname: '', company: '', street: '', houseNumber: '', additionalAddressInfo: '', suburb: '', postcode: '', city: '', countryId: 0, zoneId: 0, b2bStatus: false }, billing: { gender: '', firstname: '', lastname: '', company: '', street: '', houseNumber: '', additionalAddressInfo: '', suburb: '', postcode: '', city: '', countryId: 0, zoneId: 0, b2bStatus: false }, delivery: { gender: '', firstname: '', lastname: '', company: '', street: '', houseNumber: '', additionalAddressInfo: '', suburb: '', postcode: '', city: '', countryId: 0, zoneId: 0, b2bStatus: false } }, items: [ { id: 0, model: '', name: '', quantity: 0, price: 0, finalPrice: 0, tax: 0, isTaxAllowed: false, discount: 0, shippingTimeInformation: '', checkoutInformation: '', attributes: { id: 0, name: '', value: '', price: 0, priceType: '', combisId: 0, optionId: 0, optionValueId: 0 }, downloadInformation: [ '' ], addonValues: { productId: '', productType: '' }, quantityUnitName: '', gxCustomizerData: [ '' ] } ], totals: [ { id: 0, title: '', value: 0, valueText: '', class: '', sortOrder: 0 } ], statusHistory: [ { id: 0, statusId: 0, dateAdded: '', comment: '', customerNotified: false } ], addonValues: { ccCvv: '', ccExpires: '', ccIssue: '', ccNumber: '', ccOwner: '', ccStart: '', ccType: '', customerIp: '', downloadAbandonmentStatus: '', serviceAbandonmentStatus: '' } }, json: true };
request(options, function (error, response, body) { if (error) throw new Error(error);
console.log(body); });
var req = unirest("POST", "https://gambio-shop.de/shop1/api.php/v2/orders");
req.headers({ "authorization": "Basic REPLACE_BASIC_AUTH", "content-type": "application/json", "accept": "application/json" });
req.type("json"); req.send({ "id": 0, "statusId": 0, "purchaseDate": "", "currencyCode": "", "languageCode": "", "comment": "", "totalWeight": 0, "paymentType": { "title": "", "module": "" }, "shippingType": { "title": "", "module": "" }, "customer": { "id": 0, "number": "", "email": "", "phone": "", "vatId": 0, "status": { "id": 0, "name": "", "image": "", "discount": 0, "isGuest": false } }, "addresses": { "customer": { "gender": "", "firstname": "", "lastname": "", "company": "", "street": "", "houseNumber": "", "additionalAddressInfo": "", "suburb": "", "postcode": "", "city": "", "countryId": 0, "zoneId": 0, "b2bStatus": false }, "billing": { "gender": "", "firstname": "", "lastname": "", "company": "", "street": "", "houseNumber": "", "additionalAddressInfo": "", "suburb": "", "postcode": "", "city": "", "countryId": 0, "zoneId": 0, "b2bStatus": false }, "delivery": { "gender": "", "firstname": "", "lastname": "", "company": "", "street": "", "houseNumber": "", "additionalAddressInfo": "", "suburb": "", "postcode": "", "city": "", "countryId": 0, "zoneId": 0, "b2bStatus": false } }, "items": [ { "id": 0, "model": "", "name": "", "quantity": 0, "price": 0, "finalPrice": 0, "tax": 0, "isTaxAllowed": false, "discount": 0, "shippingTimeInformation": "", "checkoutInformation": "", "attributes": { "id": 0, "name": "", "value": "", "price": 0, "priceType": "", "combisId": 0, "optionId": 0, "optionValueId": 0 }, "downloadInformation": [ "" ], "addonValues": { "productId": "", "productType": "" }, "quantityUnitName": "", "gxCustomizerData": [ "" ] } ], "totals": [ { "id": 0, "title": "", "value": 0, "valueText": "", "class": "", "sortOrder": 0 } ], "statusHistory": [ { "id": 0, "statusId": 0, "dateAdded": "", "comment": "", "customerNotified": false } ], "addonValues": { "ccCvv": "", "ccExpires": "", "ccIssue": "", "ccNumber": "", "ccOwner": "", "ccStart": "", "ccType": "", "customerIp": "", "downloadAbandonmentStatus": "", "serviceAbandonmentStatus": "" } });
req.end(function (res) { if (res.error) throw new Error(res.error);
console.log(res.body); });
var xhr = new XMLHttpRequest(); xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } });
xhr.open("POST", "https://gambio-shop.de/shop1/api.php/v2/orders"); xhr.setRequestHeader("accept", "application/json"); xhr.setRequestHeader("content-type", "application/json"); xhr.setRequestHeader("authorization", "Basic REPLACE_BASIC_AUTH");
xhr.send(data);
$.ajax(settings).done(function (response) { console.log(response); });
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => "https://gambio-shop.de/shop1/api.php/v2/orders", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}", CURLOPT_HTTPHEADER => array( "accept: application/json", "authorization: Basic REPLACE_BASIC_AUTH", "content-type: application/json" ), ));
$response = curl_exec($curl); $err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
$request = new HttpRequest(); $request->setUrl('https://gambio-shop.de/shop1/api.php/v2/orders'); $request->setMethod(HTTP_METH_POST);
$request->setHeaders(array( 'authorization' => 'Basic REPLACE_BASIC_AUTH', 'content-type' => 'application/json', 'accept' => 'application/json' ));
$request->setBody('{"id":0,"statusId":0,"purchaseDate":"","currencyCode":"","languageCode":"","comment":"","totalWeight":0,"paymentType":{"title":"","module":""},"shippingType":{"title":"","module":""},"customer":{"id":0,"number":"","email":"","phone":"","vatId":0,"status":{"id":0,"name":"","image":"","discount":0,"isGuest":false}},"addresses":{"customer":{"gender":"","firstname":"","lastname":"","company":"","street":"","houseNumber":"","additionalAddressInfo":"","suburb":"","postcode":"","city":"","countryId":0,"zoneId":0,"b2bStatus":false},"billing":{"gender":"","firstname":"","lastname":"","company":"","street":"","houseNumber":"","additionalAddressInfo":"","suburb":"","postcode":"","city":"","countryId":0,"zoneId":0,"b2bStatus":false},"delivery":{"gender":"","firstname":"","lastname":"","company":"","street":"","houseNumber":"","additionalAddressInfo":"","suburb":"","postcode":"","city":"","countryId":0,"zoneId":0,"b2bStatus":false}},"items":[{"id":0,"model":"","name":"","quantity":0,"price":0,"finalPrice":0,"tax":0,"isTaxAllowed":false,"discount":0,"shippingTimeInformation":"","checkoutInformation":"","attributes":{"id":0,"name":"","value":"","price":0,"priceType":"","combisId":0,"optionId":0,"optionValueId":0},"downloadInformation":[""],"addonValues":{"productId":"","productType":""},"quantityUnitName":"","gxCustomizerData":[""]}],"totals":[{"id":0,"title":"","value":0,"valueText":"","class":"","sortOrder":0}],"statusHistory":[{"id":0,"statusId":0,"dateAdded":"","comment":"","customerNotified":false}],"addonValues":{"ccCvv":"","ccExpires":"","ccIssue":"","ccNumber":"","ccOwner":"","ccStart":"","ccType":"","customerIp":"","downloadAbandonmentStatus":"","serviceAbandonmentStatus":""}}');
try { $response = $request->send();
echo $response->getBody(); } catch (HttpException $ex) { echo $ex; }
$client = new http\Client; $request = new http\Client\Request;
$body = new http\Message\Body; $body->append('{"id":0,"statusId":0,"purchaseDate":"","currencyCode":"","languageCode":"","comment":"","totalWeight":0,"paymentType":{"title":"","module":""},"shippingType":{"title":"","module":""},"customer":{"id":0,"number":"","email":"","phone":"","vatId":0,"status":{"id":0,"name":"","image":"","discount":0,"isGuest":false}},"addresses":{"customer":{"gender":"","firstname":"","lastname":"","company":"","street":"","houseNumber":"","additionalAddressInfo":"","suburb":"","postcode":"","city":"","countryId":0,"zoneId":0,"b2bStatus":false},"billing":{"gender":"","firstname":"","lastname":"","company":"","street":"","houseNumber":"","additionalAddressInfo":"","suburb":"","postcode":"","city":"","countryId":0,"zoneId":0,"b2bStatus":false},"delivery":{"gender":"","firstname":"","lastname":"","company":"","street":"","houseNumber":"","additionalAddressInfo":"","suburb":"","postcode":"","city":"","countryId":0,"zoneId":0,"b2bStatus":false}},"items":[{"id":0,"model":"","name":"","quantity":0,"price":0,"finalPrice":0,"tax":0,"isTaxAllowed":false,"discount":0,"shippingTimeInformation":"","checkoutInformation":"","attributes":{"id":0,"name":"","value":"","price":0,"priceType":"","combisId":0,"optionId":0,"optionValueId":0},"downloadInformation":[""],"addonValues":{"productId":"","productType":""},"quantityUnitName":"","gxCustomizerData":[""]}],"totals":[{"id":0,"title":"","value":0,"valueText":"","class":"","sortOrder":0}],"statusHistory":[{"id":0,"statusId":0,"dateAdded":"","comment":"","customerNotified":false}],"addonValues":{"ccCvv":"","ccExpires":"","ccIssue":"","ccNumber":"","ccOwner":"","ccStart":"","ccType":"","customerIp":"","downloadAbandonmentStatus":"","serviceAbandonmentStatus":""}}');
$request->setRequestUrl('https://gambio-shop.de/shop1/api.php/v2/orders'); $request->setRequestMethod('POST'); $request->setBody($body);
$request->setHeaders(array( 'authorization' => 'Basic REPLACE_BASIC_AUTH', 'content-type' => 'application/json', 'accept' => 'application/json' ));
$client->enqueue($request)->send(); $response = $client->getResponse();
echo $response->getBody();
conn = http.client.HTTPSConnection("gambio-shop.de")
payload = "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}"
headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Basic REPLACE_BASIC_AUTH" }
conn.request("POST", "/shop1/api.php/v2/orders", payload, headers)
res = conn.getresponse() data = res.read()
print(data.decode("utf-8"))
url = "https://gambio-shop.de/shop1/api.php/v2/orders"
payload = "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}" headers = { 'accept': "application/json", 'content-type': "application/json", 'authorization': "Basic REPLACE_BASIC_AUTH" }
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
url = URI("https://gambio-shop.de/shop1/api.php/v2/orders")
http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url) request["accept"] = 'application/json' request["content-type"] = 'application/json' request["authorization"] = 'Basic REPLACE_BASIC_AUTH' request.body = "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}"
response = http.request(request) puts response.read_body
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://gambio-shop.de/shop1/api.php/v2/orders");
struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "authorization: Basic REPLACE_BASIC_AUTH"); headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "accept: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}");
CURLcode ret = curl_easy_perform(hnd);
import ( "fmt" "strings" "net/http" "io/ioutil" )
func main() {
url := "https://gambio-shop.de/shop1/api.php/v2/orders"
payload := strings.NewReader("{\"id\":0,\"statusId\":0,\"purchaseDate\":\"<ADD STRING VALUE>\",\"currencyCode\":\"<ADD STRING VALUE>\",\"languageCode\":\"<ADD STRING VALUE>\",\"comment\":\"<ADD STRING VALUE>\",\"totalWeight\":0,\"paymentType\":{\"title\":\"<ADD STRING VALUE>\",\"module\":\"<ADD STRING VALUE>\"},\"shippingType\":{\"title\":\"<ADD STRING VALUE>\",\"module\":\"<ADD STRING VALUE>\"},\"customer\":{\"id\":0,\"number\":\"<ADD STRING VALUE>\",\"email\":\"<ADD STRING VALUE>\",\"phone\":\"<ADD STRING VALUE>\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"<ADD STRING VALUE>\",\"image\":\"<ADD STRING VALUE>\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"<ADD STRING VALUE>\",\"firstname\":\"<ADD STRING VALUE>\",\"lastname\":\"<ADD STRING VALUE>\",\"company\":\"<ADD STRING VALUE>\",\"street\":\"<ADD STRING VALUE>\",\"houseNumber\":\"<ADD STRING VALUE>\",\"additionalAddressInfo\":\"<ADD STRING VALUE>\",\"suburb\":\"<ADD STRING VALUE>\",\"postcode\":\"<ADD STRING VALUE>\",\"city\":\"<ADD STRING VALUE>\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"<ADD STRING VALUE>\",\"firstname\":\"<ADD STRING VALUE>\",\"lastname\":\"<ADD STRING VALUE>\",\"company\":\"<ADD STRING VALUE>\",\"street\":\"<ADD STRING VALUE>\",\"houseNumber\":\"<ADD STRING VALUE>\",\"additionalAddressInfo\":\"<ADD STRING VALUE>\",\"suburb\":\"<ADD STRING VALUE>\",\"postcode\":\"<ADD STRING VALUE>\",\"city\":\"<ADD STRING VALUE>\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"<ADD STRING VALUE>\",\"firstname\":\"<ADD STRING VALUE>\",\"lastname\":\"<ADD STRING VALUE>\",\"company\":\"<ADD STRING VALUE>\",\"street\":\"<ADD STRING VALUE>\",\"houseNumber\":\"<ADD STRING VALUE>\",\"additionalAddressInfo\":\"<ADD STRING VALUE>\",\"suburb\":\"<ADD STRING VALUE>\",\"postcode\":\"<ADD STRING VALUE>\",\"city\":\"<ADD STRING VALUE>\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"<ADD STRING VALUE>\",\"name\":\"<ADD STRING VALUE>\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"<ADD STRING VALUE>\",\"checkoutInformation\":\"<ADD STRING VALUE>\",\"attributes\":{\"id\":0,\"name\":\"<ADD STRING VALUE>\",\"value\":\"<ADD STRING VALUE>\",\"price\":0,\"priceType\":\"<ADD STRING VALUE>\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"<ADD STRING VALUE>\"],\"addonValues\":{\"productId\":\"<ADD STRING VALUE>\",\"productType\":\"<ADD STRING VALUE>\"},\"quantityUnitName\":\"<ADD STRING VALUE>\",\"gxCustomizerData\":[\"<ADD STRING VALUE>\"]}],\"totals\":[{\"id\":0,\"title\":\"<ADD STRING VALUE>\",\"value\":0,\"valueText\":\"<ADD STRING VALUE>\",\"class\":\"<ADD STRING VALUE>\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"<ADD STRING VALUE>\",\"comment\":\"<ADD STRING VALUE>\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"<ADD STRING VALUE>\",\"ccExpires\":\"<ADD STRING VALUE>\",\"ccIssue\":\"<ADD STRING VALUE>\",\"ccNumber\":\"<ADD STRING VALUE>\",\"ccOwner\":\"<ADD STRING VALUE>\",\"ccStart\":\"<ADD STRING VALUE>\",\"ccType\":\"<ADD STRING VALUE>\",\"customerIp\":\"<ADD STRING VALUE>\",\"downloadAbandonmentStatus\":\"<ADD STRING VALUE>\",\"serviceAbandonmentStatus\":\"<ADD STRING VALUE>\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("accept", "application/json")
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "Basic REPLACE_BASIC_AUTH")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
NSDictionary *headers = @{ @"accept": @"application/json", @"content-type": @"application/json", @"authorization": @"Basic REPLACE_BASIC_AUTH" }; NSDictionary *parameters = @{ @"id": @0, @"statusId": @0, @"purchaseDate": @"", @"currencyCode": @"", @"languageCode": @"", @"comment": @"", @"totalWeight": @0, @"paymentType": @{ @"title": @"", @"module": @"" }, @"shippingType": @{ @"title": @"", @"module": @"" }, @"customer": @{ @"id": @0, @"number": @"", @"email": @"", @"phone": @"", @"vatId": @0, @"status": @{ @"id": @0, @"name": @"", @"image": @"", @"discount": @0, @"isGuest": @NO } }, @"addresses": @{ @"customer": @{ @"gender": @"", @"firstname": @"", @"lastname": @"", @"company": @"", @"street": @"", @"houseNumber": @"", @"additionalAddressInfo": @"", @"suburb": @"", @"postcode": @"", @"city": @"", @"countryId": @0, @"zoneId": @0, @"b2bStatus": @NO }, @"billing": @{ @"gender": @"", @"firstname": @"", @"lastname": @"", @"company": @"", @"street": @"", @"houseNumber": @"", @"additionalAddressInfo": @"", @"suburb": @"", @"postcode": @"", @"city": @"", @"countryId": @0, @"zoneId": @0, @"b2bStatus": @NO }, @"delivery": @{ @"gender": @"", @"firstname": @"", @"lastname": @"", @"company": @"", @"street": @"", @"houseNumber": @"", @"additionalAddressInfo": @"", @"suburb": @"", @"postcode": @"", @"city": @"", @"countryId": @0, @"zoneId": @0, @"b2bStatus": @NO } }, @"items": @[ @{ @"id": @0, @"model": @"", @"name": @"", @"quantity": @0, @"price": @0, @"finalPrice": @0, @"tax": @0, @"isTaxAllowed": @NO, @"discount": @0, @"shippingTimeInformation": @"", @"checkoutInformation": @"", @"attributes": @{ @"id": @0, @"name": @"", @"value": @"", @"price": @0, @"priceType": @"", @"combisId": @0, @"optionId": @0, @"optionValueId": @0 }, @"downloadInformation": @[ @"" ], @"addonValues": @{ @"productId": @"", @"productType": @"" }, @"quantityUnitName": @"", @"gxCustomizerData": @[ @"" ] } ], @"totals": @[ @{ @"id": @0, @"title": @"", @"value": @0, @"valueText": @"", @"class": @"", @"sortOrder": @0 } ], @"statusHistory": @[ @{ @"id": @0, @"statusId": @0, @"dateAdded": @"", @"comment": @"", @"customerNotified": @NO } ], @"addonValues": @{ @"ccCvv": @"", @"ccExpires": @"", @"ccIssue": @"", @"ccNumber": @"", @"ccOwner": @"", @"ccStart": @"", @"ccType": @"", @"customerIp": @"", @"downloadAbandonmentStatus": @"", @"serviceAbandonmentStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://gambio-shop.de/shop1/api.php/v2/orders"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0]; [request setHTTPMethod:@"POST"]; [request setAllHTTPHeaderFields:headers]; [request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { NSLog(@"%@", error); } else { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response; NSLog(@"%@", httpResponse); } }]; [dataTask resume];
let headers = [ "accept": "application/json", "content-type": "application/json", "authorization": "Basic REPLACE_BASIC_AUTH" ] let parameters = [ "id": 0, "statusId": 0, "purchaseDate": "", "currencyCode": "", "languageCode": "", "comment": "", "totalWeight": 0, "paymentType": [ "title": "", "module": "" ], "shippingType": [ "title": "", "module": "" ], "customer": [ "id": 0, "number": "", "email": "", "phone": "", "vatId": 0, "status": [ "id": 0, "name": "", "image": "", "discount": 0, "isGuest": false ] ], "addresses": [ "customer": [ "gender": "", "firstname": "", "lastname": "", "company": "", "street": "", "houseNumber": "", "additionalAddressInfo": "", "suburb": "", "postcode": "", "city": "", "countryId": 0, "zoneId": 0, "b2bStatus": false ], "billing": [ "gender": "", "firstname": "", "lastname": "", "company": "", "street": "", "houseNumber": "", "additionalAddressInfo": "", "suburb": "", "postcode": "", "city": "", "countryId": 0, "zoneId": 0, "b2bStatus": false ], "delivery": [ "gender": "", "firstname": "", "lastname": "", "company": "", "street": "", "houseNumber": "", "additionalAddressInfo": "", "suburb": "", "postcode": "", "city": "", "countryId": 0, "zoneId": 0, "b2bStatus": false ] ], "items": [ [ "id": 0, "model": "", "name": "", "quantity": 0, "price": 0, "finalPrice": 0, "tax": 0, "isTaxAllowed": false, "discount": 0, "shippingTimeInformation": "", "checkoutInformation": "", "attributes": [ "id": 0, "name": "", "value": "", "price": 0, "priceType": "", "combisId": 0, "optionId": 0, "optionValueId": 0 ], "downloadInformation": [""], "addonValues": [ "productId": "", "productType": "" ], "quantityUnitName": "", "gxCustomizerData": [""] ] ], "totals": [ [ "id": 0, "title": "", "value": 0, "valueText": "", "class": "", "sortOrder": 0 ] ], "statusHistory": [ [ "id": 0, "statusId": 0, "dateAdded": "", "comment": "", "customerNotified": false ] ], "addonValues": [ "ccCvv": "", "ccExpires": "", "ccIssue": "", "ccNumber": "", "ccOwner": "", "ccStart": "", "ccType": "", "customerIp": "", "downloadAbandonmentStatus": "", "serviceAbandonmentStatus": "" ] ]
let postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)
var request = NSMutableURLRequest(URL: NSURL(string: "https://gambio-shop.de/shop1/api.php/v2/orders")!, cachePolicy: .UseProtocolCachePolicy, timeoutInterval: 10.0) request.HTTPMethod = "POST" request.allHTTPHeaderFields = headers request.HTTPBody = postData
let session = NSURLSession.sharedSession() let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in if (error != nil) { println(error) } else { let httpResponse = response as? NSHTTPURLResponse println(httpResponse) } })
dataTask.resume()
let uri = Uri.of_string "https://gambio-shop.de/shop1/api.php/v2/orders" in let headers = Header.add_list (Header.init ()) [ ("accept", "application/json"); ("content-type", "application/json"); ("authorization", "Basic REPLACE_BASIC_AUTH"); ] in let body = Cohttp_lwt_body.of_string "{\"id\":0,\"statusId\":0,\"purchaseDate\":\"\",\"currencyCode\":\"\",\"languageCode\":\"\",\"comment\":\"\",\"totalWeight\":0,\"paymentType\":{\"title\":\"\",\"module\":\"\"},\"shippingType\":{\"title\":\"\",\"module\":\"\"},\"customer\":{\"id\":0,\"number\":\"\",\"email\":\"\",\"phone\":\"\",\"vatId\":0,\"status\":{\"id\":0,\"name\":\"\",\"image\":\"\",\"discount\":0,\"isGuest\":false}},\"addresses\":{\"customer\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"billing\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false},\"delivery\":{\"gender\":\"\",\"firstname\":\"\",\"lastname\":\"\",\"company\":\"\",\"street\":\"\",\"houseNumber\":\"\",\"additionalAddressInfo\":\"\",\"suburb\":\"\",\"postcode\":\"\",\"city\":\"\",\"countryId\":0,\"zoneId\":0,\"b2bStatus\":false}},\"items\":[{\"id\":0,\"model\":\"\",\"name\":\"\",\"quantity\":0,\"price\":0,\"finalPrice\":0,\"tax\":0,\"isTaxAllowed\":false,\"discount\":0,\"shippingTimeInformation\":\"\",\"checkoutInformation\":\"\",\"attributes\":{\"id\":0,\"name\":\"\",\"value\":\"\",\"price\":0,\"priceType\":\"\",\"combisId\":0,\"optionId\":0,\"optionValueId\":0},\"downloadInformation\":[\"\"],\"addonValues\":{\"productId\":\"\",\"productType\":\"\"},\"quantityUnitName\":\"\",\"gxCustomizerData\":[\"\"]}],\"totals\":[{\"id\":0,\"title\":\"\",\"value\":0,\"valueText\":\"\",\"class\":\"\",\"sortOrder\":0}],\"statusHistory\":[{\"id\":0,\"statusId\":0,\"dateAdded\":\"\",\"comment\":\"\",\"customerNotified\":false}],\"addonValues\":{\"ccCvv\":\"\",\"ccExpires\":\"\",\"ccIssue\":\"\",\"ccNumber\":\"\",\"ccOwner\":\"\",\"ccStart\":\"\",\"ccType\":\"\",\"customerIp\":\"\",\"downloadAbandonmentStatus\":\"\",\"serviceAbandonmentStatus\":\"\"}}" in
Client.call ~headers ~body `POST uri >>= fun (res, body_stream) -> (* Do stuff with the result *)