Subposition positions API

Introduction

Subposition positions can be used on the following resources: estimates, orders and invoices. The resource URL is built like this:

/%parent_resource%/%parent_id%/kb_position_subposition

If you have an invoice with ID 4 you should replace the placeholder %parent_resource% with kb_invoice and replace the placeholder %parent_id% with 4. Estimates will be used in the upcomming examples.

List subposition positions

GET /kb_offer/1/kb_position_subposition
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • id

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 368
Content-Type: application/json
[
  {
    "id": 1,
    "type": "KbPositionSubposition",
    "text": "Unterposition",
    "pos": "5",
    "internal_pos": 7,
    "show_pos_nr": true,
    "parent_id": null,
    "is_optional": false,
    "total_sum": "0.0000",
    "show_pos_prices": true
  },
  {
    "id": 8,
    "type": "KbPositionSubposition",
    "text": "",
    "pos": "6",
    "internal_pos": 8,
    "show_pos_nr": true,
    "parent_id": null,
    "is_optional": false,
    "total_sum": "0.0000",
    "show_pos_prices": true
  }
]

Search subposition positions

POST /kb_offer/1/kb_position_subposition/search
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
[
  {
    "field": "text",
    "value": "sub"
  }
]
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • id
Name Required Type Description
text optional string
is_optional optional string

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 2
Content-Type: application/json
[

]

Show subposition position

GET /kb_offer/1/kb_position_subposition/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 176
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionSubposition",
  "text": "",
  "pos": "6",
  "internal_pos": 8,
  "show_pos_nr": true,
  "parent_id": null,
  "is_optional": false,
  "total_sum": "0.0000",
  "show_pos_prices": true
}

Create subposition position

POST /kb_offer/1/kb_position_subposition
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "show_pos_nr": true
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
show_pos_nr required boolean
text optional string (500)

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 201 Created
X-Authenticated-User: apiextract_1
Content-Length: 171
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionSubposition",
  "text": "",
  "pos": "6",
  "internal_pos": 8,
  "show_pos_nr": true,
  "parent_id": null,
  "is_optional": false,
  "total_sum": "0",
  "show_pos_prices": true
}

Overwrite subposition position

PUT /kb_offer/1/kb_position_subposition/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "show_pos_nr": true
}
Name Required Type Description
callback optional string
Name Required Type Description
show_pos_nr required boolean
is_optional optional boolean
text optional string (500)

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 176
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionSubposition",
  "text": "",
  "pos": "6",
  "internal_pos": 8,
  "show_pos_nr": true,
  "parent_id": null,
  "is_optional": false,
  "total_sum": "0.0000",
  "show_pos_prices": true
}

Edit subposition position

POST /kb_offer/1/kb_position_subposition/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "show_pos_nr": false
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
is_optional optional boolean
show_pos_nr optional boolean
text optional string (500)

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 178
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionSubposition",
  "text": "",
  "pos": null,
  "internal_pos": 8,
  "show_pos_nr": false,
  "parent_id": null,
  "is_optional": false,
  "total_sum": "0.0000",
  "show_pos_prices": true
}

Delete subposition position

DELETE /kb_offer/1/kb_position_subposition/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 16
Content-Type: application/json
{
  "success": true
}