Save order

POST /Orders/SaveOrders — OMS API · Orders

Transfers orders created in your sales channel to OMS. The body is an array; you can send multiple records in a single request.

When to call: When the order payment is completed and finalized.

  • orderNumber is the unique key of the order. Orders sent again with the same number are not recreated; packages with new sourcePackageId in the body are added to the existing order, existing ones are skipped.
  • If you do not know the packages at the time of the order, leave the packages field empty and use the CreatePackage endpoint later.
  • Send as many lines as the quantity in the lines array of each item; cancellations and returns are done via sourceOrderItemLineId.
  • The response is order-based: items[].itemCode = orderNumber. If one fails, the overall isSuccess is false; the error of the failed order is in items[].errorMesssage, others may have been saved.
  • If a package's deliveryServiceType value is invalid, the request is terminated with HTTP 500; orders before that order in the list may have been saved.

Authentication: Bearer token or Basic Auth (user:password or user:password:tenant, Base64) is accepted. If called with a vendor user, the vendorCode value of all packages must belong to that vendor.

İstek gövdesi

  • items (object[], zorunlu): Order items.
    • items.sku (string, zorunlu): Product SKU code.
    • items.lines (object[]): Quantity-based rows of the item.
      • items.lines.saleTotal (number<double>): Sale amount of the row.
      • items.lines.productTypeId (integer<int64>): Product type ID.
      • items.lines.erpOrderItemLineId (string): Corresponding entry in ERP for the row.
      • items.lines.orderItemLineTaxes (object[]): Taxes related to the line item.
      • items.lines.orderItemLinePayments (object[]): Payment shares allocated to the row.
      • items.lines.sourceOrderItemLineId (string, zorunlu): Unique ID of the row in your system. For items with quantity, a separate row is sent for each unit; cancellation/return is done with this ID.
      • items.lines.orderItemLineDiscounts (object[]): Discounts applied to the line item.
    • items.isGift (boolean): Is it a gift package.
    • items.barcode (string, zorunlu): Product barcode.
    • items.seoName (string): SEO name of the product.
    • items.vatRate (number<double>): VAT rate.
    • items.currency (string): Currency.
    • items.giftNote (string): Gift note.
    • items.quantity (integer<int32>): Quantity.
    • items.vendorId (integer<int64>): Seller ID.
    • items.listPrice (number<double>): Unit list price.
    • items.modelCode (string): Product model code.
    • items.saleTotal (number<double>): Total sale amount of the item.
    • items.lastStatus (string): Last status of the item in the source system.
    • items.optionCode (string): Product option code (color etc.).
    • items.productName (string, zorunlu): Product name.
    • items.priceExclTax (number<double>): Price excluding tax.
    • items.productPrice (number<double>): Unit sale price.
    • items.productTypeId (integer<int64>): Product type ID.
    • items.unitSaleTotal (number<double>): Unit sale amount.
    • items.productPhotoPath1 (string): Product image URL.
    • items.sourceOrderItemId (string, zorunlu): Unique ID of the item in your system.
    • items.salesRepresentativeId (string): Sales representative ID.
  • posId (integer<int64>): Cash register ID.
  • isGift (boolean): Whether it is a gift order.
  • isGuest (boolean): Whether the order was placed without membership.
  • orderId (string): The identity of the order in your system. Used as sourceOrderId when creating a package.
  • posCode (string): Cash register code.
  • storeId (integer<int64>): Store ID.
  • customer (object, zorunlu): Customer information.
    • customer.email (string, zorunlu): Email address.
    • customer.phone (string): Landline phone.
    • customer.lastName (string, zorunlu): Customer last name.
    • customer.firstName (string, zorunlu): Customer first name.
    • customer.taxNumber (string): Tax number.
    • customer.customerId (string): Customer ID in your system. If filled, this is used as the customer code.
    • customer.countryCode (string): Customer country code. Default is TR.
    • customer.mobilePhone (string, zorunlu): Mobile phone.
    • customer.customerCode (string): Customer code (used if customerId is empty).
    • customer.identityNumber (string): Identity number.
    • customer.mobilePhonePrefix (string): Mobile phone country code prefix.
    • customer.customerAttributes (object[]): Additional fields related to the customer.
      • customer.customerAttributes.attributeKey (string, zorunlu): Additional field name.
      • customer.customerAttributes.attributeValue (string, zorunlu): Additional field value.
  • giftNote (string): Gift note.
  • packages (object[]): Shipping packages. Packages can also be added later with CreatePackage.
    • packages.cargoKey (string): Shipping key.
    • packages.lastStatus (string): Last status of the package in the source system.
    • packages.vendorCode (string): Seller code who will send the package. When called with the seller user, all packages must belong to that seller.
    • packages.trackingURL (string): Shipping tracking link.
    • packages.packageItems (object[], zorunlu): Items included in the package.
      • packages.packageItems.vatRate (number<double>): VAT rate.
      • packages.packageItems.quantity (integer<int32>): Quantity included in this package.
      • packages.packageItems.saleTotal (number<double>): Sales amount allocated to the package.
      • packages.packageItems.vendorSku (string): Vendor's own SKU code.
      • packages.packageItems.sourceOrderItemId (string, zorunlu): items[].sourceOrderItemId value of the order item included in the package.
      • packages.packageItems.packageItemAttributes (object[]): Additional fields related to the package item.
    • packages.subVendorCode (string): Sub-seller code.
    • packages.deliveryMethod (integer<int32>): Delivery method. 0 = delivery by cargo (default).
    • packages.erpOrderNumber (string): ERP order number of the package.
    • packages.invoiceAddress (object, zorunlu): Billing address.
      • packages.invoiceAddress.phone (string, zorunlu): Phone number.
      • packages.invoiceAddress.region (string): Region information.
      • packages.invoiceAddress.isValid (boolean): Whether the address is verified.
      • packages.invoiceAddress.zipCode (string, zorunlu): Postal code.
      • packages.invoiceAddress.cityCode (string): City code.
      • packages.invoiceAddress.cityName (string, zorunlu): City name.
      • packages.invoiceAddress.lastName (string, zorunlu): Recipient's last name.
      • packages.invoiceAddress.firstName (string, zorunlu): Recipient's first name.
      • packages.invoiceAddress.stateCode (string): State/region code.
      • packages.invoiceAddress.stateName (string): State/region name (for foreign addresses).
      • packages.invoiceAddress.taxNumber (string): Tax number (corporate invoice).
      • packages.invoiceAddress.taxOffice (string): Tax office (corporate invoice).
      • packages.invoiceAddress.streetCode (string): Street code.
      • packages.invoiceAddress.streetName (string): Street name.
      • packages.invoiceAddress.addressType (string, zorunlu): Address type: Shipment (delivery) or Invoice (billing).
      • packages.invoiceAddress.companyName (string): Company name (for corporate invoice).
      • packages.invoiceAddress.countryName (string, zorunlu): Country name.
      • packages.invoiceAddress.phonePrefix (string): Phone country code prefix.
      • packages.invoiceAddress.addressLine1 (string, zorunlu): Address line 1.
      • packages.invoiceAddress.addressLine2 (string, zorunlu): Address line 2. This field is mandatory; if there is no second line, send a value like -.
      • packages.invoiceAddress.buildingCode (string): Building code.
      • packages.invoiceAddress.districtCode (string): District code.
      • packages.invoiceAddress.districtName (string, zorunlu): District name.
      • packages.invoiceAddress.provinceName (string): Province name (for foreign addresses).
      • packages.invoiceAddress.identityNumber (string): Identity number (individual invoice).
      • packages.invoiceAddress.sourceAddressId (string, zorunlu): ID of the address in your system; must be unique within the order (can be values like 1, 2).
      • packages.invoiceAddress.externalCityCode (string): External system code for the city.
      • packages.invoiceAddress.formattedAddress (string): Formatted full address text.
      • packages.invoiceAddress.neighborhoodCode (string): Neighborhood code.
      • packages.invoiceAddress.addressAttributes (object[]): Additional fields related to the address.
      • packages.invoiceAddress.externalStateCode (string): External system code for the state/region.
      • packages.invoiceAddress.neighbourhoodName (string): Neighborhood name.
      • packages.invoiceAddress.externalStreetCode (string): External system code for the street.
      • packages.invoiceAddress.externalAddressCode (string): External system code for the address.
      • packages.invoiceAddress.externalBuildingCode (string): External system code for the building.
      • packages.invoiceAddress.externalDistrictCode (string): External system code for the district.
      • packages.invoiceAddress.externalNeighborhoodCode (string): External system code for the neighborhood.
    • packages.trackingNumber (string): Shipping tracking number.
    • packages.shipmentAddress (object): Delivery address. Must be sent for delivery by cargo (deliveryMethod 0); otherwise, the invoice address is used.
      • packages.shipmentAddress.phone (string, zorunlu): Phone number.
      • packages.shipmentAddress.region (string): Region information.
      • packages.shipmentAddress.isValid (boolean): Whether the address is verified.
      • packages.shipmentAddress.zipCode (string, zorunlu): Postal code.
      • packages.shipmentAddress.cityCode (string): City code.
      • packages.shipmentAddress.cityName (string, zorunlu): City name.
      • packages.shipmentAddress.lastName (string, zorunlu): Recipient's last name.
      • packages.shipmentAddress.firstName (string, zorunlu): Recipient's first name.
      • packages.shipmentAddress.stateCode (string): State/region code.
      • packages.shipmentAddress.stateName (string): State/region name (for foreign addresses).
      • packages.shipmentAddress.taxNumber (string): Tax number (corporate invoice).
      • packages.shipmentAddress.taxOffice (string): Tax office (corporate invoice).
      • packages.shipmentAddress.streetCode (string): Street code.
      • packages.shipmentAddress.streetName (string): Street name.
      • packages.shipmentAddress.addressType (string, zorunlu): Address type: Shipment (delivery) or Invoice (billing).
      • packages.shipmentAddress.companyName (string): Company name (for corporate invoice).
      • packages.shipmentAddress.countryName (string, zorunlu): Country name.
      • packages.shipmentAddress.phonePrefix (string): Phone country code prefix.
      • packages.shipmentAddress.addressLine1 (string, zorunlu): Address line 1.
      • packages.shipmentAddress.addressLine2 (string, zorunlu): Address line 2. This field is mandatory; if there is no second line, send a value like -.
      • packages.shipmentAddress.buildingCode (string): Building code.
      • packages.shipmentAddress.districtCode (string): District code.
      • packages.shipmentAddress.districtName (string, zorunlu): District name.
      • packages.shipmentAddress.provinceName (string): Province name (for foreign addresses).
      • packages.shipmentAddress.identityNumber (string): Identity number (individual invoice).
      • packages.shipmentAddress.sourceAddressId (string, zorunlu): ID of the address in your system; must be unique within the order (can be values like 1, 2).
      • packages.shipmentAddress.externalCityCode (string): External system code for the city.
      • packages.shipmentAddress.formattedAddress (string): Formatted full address text.
      • packages.shipmentAddress.neighborhoodCode (string): Neighborhood code.
      • packages.shipmentAddress.addressAttributes (object[]): Additional fields related to the address.
      • packages.shipmentAddress.externalStateCode (string): External system code for the state/region.
      • packages.shipmentAddress.neighbourhoodName (string): Neighborhood name.
      • packages.shipmentAddress.externalStreetCode (string): External system code for the street.
      • packages.shipmentAddress.externalAddressCode (string): External system code for the address.
      • packages.shipmentAddress.externalBuildingCode (string): External system code for the building.
      • packages.shipmentAddress.externalDistrictCode (string): External system code for the district.
      • packages.shipmentAddress.externalNeighborhoodCode (string): External system code for the neighborhood.
    • packages.sourcePackageId (string, zorunlu): Unique ID of the package in your system. Packages sent a second time with the same ID are skipped.
    • packages.deliverySlotCode (string): Delivery time slot code (maximum 50 characters).
    • packages.lastModifiedDate (string<date-time>): Last modification time of the package. If not sent, the request time is used.
    • packages.cargoIsChangeable (boolean): Whether the shipping company can be changed later.
    • packages.packageAttributes (object[]): Additional fields related to the package.
      • packages.packageAttributes.attributeKey (string, zorunlu): Additional field name.
      • packages.packageAttributes.attributeValue (string, zorunlu): Additional field value.
    • packages.carrierCompanyCode (string): Shipping company code.
    • packages.erpOrderCreateDate (string<date-time>): Order creation time in ERP.
    • packages.deliveryServiceType (string): Delivery service type. Can be left empty; if filled, must be one of the listed values, otherwise the order is rejected (case insensitive).
  • payments (object[]): Payments at the order level.
    • payments.iban (string): IBAN for wire transfer/EFT payments.
    • payments.total (number<double>): Payment amount.
    • payments.force3d (boolean): Whether 3D Secure was enforced in the payment.
    • payments.posName (string): Name of the virtual POS where the payment was received.
    • payments.bankName (string): Bank name.
    • payments.cardName (string): Card name.
    • payments.cardType (string): Card type.
    • payments.interest (number<double>): Installment interest amount.
    • payments.posPoint (number<double>): Used POS points.
    • payments.cardFamily (string): Card family.
    • payments.cardIssuer (string): Card issuing institution.
    • payments.fraudScore (integer<int32>): Fraud score.
    • payments.force3dRule (string, zorunlu): 3D Secure enforcement rule information. Field does not accept empty string; send a meaningful value if no rule exists.
    • payments.paidDateUtc (string<date-time>): Payment time (UTC).
    • payments.paymentType (string): Payment type.
    • payments.paymentAgent (string): Payment intermediary.
    • payments.international (boolean): Whether it is a foreign card.
    • payments.paymentMethod (string): Payment method.
    • payments.paymentStatus (integer<int32>): Payment status code.
    • payments.cardHolderName (string): Cardholder name.
    • payments.installmentCount (integer<int32>): Number of installments.
    • payments.loyaltyUsedPoint (number<double>): Used loyalty points.
    • payments.transferBankName (string): Bank name for wire transfer/EFT payments.
    • payments.captureTransactionId (string): Collection (capture) transaction ID.
    • payments.maskedCreditCardNumber (string): Masked card number.
    • payments.captureTransactionResult (string): Collection transaction result.
    • payments.cashOnDeliveryPaymentType (string): Type of cash on delivery payment.
    • payments.subscriptionTransactionId (string): Subscription transaction ID.
    • payments.authorizationTransactionId (string): Authorization transaction ID.
    • payments.allowStoringCreditCardNumber (boolean): Whether storing the card number is allowed.
    • payments.authorizationTransactionCode (string): Authorization approval code.
    • payments.authorizationTransactionResult (string): Authorization transaction result.
  • supplier (string): Supplier information.
  • addresses (object[]): List of addresses related to the order.
    • addresses.phone (string, zorunlu): Phone number.
    • addresses.region (string): Region information.
    • addresses.isValid (boolean): Whether the address is verified.
    • addresses.zipCode (string, zorunlu): Postal code.
    • addresses.cityCode (string): City code.
    • addresses.cityName (string, zorunlu): City name.
    • addresses.lastName (string, zorunlu): Recipient's last name.
    • addresses.firstName (string, zorunlu): Recipient's first name.
    • addresses.stateCode (string): State/region code.
    • addresses.stateName (string): State/region name (for foreign addresses).
    • addresses.taxNumber (string): Tax number (corporate invoice).
    • addresses.taxOffice (string): Tax office (corporate invoice).
    • addresses.streetCode (string): Street code.
    • addresses.streetName (string): Street name.
    • addresses.addressType (string, zorunlu): Address type: Shipment (delivery) or Invoice (billing).
    • addresses.companyName (string): Company name (for corporate invoice).
    • addresses.countryName (string, zorunlu): Country name.
    • addresses.phonePrefix (string): Phone country code prefix.
    • addresses.addressLine1 (string, zorunlu): Address line 1.
    • addresses.addressLine2 (string, zorunlu): Address line 2. This field is mandatory; if there is no second line, send a value like -.
    • addresses.buildingCode (string): Building code.
    • addresses.districtCode (string): District code.
    • addresses.districtName (string, zorunlu): District name.
    • addresses.provinceName (string): Province name (for foreign addresses).
    • addresses.identityNumber (string): Identity number (individual invoice).
    • addresses.sourceAddressId (string, zorunlu): ID of the address in your system; must be unique within the order (can be values like 1, 2).
    • addresses.externalCityCode (string): External system code for the city.
    • addresses.formattedAddress (string): Formatted full address text.
    • addresses.neighborhoodCode (string): Neighborhood code.
    • addresses.addressAttributes (object[]): Additional fields related to the address.
      • addresses.addressAttributes.attributeKey (string, zorunlu): Additional field name.
      • addresses.addressAttributes.attributeValue (string, zorunlu): Additional field value.
    • addresses.externalStateCode (string): External system code for the state/region.
    • addresses.neighbourhoodName (string): Neighborhood name.
    • addresses.externalStreetCode (string): External system code for the street.
    • addresses.externalAddressCode (string): External system code for the address.
    • addresses.externalBuildingCode (string): External system code for the building.
    • addresses.externalDistrictCode (string): External system code for the district.
    • addresses.externalNeighborhoodCode (string): External system code for the neighborhood.
  • cashierId (string): Cashier ID.
  • discounts (object[]): Discounts at the order level.
    • discounts.total (number<double>): Total discount.
    • discounts.amount (number<double>): Discount amount.
    • discounts.couponCode (string): Coupon code.
    • discounts.discountId (string): Discount ID.
    • discounts.realAmount (number<double>): Actual discount amount applied.
    • discounts.discountCode (string): Discount code.
    • discounts.discountName (string): Discount name.
    • discounts.discountCampId (string, zorunlu): Campaign ID.
    • discounts.discountTypeId (string): Discount type ID.
  • orderDate (string<date-time>, zorunlu): Order time.
  • storeCode (string): Store code (used if storeId is not available).
  • deviceCode (string): Device code.
  • lastStatus (string): The last status of the order in the source system.
  • channelCode (string, zorunlu): Sales channel code (up to 50 characters), e.g. WEB.
  • countryCode (string): Order country code.
  • description (string): Order note.
  • orderNumber (string): Order number. The unique key of the order: orders sent again with the same number are not recreated, only new packages are added.
  • languageCode (string): Order language code.
  • applicationId (integer<int64>): Application ID from which the order originated (website, mobile app, store app, etc.).
  • erpOrderNumber (string): ERP order number.
  • additionalCosts (object[]): Additional costs.
    • additionalCosts.cost (number<double>): Amount.
    • additionalCosts.rate (number<double>): Rate.
    • additionalCosts.description (string): Description of the additional cost.
  • orderAttributes (object[]): Additional fields related to the order.
    • orderAttributes.attributeKey (string, zorunlu): Additional field name.
    • orderAttributes.attributeValue (string, zorunlu): Additional field value.
  • totalShippingPrice (number<double>): Total shipping fee.
  • orderSourceTypeCode (string): Order source type code.

Yanıtlar

  • 200: Request processed. Check the items array for order-based results.
  • 400: Body validation failed (missing required field, type mismatch, or malformed JSON). Response is in ASP.NET Core ValidationProblemDetails format; the errors field indicates which fields are invalid.
  • 401: Authorization header missing, token invalid or expired. Body is empty; obtain a new token via /Auth/login.
  • 500: Unexpected server error. This response returns with PascalCase field names (unlike other responses) and includes null fields.

200 yanıt alanları

  • items (object[], zorunlu): Separate result for each submitted record.
    • items.itemCode (string, zorunlu): Code of the record to which the result belongs (in order record orderNumber, in package creation sourcePackageId).
    • items.isSuccess (boolean, zorunlu): true if this record was processed successfully.
    • items.errorMesssage (string): Error message if the record failed. Returned only if populated.
  • errorType (string): General error type. Returned only if populated.
  • isSuccess (boolean, zorunlu): true if all records in the list are successful; false if at least one fails.
  • errorSource (string): Error source. Returned only if populated.
  • errorMesssage (string): General error message (e.g., order not found). Returned only if populated.