Chilkat Online Tools

PowerBuilder / easybill REST API / To complete a document.

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
oleobject loo_Date_from
oleobject loo_Date_to
string ls_StrVal
string ls_Description
string ls_Document_note
integer li_Quantity
string ls_Quantity_str
string ls_Unit
string ls_Position
string ls_Single_price_net
string ls_Single_price_gross
integer li_Vat_percent
string ls_Position_id
string ls_Total_price_net
string ls_Total_price_gross
string ls_Total_vat
string ls_Serial_number_id
string ls_Serial_number
string ls_Booking_account
string ls_Export_cost_1
string ls_Export_cost_2
string ls_Cost_price_net
string ls_Cost_price_total
string ls_Cost_price_charge
string ls_Cost_price_charge_type
string ls_ItemType
string ls_Salutation
string ls_Personal
string ls_Title
string ls_First_name
string ls_Last_name
string ls_Suffix_1
string ls_Suffix_2
string ls_Company_name
string ls_Street
string ls_Zip_code
string ls_City
string ls_State
string ls_Country
string ls_Label_addressSalutation
string ls_Label_addressPersonal
string ls_Label_addressTitle
string ls_Label_addressFirst_name
string ls_Label_addressLast_name
string ls_Label_addressSuffix_1
string ls_Label_addressSuffix_2
string ls_Label_addressCompany_name
string ls_Label_addressStreet
string ls_Label_addressZip_code
string ls_Label_addressCity
string ls_Label_addressState
string ls_Label_addressCountry
string ls_Amount
string ls_Amount_net
string ls_Bank_debit_form
string ls_Billing_country
integer li_Calc_vat_from
string ls_Cancel_id
string ls_Cash_allowance
string ls_Cash_allowance_days
string ls_Cash_allowance_text
string ls_Contact_id
string ls_Contact_label
string ls_Contact_text
string ls_Created_at
string ls_V_currency
string ls_Customer_id
string ls_Customer_snapshotLast_name
string ls_Customer_snapshotCompany_name
integer li_Acquire_options
string ls_Bank_account
string ls_Bank_account_owner
string ls_Bank_bic
string ls_Bank_code
string ls_Bank_iban
string ls_Bank_name
string ls_Birth_date
string ls_Cash_allowance
integer li_Cash_allowance_days
string ls_Cash_discount
string ls_Cash_discount_type
string ls_Customer_snapshotCity
string ls_Customer_snapshotState
string ls_Customer_snapshotCountry
string ls_Created_at
string ls_Updated_at
string ls_Delivery_title
string ls_Delivery_city
string ls_Delivery_state
string ls_Delivery_company_name
string ls_Delivery_country
string ls_Delivery_first_name
string ls_Delivery_last_name
string ls_Delivery_personal
integer li_Delivery_salutation
string ls_Delivery_street
string ls_Delivery_suffix_1
string ls_Delivery_suffix_2
string ls_Delivery_zip_code
string ls_Display_name
string ls_Fax
string ls_Customer_snapshotFirst_name
string ls_Grace_period
string ls_Due_in_days
string ls_Group_id
string ls_Id
string ls_Info_1
string ls_Info_2
string ls_Internet
string ls_Login_id
string ls_Mobile
string ls_Note
string ls_V_Number
integer li_Payment_options
integer li_Customer_snapshotPersonal
string ls_Phone_1
string ls_Phone_2
string ls_Postbox
string ls_Postbox_city
string ls_Postbox_state
string ls_Postbox_country
string ls_Postbox_zip_code
string ls_Sale_price_level
integer li_Customer_snapshotSalutation
string ls_Sepa_agreement
string ls_Sepa_agreement_date
string ls_Sepa_mandate_reference
string ls_Since_date
string ls_Customer_snapshotStreet
string ls_Customer_snapshotSuffix_1
string ls_Customer_snapshotSuffix_2
string ls_Tax_number
string ls_Court
string ls_Court_registry_number
string ls_Tax_options
string ls_Customer_snapshotTitle
string ls_Archived
string ls_Vat_identifier
string ls_Customer_snapshotZip_code
string ls_Document_pdf_type
string ls_Buyer_reference
string ls_Foreign_supplier_number
string ls_Discount
string ls_Discount_type
string ls_Document_date
string ls_Due_date
string ls_Edited_at
string ls_External_id
string ls_Replica_url
string ls_Grace_period
string ls_Due_in_days
string ls_Id
integer li_Is_acceptable_on_public_domain
integer li_Is_archive
string ls_Is_draft
integer li_Is_replica
integer li_Is_oss
string ls_Last_postbox_id
string ls_Login_id
string ls_V_number
string ls_Order_number
string ls_Buyer_reference
string ls_Paid_amount
string ls_Paid_at
string ls_Pdf_pages
string ls_Pdf_template
string ls_Project_id
string ls_Next_date
string ls_Frequency
string ls_Frequency_special
integer li_Interval
string ls_End_date_or_count
string ls_Status
integer li_As_draft
integer li_Is_notify
string ls_Send_as
integer li_Is_sign
integer li_Is_paid
string ls_Paid_date_option
integer li_Is_sepa
string ls_Sepa_local_instrument
string ls_Sepa_sequence_type
string ls_Sepa_reference
string ls_Sepa_remittance_information
string ls_Target_type
string ls_Ref_id
string ls_Root_id
string ls_V_Type
string ls_Date
string ls_Text
string ls_Shipping_country
string ls_Status
string ls_Text
string ls_Text_prefix
string ls_Text_tax
string ls_Title
string ls_V_type
integer li_Use_shipping_address
string ls_Vat_country
string ls_Vat_id
string ls_Fulfillment_country
string ls_Vat_option
integer i
integer li_Count_i

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Http.SetRequestHeader("Authorization","{{apiKey}}")
loo_Http.SetRequestHeader("Accept","application/json")

loo_Resp = loo_Http.QuickRequest("PUT","https://api.easybill.de/rest/v1/documents/:id/done?reason_for_change=<string>")
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    return
end if

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp

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

// {
//   "address": {
//     "salutation": "<integer>",
//     "personal": "<boolean>",
//     "title": "<string>",
//     "first_name": "<string>",
//     "last_name": "<string>",
//     "suffix_1": "<string>",
//     "suffix_2": "<string>",
//     "company_name": "<string>",
//     "street": "<string>",
//     "zip_code": "<string>",
//     "city": "<string>",
//     "state": "<string>",
//     "country": "<string>"
//   },
//   "attachment_ids": [
//     "<integer>",
//     "<integer>"
//   ],
//   "label_address": {
//     "salutation": "<integer>",
//     "personal": "<boolean>",
//     "title": "<string>",
//     "first_name": "<string>",
//     "last_name": "<string>",
//     "suffix_1": "<string>",
//     "suffix_2": "<string>",
//     "company_name": "<string>",
//     "street": "<string>",
//     "zip_code": "<string>",
//     "city": "<string>",
//     "state": "<string>",
//     "country": "<string>"
//   },
//   "amount": "<integer>",
//   "amount_net": "<integer>",
//   "bank_debit_form": null,
//   "billing_country": "<string>",
//   "calc_vat_from": 0,
//   "cancel_id": "<long>",
//   "cash_allowance": null,
//   "cash_allowance_days": null,
//   "cash_allowance_text": null,
//   "contact_id": null,
//   "contact_label": "",
//   "contact_text": "",
//   "created_at": "<dateTime>",
//   "currency": "EUR",
//   "customer_id": null,
//   "customer_snapshot": {
//     "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": 1,
//     "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": "SALEPRICE6",
//     "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": "nStbIm",
//     "title": "<string>",
//     "archived": "<boolean>",
//     "vat_identifier": "<string>",
//     "zip_code": "<string>",
//     "document_pdf_type": "default",
//     "buyer_reference": "<string>",
//     "foreign_supplier_number": "<string>"
//   },
//   "discount": null,
//   "discount_type": null,
//   "document_date": "<date>",
//   "due_date": "<date>",
//   "edited_at": "<dateTime>",
//   "external_id": null,
//   "replica_url": null,
//   "grace_period": "<integer>",
//   "due_in_days": "<integer>",
//   "id": "<long>",
//   "is_acceptable_on_public_domain": false,
//   "is_archive": false,
//   "is_draft": "<boolean>",
//   "is_replica": false,
//   "is_oss": false,
//   "item_notes": [
//     "<string>",
//     "<string>"
//   ],
//   "items": [
//     {
//       "number": null,
//       "description": null,
//       "document_note": "<string>",
//       "quantity": 1,
//       "quantity_str": "<string>",
//       "unit": null,
//       "type": "POSITION",
//       "position": "<integer>",
//       "single_price_net": null,
//       "single_price_gross": "<float>",
//       "vat_percent": 0,
//       "discount": null,
//       "discount_type": null,
//       "position_id": null,
//       "total_price_net": "<float>",
//       "total_price_gross": "<float>",
//       "total_vat": "<float>",
//       "serial_number_id": "<string>",
//       "serial_number": "<string>",
//       "booking_account": null,
//       "export_cost_1": null,
//       "export_cost_2": null,
//       "cost_price_net": null,
//       "cost_price_total": "<float>",
//       "cost_price_charge": "<float>",
//       "cost_price_charge_type": "PERCENT",
//       "itemType": "UNDEFINED",
//       "id": "<long>"
//     },
//     {
//       "number": null,
//       "description": null,
//       "document_note": "<string>",
//       "quantity": 1,
//       "quantity_str": "<string>",
//       "unit": null,
//       "type": "POSITION",
//       "position": "<integer>",
//       "single_price_net": null,
//       "single_price_gross": "<float>",
//       "vat_percent": 0,
//       "discount": null,
//       "discount_type": null,
//       "position_id": null,
//       "total_price_net": "<float>",
//       "total_price_gross": "<float>",
//       "total_vat": "<float>",
//       "serial_number_id": "<string>",
//       "serial_number": "<string>",
//       "booking_account": null,
//       "export_cost_1": null,
//       "export_cost_2": null,
//       "cost_price_net": null,
//       "cost_price_total": "<float>",
//       "cost_price_charge": "<float>",
//       "cost_price_charge_type": "PERCENT",
//       "itemType": "UNDEFINED",
//       "id": "<long>"
//     }
//   ],
//   "last_postbox_id": "<long>",
//   "login_id": "<long>",
//   "number": null,
//   "order_number": "",
//   "buyer_reference": "",
//   "paid_amount": "<integer>",
//   "paid_at": "<date>",
//   "pdf_pages": "<integer>",
//   "pdf_template": "<string>",
//   "project_id": null,
//   "recurring_options": {
//     "next_date": "<date>",
//     "frequency": "MONTHLY",
//     "frequency_special": null,
//     "interval": 1,
//     "end_date_or_count": null,
//     "status": "WAITING",
//     "as_draft": false,
//     "is_notify": false,
//     "send_as": null,
//     "is_sign": false,
//     "is_paid": false,
//     "paid_date_option": "created_date",
//     "is_sepa": false,
//     "sepa_local_instrument": null,
//     "sepa_sequence_type": null,
//     "sepa_reference": null,
//     "sepa_remittance_information": null,
//     "target_type": "INVOICE"
//   },
//   "ref_id": null,
//   "root_id": null,
//   "service_date": {
//     "type": "SERVICE",
//     "date": "<date>",
//     "date_from": "<date>",
//     "date_to": "<date>",
//     "text": null
//   },
//   "shipping_country": null,
//   "status": null,
//   "text": "<string>",
//   "text_prefix": "<string>",
//   "text_tax": null,
//   "title": null,
//   "type": "INVOICE",
//   "use_shipping_address": false,
//   "vat_country": null,
//   "vat_id": "",
//   "fulfillment_country": null,
//   "vat_option": null,
//   "file_format_config": [
//     {
//       "type": "xrechnung2_2_xml"
//     },
//     {
//       "type": "xrechnung3_0_xml"
//     }
//   ]
// }

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

loo_Date_from = create oleobject
// Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
li_rc = loo_Date_from.ConnectToNewObject("Chilkat.DtObj")

loo_Date_to = create oleobject
// Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
li_rc = loo_Date_to.ConnectToNewObject("Chilkat.DtObj")

ls_Salutation = loo_JResp.StringOf("address.salutation")
ls_Personal = loo_JResp.StringOf("address.personal")
ls_Title = loo_JResp.StringOf("address.title")
ls_First_name = loo_JResp.StringOf("address.first_name")
ls_Last_name = loo_JResp.StringOf("address.last_name")
ls_Suffix_1 = loo_JResp.StringOf("address.suffix_1")
ls_Suffix_2 = loo_JResp.StringOf("address.suffix_2")
ls_Company_name = loo_JResp.StringOf("address.company_name")
ls_Street = loo_JResp.StringOf("address.street")
ls_Zip_code = loo_JResp.StringOf("address.zip_code")
ls_City = loo_JResp.StringOf("address.city")
ls_State = loo_JResp.StringOf("address.state")
ls_Country = loo_JResp.StringOf("address.country")
ls_Label_addressSalutation = loo_JResp.StringOf("label_address.salutation")
ls_Label_addressPersonal = loo_JResp.StringOf("label_address.personal")
ls_Label_addressTitle = loo_JResp.StringOf("label_address.title")
ls_Label_addressFirst_name = loo_JResp.StringOf("label_address.first_name")
ls_Label_addressLast_name = loo_JResp.StringOf("label_address.last_name")
ls_Label_addressSuffix_1 = loo_JResp.StringOf("label_address.suffix_1")
ls_Label_addressSuffix_2 = loo_JResp.StringOf("label_address.suffix_2")
ls_Label_addressCompany_name = loo_JResp.StringOf("label_address.company_name")
ls_Label_addressStreet = loo_JResp.StringOf("label_address.street")
ls_Label_addressZip_code = loo_JResp.StringOf("label_address.zip_code")
ls_Label_addressCity = loo_JResp.StringOf("label_address.city")
ls_Label_addressState = loo_JResp.StringOf("label_address.state")
ls_Label_addressCountry = loo_JResp.StringOf("label_address.country")
ls_Amount = loo_JResp.StringOf("amount")
ls_Amount_net = loo_JResp.StringOf("amount_net")
ls_Bank_debit_form = loo_JResp.StringOf("bank_debit_form")
ls_Billing_country = loo_JResp.StringOf("billing_country")
li_Calc_vat_from = loo_JResp.IntOf("calc_vat_from")
ls_Cancel_id = loo_JResp.StringOf("cancel_id")
ls_Cash_allowance = loo_JResp.StringOf("cash_allowance")
ls_Cash_allowance_days = loo_JResp.StringOf("cash_allowance_days")
ls_Cash_allowance_text = loo_JResp.StringOf("cash_allowance_text")
ls_Contact_id = loo_JResp.StringOf("contact_id")
ls_Contact_label = loo_JResp.StringOf("contact_label")
ls_Contact_text = loo_JResp.StringOf("contact_text")
ls_Created_at = loo_JResp.StringOf("created_at")
ls_V_currency = loo_JResp.StringOf("currency")
ls_Customer_id = loo_JResp.StringOf("customer_id")
ls_Customer_snapshotLast_name = loo_JResp.StringOf("customer_snapshot.last_name")
ls_Customer_snapshotCompany_name = loo_JResp.StringOf("customer_snapshot.company_name")
li_Acquire_options = loo_JResp.IntOf("customer_snapshot.acquire_options")
ls_Bank_account = loo_JResp.StringOf("customer_snapshot.bank_account")
ls_Bank_account_owner = loo_JResp.StringOf("customer_snapshot.bank_account_owner")
ls_Bank_bic = loo_JResp.StringOf("customer_snapshot.bank_bic")
ls_Bank_code = loo_JResp.StringOf("customer_snapshot.bank_code")
ls_Bank_iban = loo_JResp.StringOf("customer_snapshot.bank_iban")
ls_Bank_name = loo_JResp.StringOf("customer_snapshot.bank_name")
ls_Birth_date = loo_JResp.StringOf("customer_snapshot.birth_date")
ls_Cash_allowance = loo_JResp.StringOf("customer_snapshot.cash_allowance")
li_Cash_allowance_days = loo_JResp.IntOf("customer_snapshot.cash_allowance_days")
ls_Cash_discount = loo_JResp.StringOf("customer_snapshot.cash_discount")
ls_Cash_discount_type = loo_JResp.StringOf("customer_snapshot.cash_discount_type")
ls_Customer_snapshotCity = loo_JResp.StringOf("customer_snapshot.city")
ls_Customer_snapshotState = loo_JResp.StringOf("customer_snapshot.state")
ls_Customer_snapshotCountry = loo_JResp.StringOf("customer_snapshot.country")
ls_Created_at = loo_JResp.StringOf("customer_snapshot.created_at")
ls_Updated_at = loo_JResp.StringOf("customer_snapshot.updated_at")
ls_Delivery_title = loo_JResp.StringOf("customer_snapshot.delivery_title")
ls_Delivery_city = loo_JResp.StringOf("customer_snapshot.delivery_city")
ls_Delivery_state = loo_JResp.StringOf("customer_snapshot.delivery_state")
ls_Delivery_company_name = loo_JResp.StringOf("customer_snapshot.delivery_company_name")
ls_Delivery_country = loo_JResp.StringOf("customer_snapshot.delivery_country")
ls_Delivery_first_name = loo_JResp.StringOf("customer_snapshot.delivery_first_name")
ls_Delivery_last_name = loo_JResp.StringOf("customer_snapshot.delivery_last_name")
ls_Delivery_personal = loo_JResp.StringOf("customer_snapshot.delivery_personal")
li_Delivery_salutation = loo_JResp.IntOf("customer_snapshot.delivery_salutation")
ls_Delivery_street = loo_JResp.StringOf("customer_snapshot.delivery_street")
ls_Delivery_suffix_1 = loo_JResp.StringOf("customer_snapshot.delivery_suffix_1")
ls_Delivery_suffix_2 = loo_JResp.StringOf("customer_snapshot.delivery_suffix_2")
ls_Delivery_zip_code = loo_JResp.StringOf("customer_snapshot.delivery_zip_code")
ls_Display_name = loo_JResp.StringOf("customer_snapshot.display_name")
ls_Fax = loo_JResp.StringOf("customer_snapshot.fax")
ls_Customer_snapshotFirst_name = loo_JResp.StringOf("customer_snapshot.first_name")
ls_Grace_period = loo_JResp.StringOf("customer_snapshot.grace_period")
ls_Due_in_days = loo_JResp.StringOf("customer_snapshot.due_in_days")
ls_Group_id = loo_JResp.StringOf("customer_snapshot.group_id")
ls_Id = loo_JResp.StringOf("customer_snapshot.id")
ls_Info_1 = loo_JResp.StringOf("customer_snapshot.info_1")
ls_Info_2 = loo_JResp.StringOf("customer_snapshot.info_2")
ls_Internet = loo_JResp.StringOf("customer_snapshot.internet")
ls_Login_id = loo_JResp.StringOf("customer_snapshot.login_id")
ls_Mobile = loo_JResp.StringOf("customer_snapshot.mobile")
ls_Note = loo_JResp.StringOf("customer_snapshot.note")
ls_V_Number = loo_JResp.StringOf("customer_snapshot.number")
li_Payment_options = loo_JResp.IntOf("customer_snapshot.payment_options")
li_Customer_snapshotPersonal = loo_JResp.BoolOf("customer_snapshot.personal")
ls_Phone_1 = loo_JResp.StringOf("customer_snapshot.phone_1")
ls_Phone_2 = loo_JResp.StringOf("customer_snapshot.phone_2")
ls_Postbox = loo_JResp.StringOf("customer_snapshot.postbox")
ls_Postbox_city = loo_JResp.StringOf("customer_snapshot.postbox_city")
ls_Postbox_state = loo_JResp.StringOf("customer_snapshot.postbox_state")
ls_Postbox_country = loo_JResp.StringOf("customer_snapshot.postbox_country")
ls_Postbox_zip_code = loo_JResp.StringOf("customer_snapshot.postbox_zip_code")
ls_Sale_price_level = loo_JResp.StringOf("customer_snapshot.sale_price_level")
li_Customer_snapshotSalutation = loo_JResp.IntOf("customer_snapshot.salutation")
ls_Sepa_agreement = loo_JResp.StringOf("customer_snapshot.sepa_agreement")
ls_Sepa_agreement_date = loo_JResp.StringOf("customer_snapshot.sepa_agreement_date")
ls_Sepa_mandate_reference = loo_JResp.StringOf("customer_snapshot.sepa_mandate_reference")
ls_Since_date = loo_JResp.StringOf("customer_snapshot.since_date")
ls_Customer_snapshotStreet = loo_JResp.StringOf("customer_snapshot.street")
ls_Customer_snapshotSuffix_1 = loo_JResp.StringOf("customer_snapshot.suffix_1")
ls_Customer_snapshotSuffix_2 = loo_JResp.StringOf("customer_snapshot.suffix_2")
ls_Tax_number = loo_JResp.StringOf("customer_snapshot.tax_number")
ls_Court = loo_JResp.StringOf("customer_snapshot.court")
ls_Court_registry_number = loo_JResp.StringOf("customer_snapshot.court_registry_number")
ls_Tax_options = loo_JResp.StringOf("customer_snapshot.tax_options")
ls_Customer_snapshotTitle = loo_JResp.StringOf("customer_snapshot.title")
ls_Archived = loo_JResp.StringOf("customer_snapshot.archived")
ls_Vat_identifier = loo_JResp.StringOf("customer_snapshot.vat_identifier")
ls_Customer_snapshotZip_code = loo_JResp.StringOf("customer_snapshot.zip_code")
ls_Document_pdf_type = loo_JResp.StringOf("customer_snapshot.document_pdf_type")
ls_Buyer_reference = loo_JResp.StringOf("customer_snapshot.buyer_reference")
ls_Foreign_supplier_number = loo_JResp.StringOf("customer_snapshot.foreign_supplier_number")
ls_Discount = loo_JResp.StringOf("discount")
ls_Discount_type = loo_JResp.StringOf("discount_type")
ls_Document_date = loo_JResp.StringOf("document_date")
ls_Due_date = loo_JResp.StringOf("due_date")
ls_Edited_at = loo_JResp.StringOf("edited_at")
ls_External_id = loo_JResp.StringOf("external_id")
ls_Replica_url = loo_JResp.StringOf("replica_url")
ls_Grace_period = loo_JResp.StringOf("grace_period")
ls_Due_in_days = loo_JResp.StringOf("due_in_days")
ls_Id = loo_JResp.StringOf("id")
li_Is_acceptable_on_public_domain = loo_JResp.BoolOf("is_acceptable_on_public_domain")
li_Is_archive = loo_JResp.BoolOf("is_archive")
ls_Is_draft = loo_JResp.StringOf("is_draft")
li_Is_replica = loo_JResp.BoolOf("is_replica")
li_Is_oss = loo_JResp.BoolOf("is_oss")
ls_Last_postbox_id = loo_JResp.StringOf("last_postbox_id")
ls_Login_id = loo_JResp.StringOf("login_id")
ls_V_number = loo_JResp.StringOf("number")
ls_Order_number = loo_JResp.StringOf("order_number")
ls_Buyer_reference = loo_JResp.StringOf("buyer_reference")
ls_Paid_amount = loo_JResp.StringOf("paid_amount")
ls_Paid_at = loo_JResp.StringOf("paid_at")
ls_Pdf_pages = loo_JResp.StringOf("pdf_pages")
ls_Pdf_template = loo_JResp.StringOf("pdf_template")
ls_Project_id = loo_JResp.StringOf("project_id")
ls_Next_date = loo_JResp.StringOf("recurring_options.next_date")
ls_Frequency = loo_JResp.StringOf("recurring_options.frequency")
ls_Frequency_special = loo_JResp.StringOf("recurring_options.frequency_special")
li_Interval = loo_JResp.IntOf("recurring_options.interval")
ls_End_date_or_count = loo_JResp.StringOf("recurring_options.end_date_or_count")
ls_Status = loo_JResp.StringOf("recurring_options.status")
li_As_draft = loo_JResp.BoolOf("recurring_options.as_draft")
li_Is_notify = loo_JResp.BoolOf("recurring_options.is_notify")
ls_Send_as = loo_JResp.StringOf("recurring_options.send_as")
li_Is_sign = loo_JResp.BoolOf("recurring_options.is_sign")
li_Is_paid = loo_JResp.BoolOf("recurring_options.is_paid")
ls_Paid_date_option = loo_JResp.StringOf("recurring_options.paid_date_option")
li_Is_sepa = loo_JResp.BoolOf("recurring_options.is_sepa")
ls_Sepa_local_instrument = loo_JResp.StringOf("recurring_options.sepa_local_instrument")
ls_Sepa_sequence_type = loo_JResp.StringOf("recurring_options.sepa_sequence_type")
ls_Sepa_reference = loo_JResp.StringOf("recurring_options.sepa_reference")
ls_Sepa_remittance_information = loo_JResp.StringOf("recurring_options.sepa_remittance_information")
ls_Target_type = loo_JResp.StringOf("recurring_options.target_type")
ls_Ref_id = loo_JResp.StringOf("ref_id")
ls_Root_id = loo_JResp.StringOf("root_id")
ls_V_Type = loo_JResp.StringOf("service_date.type")
ls_Date = loo_JResp.StringOf("service_date.date")
loo_JResp.DtOf("service_date.date_from",0,loo_Date_from)
loo_JResp.DtOf("service_date.date_to",0,loo_Date_to)
ls_Text = loo_JResp.StringOf("service_date.text")
ls_Shipping_country = loo_JResp.StringOf("shipping_country")
ls_Status = loo_JResp.StringOf("status")
ls_Text = loo_JResp.StringOf("text")
ls_Text_prefix = loo_JResp.StringOf("text_prefix")
ls_Text_tax = loo_JResp.StringOf("text_tax")
ls_Title = loo_JResp.StringOf("title")
ls_V_type = loo_JResp.StringOf("type")
li_Use_shipping_address = loo_JResp.BoolOf("use_shipping_address")
ls_Vat_country = loo_JResp.StringOf("vat_country")
ls_Vat_id = loo_JResp.StringOf("vat_id")
ls_Fulfillment_country = loo_JResp.StringOf("fulfillment_country")
ls_Vat_option = loo_JResp.StringOf("vat_option")
i = 0
li_Count_i = loo_JResp.SizeOfArray("attachment_ids")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("attachment_ids[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("customer_snapshot.additional_groups_ids")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("customer_snapshot.additional_groups_ids[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("customer_snapshot.emails")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("customer_snapshot.emails[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("item_notes")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("item_notes[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("items")
do while i < li_Count_i
    loo_JResp.I = i
    ls_V_number = loo_JResp.StringOf("items[i].number")
    ls_Description = loo_JResp.StringOf("items[i].description")
    ls_Document_note = loo_JResp.StringOf("items[i].document_note")
    li_Quantity = loo_JResp.IntOf("items[i].quantity")
    ls_Quantity_str = loo_JResp.StringOf("items[i].quantity_str")
    ls_Unit = loo_JResp.StringOf("items[i].unit")
    ls_V_type = loo_JResp.StringOf("items[i].type")
    ls_Position = loo_JResp.StringOf("items[i].position")
    ls_Single_price_net = loo_JResp.StringOf("items[i].single_price_net")
    ls_Single_price_gross = loo_JResp.StringOf("items[i].single_price_gross")
    li_Vat_percent = loo_JResp.IntOf("items[i].vat_percent")
    ls_Discount = loo_JResp.StringOf("items[i].discount")
    ls_Discount_type = loo_JResp.StringOf("items[i].discount_type")
    ls_Position_id = loo_JResp.StringOf("items[i].position_id")
    ls_Total_price_net = loo_JResp.StringOf("items[i].total_price_net")
    ls_Total_price_gross = loo_JResp.StringOf("items[i].total_price_gross")
    ls_Total_vat = loo_JResp.StringOf("items[i].total_vat")
    ls_Serial_number_id = loo_JResp.StringOf("items[i].serial_number_id")
    ls_Serial_number = loo_JResp.StringOf("items[i].serial_number")
    ls_Booking_account = loo_JResp.StringOf("items[i].booking_account")
    ls_Export_cost_1 = loo_JResp.StringOf("items[i].export_cost_1")
    ls_Export_cost_2 = loo_JResp.StringOf("items[i].export_cost_2")
    ls_Cost_price_net = loo_JResp.StringOf("items[i].cost_price_net")
    ls_Cost_price_total = loo_JResp.StringOf("items[i].cost_price_total")
    ls_Cost_price_charge = loo_JResp.StringOf("items[i].cost_price_charge")
    ls_Cost_price_charge_type = loo_JResp.StringOf("items[i].cost_price_charge_type")
    ls_ItemType = loo_JResp.StringOf("items[i].itemType")
    ls_Id = loo_JResp.StringOf("items[i].id")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("file_format_config")
do while i < li_Count_i
    loo_JResp.I = i
    ls_V_type = loo_JResp.StringOf("file_format_config[i].type")
    i = i + 1
loop


destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
destroy loo_Date_from
destroy loo_Date_to

Curl Command

curl -X PUT
	-H "Authorization: {{apiKey}}"
	-H "Accept: application/json"
https://api.easybill.de/rest/v1/documents/:id/done?reason_for_change=<string>

Postman Collection Item JSON

{
  "name": "To complete a document.",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/documents/:id/done?reason_for_change=<string>",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "documents",
        ":id",
        "done"
      ],
      "query": [
        {
          "key": "reason_for_change",
          "value": "<string>",
          "description": "A string that is saved on the document version as reason."
        }
      ],
      "variable": [
        {
          "key": "id",
          "value": "<long>",
          "description": "(Required) ID of document"
        }
      ]
    }
  },
  "response": [
    {
      "name": "Successful operation",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/done?reason_for_change=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "done"
          ],
          "query": [
            {
              "key": "reason_for_change",
              "value": "<string>",
              "description": "A string that is saved on the document version as reason."
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"address\": {\n    \"salutation\": \"<integer>\",\n    \"personal\": \"<boolean>\",\n    \"title\": \"<string>\",\n    \"first_name\": \"<string>\",\n    \"last_name\": \"<string>\",\n    \"suffix_1\": \"<string>\",\n    \"suffix_2\": \"<string>\",\n    \"company_name\": \"<string>\",\n    \"street\": \"<string>\",\n    \"zip_code\": \"<string>\",\n    \"city\": \"<string>\",\n    \"state\": \"<string>\",\n    \"country\": \"<string>\"\n  },\n  \"attachment_ids\": [\n    \"<integer>\",\n    \"<integer>\"\n  ],\n  \"label_address\": {\n    \"salutation\": \"<integer>\",\n    \"personal\": \"<boolean>\",\n    \"title\": \"<string>\",\n    \"first_name\": \"<string>\",\n    \"last_name\": \"<string>\",\n    \"suffix_1\": \"<string>\",\n    \"suffix_2\": \"<string>\",\n    \"company_name\": \"<string>\",\n    \"street\": \"<string>\",\n    \"zip_code\": \"<string>\",\n    \"city\": \"<string>\",\n    \"state\": \"<string>\",\n    \"country\": \"<string>\"\n  },\n  \"amount\": \"<integer>\",\n  \"amount_net\": \"<integer>\",\n  \"bank_debit_form\": null,\n  \"billing_country\": \"<string>\",\n  \"calc_vat_from\": 0,\n  \"cancel_id\": \"<long>\",\n  \"cash_allowance\": null,\n  \"cash_allowance_days\": null,\n  \"cash_allowance_text\": null,\n  \"contact_id\": null,\n  \"contact_label\": \"\",\n  \"contact_text\": \"\",\n  \"created_at\": \"<dateTime>\",\n  \"currency\": \"EUR\",\n  \"customer_id\": null,\n  \"customer_snapshot\": {\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\": 1,\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\": \"SALEPRICE6\",\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\": \"nStbIm\",\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  },\n  \"discount\": null,\n  \"discount_type\": null,\n  \"document_date\": \"<date>\",\n  \"due_date\": \"<date>\",\n  \"edited_at\": \"<dateTime>\",\n  \"external_id\": null,\n  \"replica_url\": null,\n  \"grace_period\": \"<integer>\",\n  \"due_in_days\": \"<integer>\",\n  \"id\": \"<long>\",\n  \"is_acceptable_on_public_domain\": false,\n  \"is_archive\": false,\n  \"is_draft\": \"<boolean>\",\n  \"is_replica\": false,\n  \"is_oss\": false,\n  \"item_notes\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"items\": [\n    {\n      \"number\": null,\n      \"description\": null,\n      \"document_note\": \"<string>\",\n      \"quantity\": 1,\n      \"quantity_str\": \"<string>\",\n      \"unit\": null,\n      \"type\": \"POSITION\",\n      \"position\": \"<integer>\",\n      \"single_price_net\": null,\n      \"single_price_gross\": \"<float>\",\n      \"vat_percent\": 0,\n      \"discount\": null,\n      \"discount_type\": null,\n      \"position_id\": null,\n      \"total_price_net\": \"<float>\",\n      \"total_price_gross\": \"<float>\",\n      \"total_vat\": \"<float>\",\n      \"serial_number_id\": \"<string>\",\n      \"serial_number\": \"<string>\",\n      \"booking_account\": null,\n      \"export_cost_1\": null,\n      \"export_cost_2\": null,\n      \"cost_price_net\": null,\n      \"cost_price_total\": \"<float>\",\n      \"cost_price_charge\": \"<float>\",\n      \"cost_price_charge_type\": \"PERCENT\",\n      \"itemType\": \"UNDEFINED\",\n      \"id\": \"<long>\"\n    },\n    {\n      \"number\": null,\n      \"description\": null,\n      \"document_note\": \"<string>\",\n      \"quantity\": 1,\n      \"quantity_str\": \"<string>\",\n      \"unit\": null,\n      \"type\": \"POSITION\",\n      \"position\": \"<integer>\",\n      \"single_price_net\": null,\n      \"single_price_gross\": \"<float>\",\n      \"vat_percent\": 0,\n      \"discount\": null,\n      \"discount_type\": null,\n      \"position_id\": null,\n      \"total_price_net\": \"<float>\",\n      \"total_price_gross\": \"<float>\",\n      \"total_vat\": \"<float>\",\n      \"serial_number_id\": \"<string>\",\n      \"serial_number\": \"<string>\",\n      \"booking_account\": null,\n      \"export_cost_1\": null,\n      \"export_cost_2\": null,\n      \"cost_price_net\": null,\n      \"cost_price_total\": \"<float>\",\n      \"cost_price_charge\": \"<float>\",\n      \"cost_price_charge_type\": \"PERCENT\",\n      \"itemType\": \"UNDEFINED\",\n      \"id\": \"<long>\"\n    }\n  ],\n  \"last_postbox_id\": \"<long>\",\n  \"login_id\": \"<long>\",\n  \"number\": null,\n  \"order_number\": \"\",\n  \"buyer_reference\": \"\",\n  \"paid_amount\": \"<integer>\",\n  \"paid_at\": \"<date>\",\n  \"pdf_pages\": \"<integer>\",\n  \"pdf_template\": \"<string>\",\n  \"project_id\": null,\n  \"recurring_options\": {\n    \"next_date\": \"<date>\",\n    \"frequency\": \"MONTHLY\",\n    \"frequency_special\": null,\n    \"interval\": 1,\n    \"end_date_or_count\": null,\n    \"status\": \"WAITING\",\n    \"as_draft\": false,\n    \"is_notify\": false,\n    \"send_as\": null,\n    \"is_sign\": false,\n    \"is_paid\": false,\n    \"paid_date_option\": \"created_date\",\n    \"is_sepa\": false,\n    \"sepa_local_instrument\": null,\n    \"sepa_sequence_type\": null,\n    \"sepa_reference\": null,\n    \"sepa_remittance_information\": null,\n    \"target_type\": \"INVOICE\"\n  },\n  \"ref_id\": null,\n  \"root_id\": null,\n  \"service_date\": {\n    \"type\": \"SERVICE\",\n    \"date\": \"<date>\",\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"text\": null\n  },\n  \"shipping_country\": null,\n  \"status\": null,\n  \"text\": \"<string>\",\n  \"text_prefix\": \"<string>\",\n  \"text_tax\": null,\n  \"title\": null,\n  \"type\": \"INVOICE\",\n  \"use_shipping_address\": false,\n  \"vat_country\": null,\n  \"vat_id\": \"\",\n  \"fulfillment_country\": null,\n  \"vat_option\": null,\n  \"file_format_config\": [\n    {\n      \"type\": \"xrechnung2_2_xml\"\n    },\n    {\n      \"type\": \"xrechnung3_0_xml\"\n    }\n  ]\n}"
    },
    {
      "name": "Not found",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/done?reason_for_change=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "done"
          ],
          "query": [
            {
              "key": "reason_for_change",
              "value": "<string>",
              "description": "A string that is saved on the document version as reason."
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/done?reason_for_change=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "done"
          ],
          "query": [
            {
              "key": "reason_for_change",
              "value": "<string>",
              "description": "A string that is saved on the document version as reason."
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Conflict",
      "code": 409,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Too Many Requests",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/done?reason_for_change=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "done"
          ],
          "query": [
            {
              "key": "reason_for_change",
              "value": "<string>",
              "description": "A string that is saved on the document version as reason."
            }
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}