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
Read-only parameters such as a resource's ID field are to be omitted.
The request body takes a 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@example.org",
"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",
"customizationData": {},
"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 | Required |
addonValues.ccCvv | string | Required | |
addonValues.ccExpires | string | Required | |
addonValues.ccIssue | string | Required | |
addonValues.ccNumber | string | Required | |
addonValues.ccOwner | string | Required | |
addonValues.ccStart | string | Required | |
addonValues.ccType | string | Required | |
addonValues.customerIp | string | Required | |
addonValues.downloadAbandonmentStatus | string | Required | |
addonValues.serviceAbandonmentStatus | string | Required | |
addresses | object | GXOrderAddressMain | Required |
addresses.billing | object | GXOrderAddress | Optional |
addresses.billing.additionalAddressInfo | string | Required | |
addresses.billing.b2bStatus | boolean | Required | |
addresses.billing.city | string | Required | |
addresses.billing.postcode | string | Required | |
addresses.billing.company | string | Required | |
addresses.billing.countryId | int64 | Required | |
addresses.billing.firstname | string | Required | |
addresses.billing.gender | string | Required | |
addresses.billing.houseNumber | string | Required | |
addresses.billing.lastname | string | Required | |
addresses.billing.street | string | Required | |
addresses.billing.suburb | string | Required | |
addresses.billing.zoneId | int64 | Required | |
addresses.customer | object | GXOrderAddress | Optional |
addresses.customer.additionalAddressInfo | string | Required | |
addresses.customer.b2bStatus | boolean | Required | |
addresses.customer.city | string | Required | |
addresses.customer.postcode | string | Required | |
addresses.customer.company | string | Required | |
addresses.customer.countryId | int64 | Required | |
addresses.customer.firstname | string | Required | |
addresses.customer.gender | string | Required | |
addresses.customer.houseNumber | string | Required | |
addresses.customer.lastname | string | Required | |
addresses.customer.street | string | Required | |
addresses.customer.suburb | string | Required | |
addresses.customer.zoneId | int64 | Required | |
addresses.delivery | object | GXOrderAddress | Optional |
addresses.delivery.additionalAddressInfo | string | Required | |
addresses.delivery.b2bStatus | boolean | Required | |
addresses.delivery.city | string | Required | |
addresses.delivery.postcode | string | Required | |
addresses.delivery.company | string | Required | |
addresses.delivery.countryId | int64 | Required | |
addresses.delivery.firstname | string | Required | |
addresses.delivery.gender | string | Required | |
addresses.delivery.houseNumber | string | Required | |
addresses.delivery.lastname | string | Required | |
addresses.delivery.street | string | Required | |
addresses.delivery.suburb | string | Required | |
addresses.delivery.zoneId | int64 | Required | |
comment | string | Required | |
currencyCode | string | Required | |
customer | object | GXCustomer | Required |
customer.email | string | Required | |
customer.number | string | Required | |
customer.phone | string | Required | |
customer.status | object | GXCustomerStatus | Required |
customer.status.discount | int64 | Required | |
customer.status.image | string | Required | |
customer.status.isGuest | boolean | Required | |
customer.status.name | string | Required | |
customer.vatId | int64 | Required | |
items[] | array | Required | |
items[].addonValues | object | GXOrderItemsAddons | Required |
items[].addonValues.productId | string | Required | |
items[].addonValues.productType | string | Required | |
items[].attributes | object | GXOrderItemAttributes | Required |
items[].attributes.combisId | int64 | Required | |
items[].attributes.name | string | Required | |
items[].attributes.optionId | int64 | Required | |
items[].attributes.optionValueId | int64 | Required | |
items[].attributes.price | int64 | Required | |
items[].attributes.priceType | string | Required | |
items[].attributes.value | string | Required | |
items[].checkoutInformation | string | Required | |
items[].customizationData | object | Optional | |
items[].discount | int64 | Required | |
items[].downloadInformation[] | array of string | Required | |
items[].finalPrice | int64 | Required | |
items[].gxCustomizerData[] | array of string | Required | |
items[].isTaxAllowed | boolean | Required | |
items[].model | string | Required | |
items[].name | string | Required | |
items[].price | int64 | Required | |
items[].quantity | int64 | Required | |
items[].quantityUnitName | string | Required | |
items[].shippingTimeInformation | string | Required | |
items[].tax | int64 | Required | |
languageCode | string | Required | |
paymentType | object | GXPaymentType | Required |
paymentType.module | string | Required | |
paymentType.title | string | Required | |
purchaseDate | string | Required | |
shippingType | object | GXPaymentType | Required |
shippingType.module | string | Required | |
shippingType.title | string | Required | |
statusHistory[] | array | Required | |
statusHistory[].comment | string | Required | |
statusHistory[].customerNotified | boolean | Required | |
statusHistory[].dateAdded | string | Required | |
statusHistory[].statusId | int64 | Required | |
statusId | int64 | Required | |
totals[] | array | Required | |
totals[].class | string | Required | |
totals[].sortOrder | int64 | Required | |
totals[].title | string | Required | |
totals[].value | int64 | Required | |
totals[].valueText | string | Required | |
totalWeight | int64 | Required |
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@example.org: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.
curl --request POST \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{"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":[""],"customizationData":{}}],"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":""}}'
wget --quiet \ --method POST \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' \ --body-data '{"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":[""],"customizationData":{}}],"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":""}}' \ --output-document
echo '{"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":[""],"customizationData":{}}],"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":""}}' | \ http POST https://gambio-shop.de/shop1/api.php/v2/orders \ Authorization:'Basic REPLACE_BASIC_AUTH' \ accept:application/json \ content-type:application/json
HttpResponse response = Unirest.post("https://gambio-shop.de/shop1/api.php/v2/orders") .header("accept", "application/json") .header("content-type", "application/json") .header("Authorization", "Basic REPLACE_BASIC_AUTH") .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\":[\"\"],\"customizationData\":{}}],\"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\":\"\"}}") .asString();
OkHttpClient client = new OkHttpClient(); 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\":[\"\"],\"customizationData\":{}}],\"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() .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 request = new RestRequest(Method.POST); request.AddHeader("accept", "application/json"); request.AddHeader("content-type", "application/json"); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); request.AddParameter("application/json", "{\"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\":[\"\"],\"customizationData\":{}}],\"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\":\"\"}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
const http = require("https"); const 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" }
}; const req = http.request(options, function (res) {
const chunks = []; res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const 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: '<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>'], customizationData: {} } ],
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.end();
const request = require('request'); const options = {
method: 'POST', headers: { accept: 'application/json',
'content-type': 'application/json', Authorization: 'Basic REPLACE_BASIC_AUTH' },
body: { 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>'], customizationData: {} } ], 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>' } },
json: true }; request(options, function (error, response, body) {
if (error) throw new Error(error); console.log(body);
});
const unirest = require("unirest"); const req = unirest("POST", "https://gambio-shop.de/shop1/api.php/v2/orders");
req.headers({
"accept": "application/json", "content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" }); req.type("json");
req.send({ "id": 0, "statusId": 0, "purchaseDate": "", "currencyCode": "", "languageCode": "", "comment": "", "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>" ], "customizationData": {} } ],
"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.end(function (res) {
if (res.error) throw new Error(res.error); console.log(res.body);
});
const data = JSON.stringify({ "id": 0, "statusId": 0, "purchaseDate": "", "currencyCode": "", "languageCode": "", "comment": "", "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>" ], "customizationData": {} } ],
"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>" }
}); const 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);
const settings = { "async": true, "crossDomain": true, "method": "POST", "headers": { "accept": "application/json",
"content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" },
"processData": false, "data": "{\"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\":[\"\"],\"customizationData\":{}}],\"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\":\"\"}}" }; $.ajax(settings).done(function (response) {
console.log(response); });
<?php $curl = curl_init();
curl_setopt_array($curl, [
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\":[\"\"],\"customizationData\":{}}],\"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 => [ "Authorization: Basic REPLACE_BASIC_AUTH",
"accept: application/json", "content-type: application/json" ],
]); $response = curl_exec($curl);
$err = curl_error($curl); curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err; } else { echo $response; }
<?php $request = new HttpRequest();
$request->setUrl('https://gambio-shop.de/shop1/api.php/v2/orders'); $request->setMethod(HTTP_METH_POST); $request->setHeaders([
'accept' => 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Basic REPLACE_BASIC_AUTH' ]); $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":[""],"customizationData":{}}],"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; }
<?php $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":[""],"customizationData":{}}],"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([
'accept' => 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Basic REPLACE_BASIC_AUTH' ]); $client->enqueue($request)->send();
$response = $client->getResponse(); echo $response->getBody();
import http.client 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\":[\"\"],\"customizationData\":{}}],\"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"))
import requests payload = {
"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>"], "customizationData": {} } ], "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>" } }
headers = { "accept": "application/json",
"content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" }
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
require 'uri' require 'net/http' require 'openssl' 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\":[\"\"],\"customizationData\":{}}],\"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 *hnd = curl_easy_init(); 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, "accept: application/json"); headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); 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\":[\"\"],\"customizationData\":{}}],\"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);
package main 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>\"],\"customizationData\":{}}],\"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)) }
#import NSDictionary *headers = @{ @"accept": @"application/json",
@"content-type": @"application/json",
@"Authorization": @"Basic REPLACE_BASIC_AUTH" }; NSDictionary *parameters = @{ @"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": @NO } }, @"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": @NO }, @"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": @NO }, @"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": @NO } }, @"items": @[ @{ @"id": @0, @"model": @"<ADD STRING VALUE>", @"name": @"<ADD STRING VALUE>", @"quantity": @0, @"price": @0, @"finalPrice": @0, @"tax": @0, @"isTaxAllowed": @NO, @"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>" ], @"customizationData": @{ } } ], @"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": @NO } ], @"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>" } }; 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];
import Foundation 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": "<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>"], "customizationData": [] ] ],
"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>" ]
] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://gambio-shop.de/shop1/api.php/v2/orders")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0) request.httpMethod = "POST"
request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse) }
}) dataTask.resume()
open Cohttp_lwt_unix open Cohttp open Lwt 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\":[\"\"],\"customizationData\":{}}],\"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 *)