Chilkat Online Tools

unicodeC / easybill REST API / Update Customer

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW json;
    HCkStringBuilderW sbRequestBody;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *strVal;
    const wchar_t *last_name;
    const wchar_t *company_name;
    int acquire_options;
    const wchar_t *bank_account;
    const wchar_t *bank_account_owner;
    const wchar_t *bank_bic;
    const wchar_t *bank_code;
    const wchar_t *bank_iban;
    const wchar_t *bank_name;
    const wchar_t *birth_date;
    const wchar_t *cash_allowance;
    int cash_allowance_days;
    const wchar_t *cash_discount;
    const wchar_t *cash_discount_type;
    const wchar_t *city;
    const wchar_t *state;
    const wchar_t *country;
    const wchar_t *created_at;
    const wchar_t *updated_at;
    const wchar_t *delivery_title;
    const wchar_t *delivery_city;
    const wchar_t *delivery_state;
    const wchar_t *delivery_company_name;
    const wchar_t *delivery_country;
    const wchar_t *delivery_first_name;
    const wchar_t *delivery_last_name;
    const wchar_t *delivery_personal;
    int delivery_salutation;
    const wchar_t *delivery_street;
    const wchar_t *delivery_suffix_1;
    const wchar_t *delivery_suffix_2;
    const wchar_t *delivery_zip_code;
    const wchar_t *display_name;
    const wchar_t *fax;
    const wchar_t *first_name;
    const wchar_t *grace_period;
    const wchar_t *due_in_days;
    const wchar_t *group_id;
    const wchar_t *id;
    const wchar_t *info_1;
    const wchar_t *info_2;
    const wchar_t *internet;
    const wchar_t *login_id;
    const wchar_t *mobile;
    const wchar_t *note;
    const wchar_t *v_number;
    int payment_options;
    BOOL personal;
    const wchar_t *phone_1;
    const wchar_t *phone_2;
    const wchar_t *postbox;
    const wchar_t *postbox_city;
    const wchar_t *postbox_state;
    const wchar_t *postbox_country;
    const wchar_t *postbox_zip_code;
    const wchar_t *sale_price_level;
    int salutation;
    const wchar_t *sepa_agreement;
    const wchar_t *sepa_agreement_date;
    const wchar_t *sepa_mandate_reference;
    const wchar_t *since_date;
    const wchar_t *street;
    const wchar_t *suffix_1;
    const wchar_t *suffix_2;
    const wchar_t *tax_number;
    const wchar_t *court;
    const wchar_t *court_registry_number;
    const wchar_t *tax_options;
    const wchar_t *title;
    const wchar_t *archived;
    const wchar_t *vat_identifier;
    const wchar_t *zip_code;
    const wchar_t *document_pdf_type;
    const wchar_t *buyer_reference;
    const wchar_t *foreign_supplier_number;
    int i;
    int count_i;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_Create();

    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    // The following JSON is sent in the request body.

    // {
    //   "last_name": "<string>",
    //   "company_name": "<string>",
    //   "acquire_options": 2,
    //   "additional_groups_ids": [
    //     "<integer>",
    //     "<integer>"
    //   ],
    //   "bank_account": "<string>",
    //   "bank_account_owner": "<string>",
    //   "bank_bic": "<string>",
    //   "bank_code": "<string>",
    //   "bank_iban": "<string>",
    //   "bank_name": "<string>",
    //   "birth_date": "<date>",
    //   "cash_allowance": "<float>",
    //   "cash_allowance_days": 7,
    //   "cash_discount": "<float>",
    //   "cash_discount_type": "AMOUNT",
    //   "city": "<string>",
    //   "state": "<string>",
    //   "country": "<string>",
    //   "created_at": "<date>",
    //   "updated_at": "<string>",
    //   "delivery_title": "<string>",
    //   "delivery_city": "<string>",
    //   "delivery_state": "<string>",
    //   "delivery_company_name": "<string>",
    //   "delivery_country": "<string>",
    //   "delivery_first_name": "<string>",
    //   "delivery_last_name": "<string>",
    //   "delivery_personal": "<boolean>",
    //   "delivery_salutation": 0,
    //   "delivery_street": "<string>",
    //   "delivery_suffix_1": "<string>",
    //   "delivery_suffix_2": "<string>",
    //   "delivery_zip_code": "<string>",
    //   "display_name": "<string>",
    //   "emails": [
    //     "<string>",
    //     "<string>"
    //   ],
    //   "fax": "<string>",
    //   "first_name": "<string>",
    //   "grace_period": "<integer>",
    //   "due_in_days": "<integer>",
    //   "group_id": "<integer>",
    //   "id": "<long>",
    //   "info_1": "<string>",
    //   "info_2": "<string>",
    //   "internet": "<string>",
    //   "login_id": "<long>",
    //   "mobile": "<string>",
    //   "note": "<string>",
    //   "number": "<string>",
    //   "payment_options": 5,
    //   "personal": false,
    //   "phone_1": "<string>",
    //   "phone_2": "<string>",
    //   "postbox": "<string>",
    //   "postbox_city": "<string>",
    //   "postbox_state": "<string>",
    //   "postbox_country": "<string>",
    //   "postbox_zip_code": "<string>",
    //   "sale_price_level": "SALEPRICE10",
    //   "salutation": 0,
    //   "sepa_agreement": "BASIC",
    //   "sepa_agreement_date": "<date>",
    //   "sepa_mandate_reference": "<string>",
    //   "since_date": "<date>",
    //   "street": "<string>",
    //   "suffix_1": "<string>",
    //   "suffix_2": "<string>",
    //   "tax_number": "<string>",
    //   "court": "<string>",
    //   "court_registry_number": "<string>",
    //   "tax_options": "nStbUstID",
    //   "title": "<string>",
    //   "archived": "<boolean>",
    //   "vat_identifier": "<string>",
    //   "zip_code": "<string>",
    //   "document_pdf_type": "default",
    //   "buyer_reference": "<string>",
    //   "foreign_supplier_number": "<string>"
    // }

    json = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(json,L"last_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"company_name",L"<string>");
    CkJsonObjectW_UpdateInt(json,L"acquire_options",2);
    CkJsonObjectW_UpdateString(json,L"additional_groups_ids[0]",L"<integer>");
    CkJsonObjectW_UpdateString(json,L"additional_groups_ids[1]",L"<integer>");
    CkJsonObjectW_UpdateString(json,L"bank_account",L"<string>");
    CkJsonObjectW_UpdateString(json,L"bank_account_owner",L"<string>");
    CkJsonObjectW_UpdateString(json,L"bank_bic",L"<string>");
    CkJsonObjectW_UpdateString(json,L"bank_code",L"<string>");
    CkJsonObjectW_UpdateString(json,L"bank_iban",L"<string>");
    CkJsonObjectW_UpdateString(json,L"bank_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"birth_date",L"<date>");
    CkJsonObjectW_UpdateString(json,L"cash_allowance",L"<float>");
    CkJsonObjectW_UpdateInt(json,L"cash_allowance_days",7);
    CkJsonObjectW_UpdateString(json,L"cash_discount",L"<float>");
    CkJsonObjectW_UpdateString(json,L"cash_discount_type",L"AMOUNT");
    CkJsonObjectW_UpdateString(json,L"city",L"<string>");
    CkJsonObjectW_UpdateString(json,L"state",L"<string>");
    CkJsonObjectW_UpdateString(json,L"country",L"<string>");
    CkJsonObjectW_UpdateString(json,L"created_at",L"<date>");
    CkJsonObjectW_UpdateString(json,L"updated_at",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_title",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_city",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_state",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_company_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_country",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_first_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_last_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_personal",L"<boolean>");
    CkJsonObjectW_UpdateInt(json,L"delivery_salutation",0);
    CkJsonObjectW_UpdateString(json,L"delivery_street",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_suffix_1",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_suffix_2",L"<string>");
    CkJsonObjectW_UpdateString(json,L"delivery_zip_code",L"<string>");
    CkJsonObjectW_UpdateString(json,L"display_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"emails[0]",L"<string>");
    CkJsonObjectW_UpdateString(json,L"emails[1]",L"<string>");
    CkJsonObjectW_UpdateString(json,L"fax",L"<string>");
    CkJsonObjectW_UpdateString(json,L"first_name",L"<string>");
    CkJsonObjectW_UpdateString(json,L"grace_period",L"<integer>");
    CkJsonObjectW_UpdateString(json,L"due_in_days",L"<integer>");
    CkJsonObjectW_UpdateString(json,L"group_id",L"<integer>");
    CkJsonObjectW_UpdateString(json,L"id",L"<long>");
    CkJsonObjectW_UpdateString(json,L"info_1",L"<string>");
    CkJsonObjectW_UpdateString(json,L"info_2",L"<string>");
    CkJsonObjectW_UpdateString(json,L"internet",L"<string>");
    CkJsonObjectW_UpdateString(json,L"login_id",L"<long>");
    CkJsonObjectW_UpdateString(json,L"mobile",L"<string>");
    CkJsonObjectW_UpdateString(json,L"note",L"<string>");
    CkJsonObjectW_UpdateString(json,L"number",L"<string>");
    CkJsonObjectW_UpdateInt(json,L"payment_options",5);
    CkJsonObjectW_UpdateBool(json,L"personal",FALSE);
    CkJsonObjectW_UpdateString(json,L"phone_1",L"<string>");
    CkJsonObjectW_UpdateString(json,L"phone_2",L"<string>");
    CkJsonObjectW_UpdateString(json,L"postbox",L"<string>");
    CkJsonObjectW_UpdateString(json,L"postbox_city",L"<string>");
    CkJsonObjectW_UpdateString(json,L"postbox_state",L"<string>");
    CkJsonObjectW_UpdateString(json,L"postbox_country",L"<string>");
    CkJsonObjectW_UpdateString(json,L"postbox_zip_code",L"<string>");
    CkJsonObjectW_UpdateString(json,L"sale_price_level",L"SALEPRICE10");
    CkJsonObjectW_UpdateInt(json,L"salutation",0);
    CkJsonObjectW_UpdateString(json,L"sepa_agreement",L"BASIC");
    CkJsonObjectW_UpdateString(json,L"sepa_agreement_date",L"<date>");
    CkJsonObjectW_UpdateString(json,L"sepa_mandate_reference",L"<string>");
    CkJsonObjectW_UpdateString(json,L"since_date",L"<date>");
    CkJsonObjectW_UpdateString(json,L"street",L"<string>");
    CkJsonObjectW_UpdateString(json,L"suffix_1",L"<string>");
    CkJsonObjectW_UpdateString(json,L"suffix_2",L"<string>");
    CkJsonObjectW_UpdateString(json,L"tax_number",L"<string>");
    CkJsonObjectW_UpdateString(json,L"court",L"<string>");
    CkJsonObjectW_UpdateString(json,L"court_registry_number",L"<string>");
    CkJsonObjectW_UpdateString(json,L"tax_options",L"nStbUstID");
    CkJsonObjectW_UpdateString(json,L"title",L"<string>");
    CkJsonObjectW_UpdateString(json,L"archived",L"<boolean>");
    CkJsonObjectW_UpdateString(json,L"vat_identifier",L"<string>");
    CkJsonObjectW_UpdateString(json,L"zip_code",L"<string>");
    CkJsonObjectW_UpdateString(json,L"document_pdf_type",L"default");
    CkJsonObjectW_UpdateString(json,L"buyer_reference",L"<string>");
    CkJsonObjectW_UpdateString(json,L"foreign_supplier_number",L"<string>");

    CkHttpW_SetRequestHeader(http,L"Content-Type",L"application/json");
    CkHttpW_SetRequestHeader(http,L"Authorization",L"{{apiKey}}");
    CkHttpW_SetRequestHeader(http,L"Accept",L"application/json");

    sbRequestBody = CkStringBuilderW_Create();
    CkJsonObjectW_EmitSb(json,sbRequestBody);

    resp = CkHttpW_PTextSb(http,L"PUT",L"https://api.easybill.de/rest/v1/customers/:id",sbRequestBody,L"utf-8",L"application/json",FALSE,FALSE);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        CkStringBuilderW_Dispose(sbRequestBody);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        CkStringBuilderW_Dispose(sbRequestBody);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "last_name": "<string>",
    //   "company_name": "<string>",
    //   "acquire_options": 2,
    //   "additional_groups_ids": [
    //     "<integer>",
    //     "<integer>"
    //   ],
    //   "bank_account": "<string>",
    //   "bank_account_owner": "<string>",
    //   "bank_bic": "<string>",
    //   "bank_code": "<string>",
    //   "bank_iban": "<string>",
    //   "bank_name": "<string>",
    //   "birth_date": "<date>",
    //   "cash_allowance": "<float>",
    //   "cash_allowance_days": 7,
    //   "cash_discount": "<float>",
    //   "cash_discount_type": "AMOUNT",
    //   "city": "<string>",
    //   "state": "<string>",
    //   "country": "<string>",
    //   "created_at": "<date>",
    //   "updated_at": "<string>",
    //   "delivery_title": "<string>",
    //   "delivery_city": "<string>",
    //   "delivery_state": "<string>",
    //   "delivery_company_name": "<string>",
    //   "delivery_country": "<string>",
    //   "delivery_first_name": "<string>",
    //   "delivery_last_name": "<string>",
    //   "delivery_personal": "<boolean>",
    //   "delivery_salutation": 0,
    //   "delivery_street": "<string>",
    //   "delivery_suffix_1": "<string>",
    //   "delivery_suffix_2": "<string>",
    //   "delivery_zip_code": "<string>",
    //   "display_name": "<string>",
    //   "emails": [
    //     "<string>",
    //     "<string>"
    //   ],
    //   "fax": "<string>",
    //   "first_name": "<string>",
    //   "grace_period": "<integer>",
    //   "due_in_days": "<integer>",
    //   "group_id": "<integer>",
    //   "id": "<long>",
    //   "info_1": "<string>",
    //   "info_2": "<string>",
    //   "internet": "<string>",
    //   "login_id": "<long>",
    //   "mobile": "<string>",
    //   "note": "<string>",
    //   "number": "<string>",
    //   "payment_options": 5,
    //   "personal": false,
    //   "phone_1": "<string>",
    //   "phone_2": "<string>",
    //   "postbox": "<string>",
    //   "postbox_city": "<string>",
    //   "postbox_state": "<string>",
    //   "postbox_country": "<string>",
    //   "postbox_zip_code": "<string>",
    //   "sale_price_level": "SALEPRICE10",
    //   "salutation": 0,
    //   "sepa_agreement": "BASIC",
    //   "sepa_agreement_date": "<date>",
    //   "sepa_mandate_reference": "<string>",
    //   "since_date": "<date>",
    //   "street": "<string>",
    //   "suffix_1": "<string>",
    //   "suffix_2": "<string>",
    //   "tax_number": "<string>",
    //   "court": "<string>",
    //   "court_registry_number": "<string>",
    //   "tax_options": "nStbUstID",
    //   "title": "<string>",
    //   "archived": "<boolean>",
    //   "vat_identifier": "<string>",
    //   "zip_code": "<string>",
    //   "document_pdf_type": "default",
    //   "buyer_reference": "<string>",
    //   "foreign_supplier_number": "<string>"
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    last_name = CkJsonObjectW_stringOf(jResp,L"last_name");
    company_name = CkJsonObjectW_stringOf(jResp,L"company_name");
    acquire_options = CkJsonObjectW_IntOf(jResp,L"acquire_options");
    bank_account = CkJsonObjectW_stringOf(jResp,L"bank_account");
    bank_account_owner = CkJsonObjectW_stringOf(jResp,L"bank_account_owner");
    bank_bic = CkJsonObjectW_stringOf(jResp,L"bank_bic");
    bank_code = CkJsonObjectW_stringOf(jResp,L"bank_code");
    bank_iban = CkJsonObjectW_stringOf(jResp,L"bank_iban");
    bank_name = CkJsonObjectW_stringOf(jResp,L"bank_name");
    birth_date = CkJsonObjectW_stringOf(jResp,L"birth_date");
    cash_allowance = CkJsonObjectW_stringOf(jResp,L"cash_allowance");
    cash_allowance_days = CkJsonObjectW_IntOf(jResp,L"cash_allowance_days");
    cash_discount = CkJsonObjectW_stringOf(jResp,L"cash_discount");
    cash_discount_type = CkJsonObjectW_stringOf(jResp,L"cash_discount_type");
    city = CkJsonObjectW_stringOf(jResp,L"city");
    state = CkJsonObjectW_stringOf(jResp,L"state");
    country = CkJsonObjectW_stringOf(jResp,L"country");
    created_at = CkJsonObjectW_stringOf(jResp,L"created_at");
    updated_at = CkJsonObjectW_stringOf(jResp,L"updated_at");
    delivery_title = CkJsonObjectW_stringOf(jResp,L"delivery_title");
    delivery_city = CkJsonObjectW_stringOf(jResp,L"delivery_city");
    delivery_state = CkJsonObjectW_stringOf(jResp,L"delivery_state");
    delivery_company_name = CkJsonObjectW_stringOf(jResp,L"delivery_company_name");
    delivery_country = CkJsonObjectW_stringOf(jResp,L"delivery_country");
    delivery_first_name = CkJsonObjectW_stringOf(jResp,L"delivery_first_name");
    delivery_last_name = CkJsonObjectW_stringOf(jResp,L"delivery_last_name");
    delivery_personal = CkJsonObjectW_stringOf(jResp,L"delivery_personal");
    delivery_salutation = CkJsonObjectW_IntOf(jResp,L"delivery_salutation");
    delivery_street = CkJsonObjectW_stringOf(jResp,L"delivery_street");
    delivery_suffix_1 = CkJsonObjectW_stringOf(jResp,L"delivery_suffix_1");
    delivery_suffix_2 = CkJsonObjectW_stringOf(jResp,L"delivery_suffix_2");
    delivery_zip_code = CkJsonObjectW_stringOf(jResp,L"delivery_zip_code");
    display_name = CkJsonObjectW_stringOf(jResp,L"display_name");
    fax = CkJsonObjectW_stringOf(jResp,L"fax");
    first_name = CkJsonObjectW_stringOf(jResp,L"first_name");
    grace_period = CkJsonObjectW_stringOf(jResp,L"grace_period");
    due_in_days = CkJsonObjectW_stringOf(jResp,L"due_in_days");
    group_id = CkJsonObjectW_stringOf(jResp,L"group_id");
    id = CkJsonObjectW_stringOf(jResp,L"id");
    info_1 = CkJsonObjectW_stringOf(jResp,L"info_1");
    info_2 = CkJsonObjectW_stringOf(jResp,L"info_2");
    internet = CkJsonObjectW_stringOf(jResp,L"internet");
    login_id = CkJsonObjectW_stringOf(jResp,L"login_id");
    mobile = CkJsonObjectW_stringOf(jResp,L"mobile");
    note = CkJsonObjectW_stringOf(jResp,L"note");
    v_number = CkJsonObjectW_stringOf(jResp,L"number");
    payment_options = CkJsonObjectW_IntOf(jResp,L"payment_options");
    personal = CkJsonObjectW_BoolOf(jResp,L"personal");
    phone_1 = CkJsonObjectW_stringOf(jResp,L"phone_1");
    phone_2 = CkJsonObjectW_stringOf(jResp,L"phone_2");
    postbox = CkJsonObjectW_stringOf(jResp,L"postbox");
    postbox_city = CkJsonObjectW_stringOf(jResp,L"postbox_city");
    postbox_state = CkJsonObjectW_stringOf(jResp,L"postbox_state");
    postbox_country = CkJsonObjectW_stringOf(jResp,L"postbox_country");
    postbox_zip_code = CkJsonObjectW_stringOf(jResp,L"postbox_zip_code");
    sale_price_level = CkJsonObjectW_stringOf(jResp,L"sale_price_level");
    salutation = CkJsonObjectW_IntOf(jResp,L"salutation");
    sepa_agreement = CkJsonObjectW_stringOf(jResp,L"sepa_agreement");
    sepa_agreement_date = CkJsonObjectW_stringOf(jResp,L"sepa_agreement_date");
    sepa_mandate_reference = CkJsonObjectW_stringOf(jResp,L"sepa_mandate_reference");
    since_date = CkJsonObjectW_stringOf(jResp,L"since_date");
    street = CkJsonObjectW_stringOf(jResp,L"street");
    suffix_1 = CkJsonObjectW_stringOf(jResp,L"suffix_1");
    suffix_2 = CkJsonObjectW_stringOf(jResp,L"suffix_2");
    tax_number = CkJsonObjectW_stringOf(jResp,L"tax_number");
    court = CkJsonObjectW_stringOf(jResp,L"court");
    court_registry_number = CkJsonObjectW_stringOf(jResp,L"court_registry_number");
    tax_options = CkJsonObjectW_stringOf(jResp,L"tax_options");
    title = CkJsonObjectW_stringOf(jResp,L"title");
    archived = CkJsonObjectW_stringOf(jResp,L"archived");
    vat_identifier = CkJsonObjectW_stringOf(jResp,L"vat_identifier");
    zip_code = CkJsonObjectW_stringOf(jResp,L"zip_code");
    document_pdf_type = CkJsonObjectW_stringOf(jResp,L"document_pdf_type");
    buyer_reference = CkJsonObjectW_stringOf(jResp,L"buyer_reference");
    foreign_supplier_number = CkJsonObjectW_stringOf(jResp,L"foreign_supplier_number");
    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"additional_groups_ids");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        strVal = CkJsonObjectW_stringOf(jResp,L"additional_groups_ids[i]");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"emails");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        strVal = CkJsonObjectW_stringOf(jResp,L"emails[i]");
        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(json);
    CkStringBuilderW_Dispose(sbRequestBody);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -X PUT
	-H "Authorization: {{apiKey}}"
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "last_name": "<string>",
  "company_name": "<string>",
  "acquire_options": 2,
  "additional_groups_ids": [
    "<integer>",
    "<integer>"
  ],
  "bank_account": "<string>",
  "bank_account_owner": "<string>",
  "bank_bic": "<string>",
  "bank_code": "<string>",
  "bank_iban": "<string>",
  "bank_name": "<string>",
  "birth_date": "<date>",
  "cash_allowance": "<float>",
  "cash_allowance_days": 7,
  "cash_discount": "<float>",
  "cash_discount_type": "AMOUNT",
  "city": "<string>",
  "state": "<string>",
  "country": "<string>",
  "created_at": "<date>",
  "updated_at": "<string>",
  "delivery_title": "<string>",
  "delivery_city": "<string>",
  "delivery_state": "<string>",
  "delivery_company_name": "<string>",
  "delivery_country": "<string>",
  "delivery_first_name": "<string>",
  "delivery_last_name": "<string>",
  "delivery_personal": "<boolean>",
  "delivery_salutation": 0,
  "delivery_street": "<string>",
  "delivery_suffix_1": "<string>",
  "delivery_suffix_2": "<string>",
  "delivery_zip_code": "<string>",
  "display_name": "<string>",
  "emails": [
    "<string>",
    "<string>"
  ],
  "fax": "<string>",
  "first_name": "<string>",
  "grace_period": "<integer>",
  "due_in_days": "<integer>",
  "group_id": "<integer>",
  "id": "<long>",
  "info_1": "<string>",
  "info_2": "<string>",
  "internet": "<string>",
  "login_id": "<long>",
  "mobile": "<string>",
  "note": "<string>",
  "number": "<string>",
  "payment_options": 5,
  "personal": false,
  "phone_1": "<string>",
  "phone_2": "<string>",
  "postbox": "<string>",
  "postbox_city": "<string>",
  "postbox_state": "<string>",
  "postbox_country": "<string>",
  "postbox_zip_code": "<string>",
  "sale_price_level": "SALEPRICE10",
  "salutation": 0,
  "sepa_agreement": "BASIC",
  "sepa_agreement_date": "<date>",
  "sepa_mandate_reference": "<string>",
  "since_date": "<date>",
  "street": "<string>",
  "suffix_1": "<string>",
  "suffix_2": "<string>",
  "tax_number": "<string>",
  "court": "<string>",
  "court_registry_number": "<string>",
  "tax_options": "nStbUstID",
  "title": "<string>",
  "archived": "<boolean>",
  "vat_identifier": "<string>",
  "zip_code": "<string>",
  "document_pdf_type": "default",
  "buyer_reference": "<string>",
  "foreign_supplier_number": "<string>"
}'
https://api.easybill.de/rest/v1/customers/:id

Postman Collection Item JSON

{
  "name": "Update Customer",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"last_name\": \"<string>\",\n  \"company_name\": \"<string>\",\n  \"acquire_options\": 2,\n  \"additional_groups_ids\": [\n    \"<integer>\",\n    \"<integer>\"\n  ],\n  \"bank_account\": \"<string>\",\n  \"bank_account_owner\": \"<string>\",\n  \"bank_bic\": \"<string>\",\n  \"bank_code\": \"<string>\",\n  \"bank_iban\": \"<string>\",\n  \"bank_name\": \"<string>\",\n  \"birth_date\": \"<date>\",\n  \"cash_allowance\": \"<float>\",\n  \"cash_allowance_days\": 7,\n  \"cash_discount\": \"<float>\",\n  \"cash_discount_type\": \"AMOUNT\",\n  \"city\": \"<string>\",\n  \"state\": \"<string>\",\n  \"country\": \"<string>\",\n  \"created_at\": \"<date>\",\n  \"updated_at\": \"<string>\",\n  \"delivery_title\": \"<string>\",\n  \"delivery_city\": \"<string>\",\n  \"delivery_state\": \"<string>\",\n  \"delivery_company_name\": \"<string>\",\n  \"delivery_country\": \"<string>\",\n  \"delivery_first_name\": \"<string>\",\n  \"delivery_last_name\": \"<string>\",\n  \"delivery_personal\": \"<boolean>\",\n  \"delivery_salutation\": 0,\n  \"delivery_street\": \"<string>\",\n  \"delivery_suffix_1\": \"<string>\",\n  \"delivery_suffix_2\": \"<string>\",\n  \"delivery_zip_code\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"emails\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"fax\": \"<string>\",\n  \"first_name\": \"<string>\",\n  \"grace_period\": \"<integer>\",\n  \"due_in_days\": \"<integer>\",\n  \"group_id\": \"<integer>\",\n  \"id\": \"<long>\",\n  \"info_1\": \"<string>\",\n  \"info_2\": \"<string>\",\n  \"internet\": \"<string>\",\n  \"login_id\": \"<long>\",\n  \"mobile\": \"<string>\",\n  \"note\": \"<string>\",\n  \"number\": \"<string>\",\n  \"payment_options\": 5,\n  \"personal\": false,\n  \"phone_1\": \"<string>\",\n  \"phone_2\": \"<string>\",\n  \"postbox\": \"<string>\",\n  \"postbox_city\": \"<string>\",\n  \"postbox_state\": \"<string>\",\n  \"postbox_country\": \"<string>\",\n  \"postbox_zip_code\": \"<string>\",\n  \"sale_price_level\": \"SALEPRICE10\",\n  \"salutation\": 0,\n  \"sepa_agreement\": \"BASIC\",\n  \"sepa_agreement_date\": \"<date>\",\n  \"sepa_mandate_reference\": \"<string>\",\n  \"since_date\": \"<date>\",\n  \"street\": \"<string>\",\n  \"suffix_1\": \"<string>\",\n  \"suffix_2\": \"<string>\",\n  \"tax_number\": \"<string>\",\n  \"court\": \"<string>\",\n  \"court_registry_number\": \"<string>\",\n  \"tax_options\": \"nStbUstID\",\n  \"title\": \"<string>\",\n  \"archived\": \"<boolean>\",\n  \"vat_identifier\": \"<string>\",\n  \"zip_code\": \"<string>\",\n  \"document_pdf_type\": \"default\",\n  \"buyer_reference\": \"<string>\",\n  \"foreign_supplier_number\": \"<string>\"\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/customers/:id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "customers",
        ":id"
      ],
      "variable": [
        {
          "key": "id",
          "value": "<long>",
          "description": "(Required) ID of customer that needs to be updated"
        }
      ]
    }
  },
  "response": [
    {
      "name": "Successful operation",
      "originalRequest": {
        "method": "PUT",
        "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  \"last_name\": \"<string>\",\n  \"company_name\": \"<string>\",\n  \"acquire_options\": 2,\n  \"additional_groups_ids\": [\n    \"<integer>\",\n    \"<integer>\"\n  ],\n  \"bank_account\": \"<string>\",\n  \"bank_account_owner\": \"<string>\",\n  \"bank_bic\": \"<string>\",\n  \"bank_code\": \"<string>\",\n  \"bank_iban\": \"<string>\",\n  \"bank_name\": \"<string>\",\n  \"birth_date\": \"<date>\",\n  \"cash_allowance\": \"<float>\",\n  \"cash_allowance_days\": 7,\n  \"cash_discount\": \"<float>\",\n  \"cash_discount_type\": \"AMOUNT\",\n  \"city\": \"<string>\",\n  \"state\": \"<string>\",\n  \"country\": \"<string>\",\n  \"created_at\": \"<date>\",\n  \"updated_at\": \"<string>\",\n  \"delivery_title\": \"<string>\",\n  \"delivery_city\": \"<string>\",\n  \"delivery_state\": \"<string>\",\n  \"delivery_company_name\": \"<string>\",\n  \"delivery_country\": \"<string>\",\n  \"delivery_first_name\": \"<string>\",\n  \"delivery_last_name\": \"<string>\",\n  \"delivery_personal\": \"<boolean>\",\n  \"delivery_salutation\": 0,\n  \"delivery_street\": \"<string>\",\n  \"delivery_suffix_1\": \"<string>\",\n  \"delivery_suffix_2\": \"<string>\",\n  \"delivery_zip_code\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"emails\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"fax\": \"<string>\",\n  \"first_name\": \"<string>\",\n  \"grace_period\": \"<integer>\",\n  \"due_in_days\": \"<integer>\",\n  \"group_id\": \"<integer>\",\n  \"id\": \"<long>\",\n  \"info_1\": \"<string>\",\n  \"info_2\": \"<string>\",\n  \"internet\": \"<string>\",\n  \"login_id\": \"<long>\",\n  \"mobile\": \"<string>\",\n  \"note\": \"<string>\",\n  \"number\": \"<string>\",\n  \"payment_options\": 5,\n  \"personal\": false,\n  \"phone_1\": \"<string>\",\n  \"phone_2\": \"<string>\",\n  \"postbox\": \"<string>\",\n  \"postbox_city\": \"<string>\",\n  \"postbox_state\": \"<string>\",\n  \"postbox_country\": \"<string>\",\n  \"postbox_zip_code\": \"<string>\",\n  \"sale_price_level\": \"SALEPRICE10\",\n  \"salutation\": 0,\n  \"sepa_agreement\": \"BASIC\",\n  \"sepa_agreement_date\": \"<date>\",\n  \"sepa_mandate_reference\": \"<string>\",\n  \"since_date\": \"<date>\",\n  \"street\": \"<string>\",\n  \"suffix_1\": \"<string>\",\n  \"suffix_2\": \"<string>\",\n  \"tax_number\": \"<string>\",\n  \"court\": \"<string>\",\n  \"court_registry_number\": \"<string>\",\n  \"tax_options\": \"nStbUstID\",\n  \"title\": \"<string>\",\n  \"archived\": \"<boolean>\",\n  \"vat_identifier\": \"<string>\",\n  \"zip_code\": \"<string>\",\n  \"document_pdf_type\": \"default\",\n  \"buyer_reference\": \"<string>\",\n  \"foreign_supplier_number\": \"<string>\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/customers/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "customers",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"last_name\": \"<string>\",\n  \"company_name\": \"<string>\",\n  \"acquire_options\": 2,\n  \"additional_groups_ids\": [\n    \"<integer>\",\n    \"<integer>\"\n  ],\n  \"bank_account\": \"<string>\",\n  \"bank_account_owner\": \"<string>\",\n  \"bank_bic\": \"<string>\",\n  \"bank_code\": \"<string>\",\n  \"bank_iban\": \"<string>\",\n  \"bank_name\": \"<string>\",\n  \"birth_date\": \"<date>\",\n  \"cash_allowance\": \"<float>\",\n  \"cash_allowance_days\": 7,\n  \"cash_discount\": \"<float>\",\n  \"cash_discount_type\": \"AMOUNT\",\n  \"city\": \"<string>\",\n  \"state\": \"<string>\",\n  \"country\": \"<string>\",\n  \"created_at\": \"<date>\",\n  \"updated_at\": \"<string>\",\n  \"delivery_title\": \"<string>\",\n  \"delivery_city\": \"<string>\",\n  \"delivery_state\": \"<string>\",\n  \"delivery_company_name\": \"<string>\",\n  \"delivery_country\": \"<string>\",\n  \"delivery_first_name\": \"<string>\",\n  \"delivery_last_name\": \"<string>\",\n  \"delivery_personal\": \"<boolean>\",\n  \"delivery_salutation\": 0,\n  \"delivery_street\": \"<string>\",\n  \"delivery_suffix_1\": \"<string>\",\n  \"delivery_suffix_2\": \"<string>\",\n  \"delivery_zip_code\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"emails\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"fax\": \"<string>\",\n  \"first_name\": \"<string>\",\n  \"grace_period\": \"<integer>\",\n  \"due_in_days\": \"<integer>\",\n  \"group_id\": \"<integer>\",\n  \"id\": \"<long>\",\n  \"info_1\": \"<string>\",\n  \"info_2\": \"<string>\",\n  \"internet\": \"<string>\",\n  \"login_id\": \"<long>\",\n  \"mobile\": \"<string>\",\n  \"note\": \"<string>\",\n  \"number\": \"<string>\",\n  \"payment_options\": 5,\n  \"personal\": false,\n  \"phone_1\": \"<string>\",\n  \"phone_2\": \"<string>\",\n  \"postbox\": \"<string>\",\n  \"postbox_city\": \"<string>\",\n  \"postbox_state\": \"<string>\",\n  \"postbox_country\": \"<string>\",\n  \"postbox_zip_code\": \"<string>\",\n  \"sale_price_level\": \"SALEPRICE10\",\n  \"salutation\": 0,\n  \"sepa_agreement\": \"BASIC\",\n  \"sepa_agreement_date\": \"<date>\",\n  \"sepa_mandate_reference\": \"<string>\",\n  \"since_date\": \"<date>\",\n  \"street\": \"<string>\",\n  \"suffix_1\": \"<string>\",\n  \"suffix_2\": \"<string>\",\n  \"tax_number\": \"<string>\",\n  \"court\": \"<string>\",\n  \"court_registry_number\": \"<string>\",\n  \"tax_options\": \"nStbUstID\",\n  \"title\": \"<string>\",\n  \"archived\": \"<boolean>\",\n  \"vat_identifier\": \"<string>\",\n  \"zip_code\": \"<string>\",\n  \"document_pdf_type\": \"default\",\n  \"buyer_reference\": \"<string>\",\n  \"foreign_supplier_number\": \"<string>\"\n}"
    },
    {
      "name": "Invalid Customer",
      "originalRequest": {
        "method": "PUT",
        "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  \"last_name\": \"<string>\",\n  \"company_name\": \"<string>\",\n  \"acquire_options\": 2,\n  \"additional_groups_ids\": [\n    \"<integer>\",\n    \"<integer>\"\n  ],\n  \"bank_account\": \"<string>\",\n  \"bank_account_owner\": \"<string>\",\n  \"bank_bic\": \"<string>\",\n  \"bank_code\": \"<string>\",\n  \"bank_iban\": \"<string>\",\n  \"bank_name\": \"<string>\",\n  \"birth_date\": \"<date>\",\n  \"cash_allowance\": \"<float>\",\n  \"cash_allowance_days\": 7,\n  \"cash_discount\": \"<float>\",\n  \"cash_discount_type\": \"AMOUNT\",\n  \"city\": \"<string>\",\n  \"state\": \"<string>\",\n  \"country\": \"<string>\",\n  \"created_at\": \"<date>\",\n  \"updated_at\": \"<string>\",\n  \"delivery_title\": \"<string>\",\n  \"delivery_city\": \"<string>\",\n  \"delivery_state\": \"<string>\",\n  \"delivery_company_name\": \"<string>\",\n  \"delivery_country\": \"<string>\",\n  \"delivery_first_name\": \"<string>\",\n  \"delivery_last_name\": \"<string>\",\n  \"delivery_personal\": \"<boolean>\",\n  \"delivery_salutation\": 0,\n  \"delivery_street\": \"<string>\",\n  \"delivery_suffix_1\": \"<string>\",\n  \"delivery_suffix_2\": \"<string>\",\n  \"delivery_zip_code\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"emails\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"fax\": \"<string>\",\n  \"first_name\": \"<string>\",\n  \"grace_period\": \"<integer>\",\n  \"due_in_days\": \"<integer>\",\n  \"group_id\": \"<integer>\",\n  \"id\": \"<long>\",\n  \"info_1\": \"<string>\",\n  \"info_2\": \"<string>\",\n  \"internet\": \"<string>\",\n  \"login_id\": \"<long>\",\n  \"mobile\": \"<string>\",\n  \"note\": \"<string>\",\n  \"number\": \"<string>\",\n  \"payment_options\": 5,\n  \"personal\": false,\n  \"phone_1\": \"<string>\",\n  \"phone_2\": \"<string>\",\n  \"postbox\": \"<string>\",\n  \"postbox_city\": \"<string>\",\n  \"postbox_state\": \"<string>\",\n  \"postbox_country\": \"<string>\",\n  \"postbox_zip_code\": \"<string>\",\n  \"sale_price_level\": \"SALEPRICE10\",\n  \"salutation\": 0,\n  \"sepa_agreement\": \"BASIC\",\n  \"sepa_agreement_date\": \"<date>\",\n  \"sepa_mandate_reference\": \"<string>\",\n  \"since_date\": \"<date>\",\n  \"street\": \"<string>\",\n  \"suffix_1\": \"<string>\",\n  \"suffix_2\": \"<string>\",\n  \"tax_number\": \"<string>\",\n  \"court\": \"<string>\",\n  \"court_registry_number\": \"<string>\",\n  \"tax_options\": \"nStbUstID\",\n  \"title\": \"<string>\",\n  \"archived\": \"<boolean>\",\n  \"vat_identifier\": \"<string>\",\n  \"zip_code\": \"<string>\",\n  \"document_pdf_type\": \"default\",\n  \"buyer_reference\": \"<string>\",\n  \"foreign_supplier_number\": \"<string>\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/customers/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "customers",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Too Many Requests",
      "originalRequest": {
        "method": "PUT",
        "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  \"last_name\": \"<string>\",\n  \"company_name\": \"<string>\",\n  \"acquire_options\": 2,\n  \"additional_groups_ids\": [\n    \"<integer>\",\n    \"<integer>\"\n  ],\n  \"bank_account\": \"<string>\",\n  \"bank_account_owner\": \"<string>\",\n  \"bank_bic\": \"<string>\",\n  \"bank_code\": \"<string>\",\n  \"bank_iban\": \"<string>\",\n  \"bank_name\": \"<string>\",\n  \"birth_date\": \"<date>\",\n  \"cash_allowance\": \"<float>\",\n  \"cash_allowance_days\": 7,\n  \"cash_discount\": \"<float>\",\n  \"cash_discount_type\": \"AMOUNT\",\n  \"city\": \"<string>\",\n  \"state\": \"<string>\",\n  \"country\": \"<string>\",\n  \"created_at\": \"<date>\",\n  \"updated_at\": \"<string>\",\n  \"delivery_title\": \"<string>\",\n  \"delivery_city\": \"<string>\",\n  \"delivery_state\": \"<string>\",\n  \"delivery_company_name\": \"<string>\",\n  \"delivery_country\": \"<string>\",\n  \"delivery_first_name\": \"<string>\",\n  \"delivery_last_name\": \"<string>\",\n  \"delivery_personal\": \"<boolean>\",\n  \"delivery_salutation\": 0,\n  \"delivery_street\": \"<string>\",\n  \"delivery_suffix_1\": \"<string>\",\n  \"delivery_suffix_2\": \"<string>\",\n  \"delivery_zip_code\": \"<string>\",\n  \"display_name\": \"<string>\",\n  \"emails\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"fax\": \"<string>\",\n  \"first_name\": \"<string>\",\n  \"grace_period\": \"<integer>\",\n  \"due_in_days\": \"<integer>\",\n  \"group_id\": \"<integer>\",\n  \"id\": \"<long>\",\n  \"info_1\": \"<string>\",\n  \"info_2\": \"<string>\",\n  \"internet\": \"<string>\",\n  \"login_id\": \"<long>\",\n  \"mobile\": \"<string>\",\n  \"note\": \"<string>\",\n  \"number\": \"<string>\",\n  \"payment_options\": 5,\n  \"personal\": false,\n  \"phone_1\": \"<string>\",\n  \"phone_2\": \"<string>\",\n  \"postbox\": \"<string>\",\n  \"postbox_city\": \"<string>\",\n  \"postbox_state\": \"<string>\",\n  \"postbox_country\": \"<string>\",\n  \"postbox_zip_code\": \"<string>\",\n  \"sale_price_level\": \"SALEPRICE10\",\n  \"salutation\": 0,\n  \"sepa_agreement\": \"BASIC\",\n  \"sepa_agreement_date\": \"<date>\",\n  \"sepa_mandate_reference\": \"<string>\",\n  \"since_date\": \"<date>\",\n  \"street\": \"<string>\",\n  \"suffix_1\": \"<string>\",\n  \"suffix_2\": \"<string>\",\n  \"tax_number\": \"<string>\",\n  \"court\": \"<string>\",\n  \"court_registry_number\": \"<string>\",\n  \"tax_options\": \"nStbUstID\",\n  \"title\": \"<string>\",\n  \"archived\": \"<boolean>\",\n  \"vat_identifier\": \"<string>\",\n  \"zip_code\": \"<string>\",\n  \"document_pdf_type\": \"default\",\n  \"buyer_reference\": \"<string>\",\n  \"foreign_supplier_number\": \"<string>\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/customers/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "customers",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}