v1

latestOpenAPI 3.0.0UNLICENSED2026-07-26178479713.7 KB
draft.items

aid_draft_orders_id_items_post

Updates a draft with new item

scopes:

  • admin:shopping
  • write:shopping
post/accounts/{aid}/shopping/draft_orders/{id}/items

Path parameters

aidstring ^[PT]{1}\d{8}$ required

An id that uniquely identifies the account.

idstring uuid required

The resource identifier string

Query parameters

apply_discountsboolean

Calculate available discounts and apply them to the order.

Requires additional scope for accessing the DealEngine, one of

  • admin:discounts
  • write:discounts
  • write:discounts:/available_for_receipt

The tax_lines will be updated if apply_discount results in new net_amount.

  • net_amount = gross_amount - Σ discount_lines.amount

tax_line.amount will be calculated from tax_line.percentage and net_amount.

Request body

idstring

The ID or SKU of the product on the line

statusstring

The item status

metadataobject

Additional details about the item, key values will be included as extra_info in the receipt.

line_idinteger

The number of the line (or id), must be unique between all items.

quantitynumber

The quantity of the product in the item line.

gross_amountinteger required

Monetary amount in smallest unit for the currency before discounts

net_amountinteger

Monetary amount in smallest unit for the currency after discounts

descriptionstring
description_aliasstring

Short description / title of the product

is_changedboolean

Discount applied to gross amount

eligible_for_discountboolean
external_idstring

External ID related to the item.

salesperson_idstring

Id of the sales person if other then the operator

salesperson_namestring

Name of the sales person

commentstring

comment on the item

versionnumber
reversed_reasonstring

Reverse the item from an order

Applicable only if the draft is created to update an existing order

original_currencystring iso-4217

Representing the currency in which the item was originally priced

original_gross_amountinteger

Monetary amount in smallest unit for the original currency

conversion_rate_ppminteger

Scaled integer (parts per million) representing the conversion rate used to translate original_currency gross amount into the orders currency.

Example: If 1 SEK = 1.099 NOK, then conversion_rate_ppm = 1099000

conversion_rate_timestampstring date-time

The timestamp indicating when the exchange rate was determined.

conversion_rate_sourcestring

Identifier of the source of the exchange rate

Example request

{
  "id": "175938",
  "groups": [
    {
      "id": "B234",
      "name": "Stol"
    },
    {
      "id": "B1",
      "name": "Møbel"
    }
  ],
  "line_id": 1,
  "quantity": 2,
  "gross_amount": 39800,
  "net_amount": 27840,
  "tax_lines": [
    {
      "amount": 5584,
      "amount_dwh": "5584.0440",
      "included_in_price": true,
      "percentage": 25,
      "tax_basis": 27920,
      "tax_basis_dwh": "27920.22",
      "tax_code": "3",
      "tax_group": "Vmva-høy"
    }
  ],
  "description": "Stablestol for utendørsbruk",
  "description_alias": "Staplestol",
  "eligible_for_discount": true,
  "discount_lines": [
    {
      "amount": 4400,
      "percentage": 44,
      "discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
      "line_id": 1
    }
  ],
  "additions": [
    {
      "id": "C1203",
      "description": "Extra Cheese",
      "gross_amount": 27840,
      "groups": [
        {
          "id": "B234",
          "name": "Stol"
        },
        {
          "id": "B1",
          "name": "Møbel"
        }
      ]
    }
  ],
  "store": {
    "id": "SL02",
    "organization_number": "123456789MVA",
    "name": "SC Oslo",
    "business_name": "SC Oslo AS"
  },
  "external_id": "SL02-94821948",
  "payout": {
    "destinations": [
      {
        "type": "percentage",
        "value": "10",
        "amount": 4000,
        "destinations": [
          {
            "amount": 500
          },
          {
            "destinations": [
              {
                "amount": 3500
              }
            ]
          }
        ]
      },
      {
        "amount": 500
      },
      {
        "destinations": [
          {
            "amount": 192
          },
          {
            "amount": 38308
          }
        ]
      }
    ]
  },
  "original_currency": "SEK",
  "original_gross_amount": 39800,
  "conversion_rate_ppm": 1099000,
  "conversion_rate_source": "ecb"
}

Response

draft order was updated

idstring

The resource ID. Defaults to UUID v4

created_atstring date-time

Read-only timestamp, automatically assigned on back-end.

created_bystring

The resource ID. Defaults to UUID v4

updated_atstring date-time

Read-only timestamp, automatically assigned on back-end.

deleted_bystring

The resource ID. Defaults to UUID v4

deleted_atstring date-time

Read-only timestamp, automatically assigned on back-end.

status'open' | 'completed' | 'deleted'

The status of the DraftOrder as it transitions into an Order.

Status is set to completed when the DraftOrder is completed and an Order is created

After a DraftOrder is set to completed the only further modification that can be made are adding notes or metadata fields

versioninteger

The version of the draft. Incremented when the draft is updated.

Example response

{
  "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  "events": [
    {
      "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
      "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da"
    }
  ],
  "options": {
    "order_time_to_live": 94672800,
    "payout": {
      "rules": [
        {
          "rule_type": "order.items.store.id",
          "rule_id": "sc029",
          "rule_version": 1,
          "destinations": [
            {
              "type": "percentage",
              "value": 10,
              "destinations": [
                {
                  "type": "flat_amount",
                  "value": "500",
                  "destination": "account-a"
                },
                {
                  "type": "remaining_amount",
                  "destinations": [
                    {
                      "type": "percentage",
                      "value": "5.0",
                      "destination": "account-b"
                    }
                  ]
                }
              ]
            },
            {
              "type": "flat_amount",
              "value": "500",
              "destination": "account-a"
            },
            {
              "type": "remaining_amount",
              "destinations": [
                {
                  "type": "percentage",
                  "value": "5",
                  "destination": "account-b"
                },
                {
                  "type": "percentage",
                  "value": "95.0",
                  "destination": "account-c"
                }
              ]
            }
          ]
        }
      ]
    }
  },
  "order": {
    "customer": {
      "metadata": {
        "dob_year": 1985
      },
      "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
      "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
      "first_name": "John",
      "last_name": "Doe",
      "email": "customer@example.com",
      "phone_number": "+4799999999",
      "enrolled_by": {
        "type": "url",
        "value": "https://facebook.com"
      },
      "marketing_consent": {
        "sms": {
          "consent": true,
          "updated_at": "2018-01-12T13:42:00Z"
        },
        "email": {
          "consent": true,
          "updated_at": "2018-01-12T13:42:00Z"
        }
      },
      "addresses": [
        {
          "address_line": "Sommerkroveien 34",
          "address_line_2": "PB 123",
          "postal_code": "0349",
          "postal_place": "Oslo",
          "country": "NO",
          "latitude": 59.942112,
          "longitude": 10.716991,
          "comment": "5th floor, use doorbell."
        }
      ],
      "company": {
        "organization_number": "123456789MVA",
        "bussiness_name": "TKP tech AS",
        "department": "sales department",
        "industry": "computer industry"
      },
      "gender": "male",
      "date_of_birth": "1990-09-20"
    },
    "gross_amount": 39800,
    "net_amount": 27840,
    "total_discount": 23130,
    "shipping_address": {
      "address_line": "Sommerkroveien 34",
      "address_line_2": "PB 123",
      "postal_code": "0349",
      "postal_place": "Oslo",
      "country": "NO",
      "first_name": "John",
      "last_name": "Doe",
      "comment": "5th floor, use doorbell."
    },
    "billing_address": {
      "address_line": "Sommerkroveien 34",
      "address_line_2": "PB 123",
      "postal_code": "0349",
      "postal_place": "Oslo",
      "country": "NO",
      "first_name": "John",
      "last_name": "Doe",
      "comment": "5th floor, use doorbell."
    },
    "time_to_live": 94672800,
    "itinerary": [
      {
        "arrival_address": {
          "address_line": "Sommerkroveien 34",
          "address_line_2": "PB 123",
          "postal_code": "0349",
          "postal_place": "Oslo",
          "latitude": 59.942112,
          "longitude": 10.716991,
          "country": "NO"
        },
        "departure_address": {
          "address_line": "Sommerkroveien 34",
          "address_line_2": "PB 123",
          "postal_code": "0349",
          "postal_place": "Oslo",
          "latitude": 59.942112,
          "longitude": 10.716991,
          "country": "NO"
        }
      }
    ],
    "items": [
      {
        "id": "175938",
        "groups": [
          {
            "id": "B234",
            "name": "Stol"
          },
          {
            "id": "B1",
            "name": "Møbel"
          }
        ],
        "line_id": 1,
        "quantity": 2,
        "gross_amount": 39800,
        "net_amount": 27840,
        "tax_lines": [
          {
            "amount": 5584,
            "amount_dwh": "5584.0440",
            "included_in_price": true,
            "percentage": 25,
            "tax_basis": 27920,
            "tax_basis_dwh": "27920.22",
            "tax_code": "3",
            "tax_group": "Vmva-høy"
          }
        ],
        "description": "Stablestol for utendørsbruk",
        "description_alias": "Staplestol",
        "eligible_for_discount": true,
        "discount_lines": [
          {
            "amount": 4400,
            "percentage": 44,
            "discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
            "line_id": 1
          }
        ],
        "additions": [
          {
            "id": "C1203",
            "description": "Extra Cheese",
            "gross_amount": 27840,
            "groups": [
              {
                "id": "B234",
                "name": "Stol"
              },
              {
                "id": "B1",
                "name": "Møbel"
              }
            ]
          }
        ],
        "store": {
          "id": "SL02",
          "organization_number": "123456789MVA",
          "name": "SC Oslo",
          "business_name": "SC Oslo AS"
        },
        "external_id": "SL02-94821948",
        "payout": {
          "destinations": [
            {
              "type": "percentage",
              "value": "10",
              "amount": 4000,
              "destinations": [
                {
                  "amount": 500
                },
                {
                  "destinations": [
                    {
                      "amount": 3500
                    }
                  ]
                }
              ]
            },
            {
              "amount": 500
            },
            {
              "destinations": [
                {
                  "amount": 192
                },
                {
                  "amount": 38308
                }
              ]
            }
          ]
        },
        "original_currency": "SEK",
        "original_gross_amount": 39800,
        "conversion_rate_ppm": 1099000,
        "conversion_rate_source": "ecb"
      }
    ],
    "type": "delivery",
    "order_number": "order123456",
    "currency": "NOK",
    "store": {
      "id": "SL02",
      "organization_number": "123456789MVA",
      "name": "SC Oslo",
      "business_name": "SC Oslo AS"
    },
    "external_links": [
      {
        "text": "Order Receipt",
        "href": "https://example.dintero.com/receipts/234CC019-8BA9-4DDB-9A40-8C9EE0BB943C?type=pdf"
      }
    ],
    "attachments": [
      {
        "bus_reservation": {
          "booking_id": "NE 138 47794",
          "itinerary": [
            {
              "departure_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "arrival_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "operator": "SAS"
            }
          ]
        },
        "car_reservation": {
          "booking_id": "TV 347794",
          "itinerary": [
            {
              "rental_company": "Avis",
              "pick_up_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "drop_off_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              }
            }
          ]
        },
        "ferry_reservation": {
          "booking_id": "NE 138 47794",
          "itinerary": [
            {
              "departure_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "arrival_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "operator": "SAS"
            }
          ]
        },
        "metro_reservation": {
          "booking_id": "NE 138 47794",
          "itinerary": [
            {
              "departure_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "arrival_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "operator": "SAS"
            }
          ]
        },
        "taxi_reservation": {
          "booking_id": "NE 138 47794",
          "itinerary": [
            {
              "departure_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "arrival_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "operator": "SAS"
            }
          ]
        },
        "train_reservation": {
          "booking_id": "NE 138 47794",
          "itinerary": [
            {
              "departure_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "arrival_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "operator": "SAS"
            }
          ]
        },
        "tram_reservation": {
          "booking_id": "NE 138 47794",
          "itinerary": [
            {
              "departure_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "arrival_address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO"
              },
              "operator": "SAS"
            }
          ]
        }
      }
    ],
    "stores": [
      {
        "id": "SL02",
        "organization_number": "123456789MVA",
        "name": "SC Oslo",
        "business_name": "SC Oslo AS"
      }
    ]
  }
}