Back to Collection Items
load ./chilkat.dll
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
set http [new_CkHttp]
# Use this online tool to generate code from sample JSON: Generate Code to Create JSON
# The following JSON is sent in the request body.
# {
# "number": "<string>",
# "description": "<string>",
# "sale_price": "<float>",
# "id": "<long>",
# "type": "PRODUCT",
# "document_note": "<string>",
# "note": null,
# "unit": null,
# "export_identifier": null,
# "export_identifier_extended": {
# "NULL": null,
# "nStb": null,
# "nStbUstID": null,
# "nStbNoneUstID": null,
# "nStbIm": null,
# "revc": null,
# "IG": null,
# "AL": null,
# "sStfr": null,
# "smallBusiness": null
# },
# "login_id": "<long>",
# "price_type": "NETTO",
# "vat_percent": 19,
# "sale_price2": null,
# "sale_price3": null,
# "sale_price4": null,
# "sale_price5": null,
# "sale_price6": null,
# "sale_price7": null,
# "sale_price8": null,
# "sale_price9": null,
# "sale_price10": null,
# "cost_price": "<float>",
# "export_cost1": null,
# "export_cost2": null,
# "group_id": "<long>",
# "stock": "NO",
# "stock_count": 0,
# "stock_limit_notify": false,
# "stock_limit_notify_frequency": "ALWAYS",
# "stock_limit": 0,
# "quantity": null,
# "archived": false
# }
set json [new_CkJsonObject]
CkJsonObject_UpdateString $json "number" "<string>"
CkJsonObject_UpdateString $json "description" "<string>"
CkJsonObject_UpdateString $json "sale_price" "<float>"
CkJsonObject_UpdateString $json "id" "<long>"
CkJsonObject_UpdateString $json "type" "PRODUCT"
CkJsonObject_UpdateString $json "document_note" "<string>"
CkJsonObject_UpdateNull $json "note"
CkJsonObject_UpdateNull $json "unit"
CkJsonObject_UpdateNull $json "export_identifier"
CkJsonObject_UpdateNull $json "export_identifier_extended.NULL"
CkJsonObject_UpdateNull $json "export_identifier_extended.nStb"
CkJsonObject_UpdateNull $json "export_identifier_extended.nStbUstID"
CkJsonObject_UpdateNull $json "export_identifier_extended.nStbNoneUstID"
CkJsonObject_UpdateNull $json "export_identifier_extended.nStbIm"
CkJsonObject_UpdateNull $json "export_identifier_extended.revc"
CkJsonObject_UpdateNull $json "export_identifier_extended.IG"
CkJsonObject_UpdateNull $json "export_identifier_extended.AL"
CkJsonObject_UpdateNull $json "export_identifier_extended.sStfr"
CkJsonObject_UpdateNull $json "export_identifier_extended.smallBusiness"
CkJsonObject_UpdateString $json "login_id" "<long>"
CkJsonObject_UpdateString $json "price_type" "NETTO"
CkJsonObject_UpdateInt $json "vat_percent" 19
CkJsonObject_UpdateNull $json "sale_price2"
CkJsonObject_UpdateNull $json "sale_price3"
CkJsonObject_UpdateNull $json "sale_price4"
CkJsonObject_UpdateNull $json "sale_price5"
CkJsonObject_UpdateNull $json "sale_price6"
CkJsonObject_UpdateNull $json "sale_price7"
CkJsonObject_UpdateNull $json "sale_price8"
CkJsonObject_UpdateNull $json "sale_price9"
CkJsonObject_UpdateNull $json "sale_price10"
CkJsonObject_UpdateString $json "cost_price" "<float>"
CkJsonObject_UpdateNull $json "export_cost1"
CkJsonObject_UpdateNull $json "export_cost2"
CkJsonObject_UpdateString $json "group_id" "<long>"
CkJsonObject_UpdateString $json "stock" "NO"
CkJsonObject_UpdateInt $json "stock_count" 0
CkJsonObject_UpdateBool $json "stock_limit_notify" 0
CkJsonObject_UpdateString $json "stock_limit_notify_frequency" "ALWAYS"
CkJsonObject_UpdateInt $json "stock_limit" 0
CkJsonObject_UpdateNull $json "quantity"
CkJsonObject_UpdateBool $json "archived" 0
CkHttp_SetRequestHeader $http "Content-Type" "application/json"
CkHttp_SetRequestHeader $http "Authorization" "{{apiKey}}"
CkHttp_SetRequestHeader $http "Accept" "application/json"
# resp is a CkHttpResponse
set resp [CkHttp_PostJson3 $http "https://api.easybill.de/rest/v1/positions" "application/json" $json]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
puts [CkHttp_lastErrorText $http]
delete_CkHttp $http
delete_CkJsonObject $json
exit
}
set sbResponseBody [new_CkStringBuilder]
CkHttpResponse_GetBodySb $resp $sbResponseBody
set jResp [new_CkJsonObject]
CkJsonObject_LoadSb $jResp $sbResponseBody
CkJsonObject_put_EmitCompact $jResp 0
puts "Response Body:"
puts [CkJsonObject_emit $jResp]
set respStatusCode [CkHttpResponse_get_StatusCode $resp]
puts "Response Status Code = $respStatusCode"
if {$respStatusCode >= 400} then {
puts "Response Header:"
puts [CkHttpResponse_header $resp]
puts "Failed."
delete_CkHttpResponse $resp
delete_CkHttp $http
delete_CkJsonObject $json
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $jResp
exit
}
delete_CkHttpResponse $resp
# Sample JSON response:
# (Sample code for parsing the JSON response is shown below)
# {
# "number": "<string>",
# "description": "<string>",
# "sale_price": "<float>",
# "id": "<long>",
# "type": "PRODUCT",
# "document_note": "<string>",
# "note": null,
# "unit": null,
# "export_identifier": null,
# "export_identifier_extended": {
# "NULL": null,
# "nStb": null,
# "nStbUstID": null,
# "nStbNoneUstID": null,
# "nStbIm": null,
# "revc": null,
# "IG": null,
# "AL": null,
# "sStfr": null,
# "smallBusiness": null
# },
# "login_id": "<long>",
# "price_type": "NETTO",
# "vat_percent": 19,
# "sale_price2": null,
# "sale_price3": null,
# "sale_price4": null,
# "sale_price5": null,
# "sale_price6": null,
# "sale_price7": null,
# "sale_price8": null,
# "sale_price9": null,
# "sale_price10": null,
# "cost_price": "<float>",
# "export_cost1": null,
# "export_cost2": null,
# "group_id": "<long>",
# "stock": "NO",
# "stock_count": 0,
# "stock_limit_notify": false,
# "stock_limit_notify_frequency": "ALWAYS",
# "stock_limit": 0,
# "quantity": null,
# "archived": false
# }
# Sample code for parsing the JSON response...
# Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
set v_number [CkJsonObject_stringOf $jResp "number"]
set description [CkJsonObject_stringOf $jResp "description"]
set sale_price [CkJsonObject_stringOf $jResp "sale_price"]
set id [CkJsonObject_stringOf $jResp "id"]
set v_type [CkJsonObject_stringOf $jResp "type"]
set document_note [CkJsonObject_stringOf $jResp "document_note"]
set note [CkJsonObject_stringOf $jResp "note"]
set unit [CkJsonObject_stringOf $jResp "unit"]
set export_identifier [CkJsonObject_stringOf $jResp "export_identifier"]
set v_NULL [CkJsonObject_stringOf $jResp "export_identifier_extended.NULL"]
set NStb [CkJsonObject_stringOf $jResp "export_identifier_extended.nStb"]
set NStbUstID [CkJsonObject_stringOf $jResp "export_identifier_extended.nStbUstID"]
set NStbNoneUstID [CkJsonObject_stringOf $jResp "export_identifier_extended.nStbNoneUstID"]
set NStbIm [CkJsonObject_stringOf $jResp "export_identifier_extended.nStbIm"]
set Revc [CkJsonObject_stringOf $jResp "export_identifier_extended.revc"]
set IG [CkJsonObject_stringOf $jResp "export_identifier_extended.IG"]
set AL [CkJsonObject_stringOf $jResp "export_identifier_extended.AL"]
set SStfr [CkJsonObject_stringOf $jResp "export_identifier_extended.sStfr"]
set SmallBusiness [CkJsonObject_stringOf $jResp "export_identifier_extended.smallBusiness"]
set login_id [CkJsonObject_stringOf $jResp "login_id"]
set price_type [CkJsonObject_stringOf $jResp "price_type"]
set vat_percent [CkJsonObject_IntOf $jResp "vat_percent"]
set sale_price2 [CkJsonObject_stringOf $jResp "sale_price2"]
set sale_price3 [CkJsonObject_stringOf $jResp "sale_price3"]
set sale_price4 [CkJsonObject_stringOf $jResp "sale_price4"]
set sale_price5 [CkJsonObject_stringOf $jResp "sale_price5"]
set sale_price6 [CkJsonObject_stringOf $jResp "sale_price6"]
set sale_price7 [CkJsonObject_stringOf $jResp "sale_price7"]
set sale_price8 [CkJsonObject_stringOf $jResp "sale_price8"]
set sale_price9 [CkJsonObject_stringOf $jResp "sale_price9"]
set sale_price10 [CkJsonObject_stringOf $jResp "sale_price10"]
set cost_price [CkJsonObject_stringOf $jResp "cost_price"]
set export_cost1 [CkJsonObject_stringOf $jResp "export_cost1"]
set export_cost2 [CkJsonObject_stringOf $jResp "export_cost2"]
set group_id [CkJsonObject_stringOf $jResp "group_id"]
set stock [CkJsonObject_stringOf $jResp "stock"]
set stock_count [CkJsonObject_IntOf $jResp "stock_count"]
set stock_limit_notify [CkJsonObject_BoolOf $jResp "stock_limit_notify"]
set stock_limit_notify_frequency [CkJsonObject_stringOf $jResp "stock_limit_notify_frequency"]
set stock_limit [CkJsonObject_IntOf $jResp "stock_limit"]
set quantity [CkJsonObject_stringOf $jResp "quantity"]
set archived [CkJsonObject_BoolOf $jResp "archived"]
delete_CkHttp $http
delete_CkJsonObject $json
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $jResp
Curl Command
curl -X POST
-H "Authorization: {{apiKey}}"
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{
"number": "<string>",
"description": "<string>",
"sale_price": "<float>",
"id": "<long>",
"type": "PRODUCT",
"document_note": "<string>",
"note": null,
"unit": null,
"export_identifier": null,
"export_identifier_extended": {
"NULL": null,
"nStb": null,
"nStbUstID": null,
"nStbNoneUstID": null,
"nStbIm": null,
"revc": null,
"IG": null,
"AL": null,
"sStfr": null,
"smallBusiness": null
},
"login_id": "<long>",
"price_type": "NETTO",
"vat_percent": 19,
"sale_price2": null,
"sale_price3": null,
"sale_price4": null,
"sale_price5": null,
"sale_price6": null,
"sale_price7": null,
"sale_price8": null,
"sale_price9": null,
"sale_price10": null,
"cost_price": "<float>",
"export_cost1": null,
"export_cost2": null,
"group_id": "<long>",
"stock": "NO",
"stock_count": 0,
"stock_limit_notify": false,
"stock_limit_notify_frequency": "ALWAYS",
"stock_limit": 0,
"quantity": null,
"archived": false
}'
https://api.easybill.de/rest/v1/positions
Postman Collection Item JSON
{
"name": "Create position",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"number\": \"<string>\",\n \"description\": \"<string>\",\n \"sale_price\": \"<float>\",\n \"id\": \"<long>\",\n \"type\": \"PRODUCT\",\n \"document_note\": \"<string>\",\n \"note\": null,\n \"unit\": null,\n \"export_identifier\": null,\n \"export_identifier_extended\": {\n \"NULL\": null,\n \"nStb\": null,\n \"nStbUstID\": null,\n \"nStbNoneUstID\": null,\n \"nStbIm\": null,\n \"revc\": null,\n \"IG\": null,\n \"AL\": null,\n \"sStfr\": null,\n \"smallBusiness\": null\n },\n \"login_id\": \"<long>\",\n \"price_type\": \"NETTO\",\n \"vat_percent\": 19,\n \"sale_price2\": null,\n \"sale_price3\": null,\n \"sale_price4\": null,\n \"sale_price5\": null,\n \"sale_price6\": null,\n \"sale_price7\": null,\n \"sale_price8\": null,\n \"sale_price9\": null,\n \"sale_price10\": null,\n \"cost_price\": \"<float>\",\n \"export_cost1\": null,\n \"export_cost2\": null,\n \"group_id\": \"<long>\",\n \"stock\": \"NO\",\n \"stock_count\": 0,\n \"stock_limit_notify\": false,\n \"stock_limit_notify_frequency\": \"ALWAYS\",\n \"stock_limit\": 0,\n \"quantity\": null,\n \"archived\": false\n}",
"options": {
"raw": {
"headerFamily": "json",
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/positions",
"host": [
"{{baseUrl}}"
],
"path": [
"positions"
]
}
},
"response": [
{
"name": "Successful operation",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "Authorization",
"value": "<API Key>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"number\": \"<string>\",\n \"description\": \"<string>\",\n \"sale_price\": \"<float>\",\n \"id\": \"<long>\",\n \"type\": \"PRODUCT\",\n \"document_note\": \"<string>\",\n \"note\": null,\n \"unit\": null,\n \"export_identifier\": null,\n \"export_identifier_extended\": {\n \"NULL\": null,\n \"nStb\": null,\n \"nStbUstID\": null,\n \"nStbNoneUstID\": null,\n \"nStbIm\": null,\n \"revc\": null,\n \"IG\": null,\n \"AL\": null,\n \"sStfr\": null,\n \"smallBusiness\": null\n },\n \"login_id\": \"<long>\",\n \"price_type\": \"NETTO\",\n \"vat_percent\": 19,\n \"sale_price2\": null,\n \"sale_price3\": null,\n \"sale_price4\": null,\n \"sale_price5\": null,\n \"sale_price6\": null,\n \"sale_price7\": null,\n \"sale_price8\": null,\n \"sale_price9\": null,\n \"sale_price10\": null,\n \"cost_price\": \"<float>\",\n \"export_cost1\": null,\n \"export_cost2\": null,\n \"group_id\": \"<long>\",\n \"stock\": \"NO\",\n \"stock_count\": 0,\n \"stock_limit_notify\": false,\n \"stock_limit_notify_frequency\": \"ALWAYS\",\n \"stock_limit\": 0,\n \"quantity\": null,\n \"archived\": false\n}",
"options": {
"raw": {
"headerFamily": "json",
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/positions",
"host": [
"{{baseUrl}}"
],
"path": [
"positions"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"number\": \"<string>\",\n \"description\": \"<string>\",\n \"sale_price\": \"<float>\",\n \"id\": \"<long>\",\n \"type\": \"PRODUCT\",\n \"document_note\": \"<string>\",\n \"note\": null,\n \"unit\": null,\n \"export_identifier\": null,\n \"export_identifier_extended\": {\n \"NULL\": null,\n \"nStb\": null,\n \"nStbUstID\": null,\n \"nStbNoneUstID\": null,\n \"nStbIm\": null,\n \"revc\": null,\n \"IG\": null,\n \"AL\": null,\n \"sStfr\": null,\n \"smallBusiness\": null\n },\n \"login_id\": \"<long>\",\n \"price_type\": \"NETTO\",\n \"vat_percent\": 19,\n \"sale_price2\": null,\n \"sale_price3\": null,\n \"sale_price4\": null,\n \"sale_price5\": null,\n \"sale_price6\": null,\n \"sale_price7\": null,\n \"sale_price8\": null,\n \"sale_price9\": null,\n \"sale_price10\": null,\n \"cost_price\": \"<float>\",\n \"export_cost1\": null,\n \"export_cost2\": null,\n \"group_id\": \"<long>\",\n \"stock\": \"NO\",\n \"stock_count\": 0,\n \"stock_limit_notify\": false,\n \"stock_limit_notify_frequency\": \"ALWAYS\",\n \"stock_limit\": 0,\n \"quantity\": null,\n \"archived\": false\n}"
},
{
"name": "Too Many Requests",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "Authorization",
"value": "<API Key>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"number\": \"<string>\",\n \"description\": \"<string>\",\n \"sale_price\": \"<float>\",\n \"id\": \"<long>\",\n \"type\": \"PRODUCT\",\n \"document_note\": \"<string>\",\n \"note\": null,\n \"unit\": null,\n \"export_identifier\": null,\n \"export_identifier_extended\": {\n \"NULL\": null,\n \"nStb\": null,\n \"nStbUstID\": null,\n \"nStbNoneUstID\": null,\n \"nStbIm\": null,\n \"revc\": null,\n \"IG\": null,\n \"AL\": null,\n \"sStfr\": null,\n \"smallBusiness\": null\n },\n \"login_id\": \"<long>\",\n \"price_type\": \"NETTO\",\n \"vat_percent\": 19,\n \"sale_price2\": null,\n \"sale_price3\": null,\n \"sale_price4\": null,\n \"sale_price5\": null,\n \"sale_price6\": null,\n \"sale_price7\": null,\n \"sale_price8\": null,\n \"sale_price9\": null,\n \"sale_price10\": null,\n \"cost_price\": \"<float>\",\n \"export_cost1\": null,\n \"export_cost2\": null,\n \"group_id\": \"<long>\",\n \"stock\": \"NO\",\n \"stock_count\": 0,\n \"stock_limit_notify\": false,\n \"stock_limit_notify_frequency\": \"ALWAYS\",\n \"stock_limit\": 0,\n \"quantity\": null,\n \"archived\": false\n}",
"options": {
"raw": {
"headerFamily": "json",
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/positions",
"host": [
"{{baseUrl}}"
],
"path": [
"positions"
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
}
]
}