Order

Create a new order.

Create a new order

post/rest/api/orders/

Request body

platformIdinteger required

<a href='#tag/Order/operation/get_rest_orders_platform_map'>Sale platform account ID</a>

idExternalstring nullable

External order ID, e.g. on the sales platform

isInvoiceboolean

Does the customer want a VAT invoice?

customerLoginstring
paymentStatusstring required

Payment status (0-no payment, 1-partially paid, 2-paid in full/amount in accordance with the order, 3-overpayment)

paymentTypeinteger required

<a href='#tag/Order/operation/get_rest_orders_payment_map'>Payment method ID</a>

originalCurrencystring required

Order currency

originalAmountTotalWithoutTaxstring nullable required

Value of the order items without tax

originalAmountTotalWithTaxstring nullable required

Value of order items including tax

originalAmountTotalPaidstring nullable required

Gross amount paid by customer in original currency

sendDateMinstring date-time nullable

Minimal shipping date

sendDateMaxstring date-time nullable

Maximum shipping date

carrierAccountinteger required

<a href='#tag/Order/operation/get_rest_orders_carrier_account_map'>Carrier account ID</a>

orderedAtstring date-time nullable required

Date when the order was created by the customer

statusinteger required

<a href='#tag/Order/operation/get_rest_orders_shipment_status_map'>Status ID</a>

Example request

{
  "platformId": 1,
  "idExternal": "WWW/341/2023",
  "isInvoice": true,
  "customerLogin": "user123",
  "paymentType": 2,
  "originalCurrency": "PLN",
  "sendDateMin": "2022-03-07T00:00:00Z",
  "sendDateMax": "2022-03-08T20:00:00Z",
  "preferences": {
    "idUser": "user-12345"
  },
  "orderItems": [
    {
      "id": 1,
      "idExternal": "359",
      "ean": "400638133393",
      "sku": "P44/3-T1.2",
      "originalName": "Samsung Galaxy S20 Plus Black 128GB 5G",
      "originalCode": "PHONE-S20-128GB-B",
      "originalPriceWithTax": "2799.99",
      "originalPriceWithoutTax": "2799.99",
      "media": null,
      "quantity": 2,
      "tax": "23.00",
      "productSet": null,
      "status": 1,
      "unit": "Szt.",
      "type": 1,
      "productId": 12345
    },
    {
      "id": 2,
      "idExternal": null,
      "ean": null,
      "sku": "ship-pp",
      "originalName": "Wysyłka - Poczta Polska - Pocztex",
      "originalCode": null,
      "originalPriceWithTax": "10.00",
      "originalPriceWithoutTax": "10.00",
      "media": null,
      "quantity": 1,
      "tax": null,
      "productSet": null,
      "status": 1,
      "unit": null,
      "type": 2,
      "productId": null
    }
  ],
  "orderPayments": [
    {
      "idExternal": "PAY-123456",
      "amount": 1259.98,
      "paymentDate": "2022-03-08T20:00:00Z",
      "type": 1,
      "comment": "Komentarz do wpłaty"
    }
  ],
  "addressCustomer": {
    "name": "Jan Kowalski",
    "phone": "+48 500 000 000",
    "email": "jan.kowalski@apilo.com",
    "streetName": "Testowa",
    "streetNumber": "4b/12",
    "city": "Kraków",
    "zipCode": "31-154",
    "country": "PL",
    "parcelIdExternal": "KRA32B",
    "parcelName": "Paczkomat, ul. Testowa 12 (obok sklepu)",
    "companyTaxNumber": "937-271-51-54",
    "companyName": "Apilo Sp. z o.o."
  },
  "addressDelivery": {
    "name": "Jan Kowalski",
    "phone": "+48 500 000 000",
    "email": "jan.kowalski@apilo.com",
    "streetName": "Testowa",
    "streetNumber": "4b/12",
    "city": "Kraków",
    "zipCode": "31-154",
    "country": "PL",
    "parcelIdExternal": "KRA32B",
    "parcelName": "Paczkomat, ul. Testowa 12 (obok sklepu)",
    "companyTaxNumber": "937-271-51-54",
    "companyName": "Apilo Sp. z o.o."
  },
  "addressInvoice": {
    "name": "Jan Kowalski",
    "phone": "+48 500 000 000",
    "email": "jan.kowalski@apilo.com",
    "streetName": "Testowa",
    "streetNumber": "4b/12",
    "city": "Kraków",
    "zipCode": "31-154",
    "country": "PL",
    "parcelIdExternal": "KRA32B",
    "parcelName": "Paczkomat, ul. Testowa 12 (obok sklepu)",
    "companyTaxNumber": "937-271-51-54",
    "companyName": "Apilo Sp. z o.o."
  },
  "carrierAccount": 1,
  "orderNotes": [
    {
      "type": 2,
      "comment": "I'll ask for delivery next week at the earliest"
    }
  ],
  "orderedAt": "2022-06-09T10:59:12+0100",
  "status": 3
}

Response

Order with the given idExternal already exists

idstring required

Internal order ID

Example response

{
  "id": "AA123456789"
}

Changes