B2Bsellers Suite
API Referenceswww.b2b-sellers.comPublic demoshopRoadmap
v1.X.X (Shopware 6.4)
v1.X.X (Shopware 6.4)
  • Home
  • Product Tour
    • Plans & Plugin Concept
    • Public Demoshops
    • Get a personal B2B demo store?
  • User Guide
    • Installation & Setup
      • Installation
      • Requirements
      • Easy activate all Addons and Features
      • Use Test-Customers
      • License Settings
    • Configuration
      • License, purchaseable Addons and Features configuration
      • Configuration of the CORE
        • Express checkout setup
      • How to add „Menü Item“ on B2BPlattform
      • E-Mail Templates
      • B2B Rules
      • B2B Flow/Business Events
      • Customer specific prices
      • Registration process
      • PDP variant list
    • Configuration of purchasable Addons
      • Offer Function for Sales Agents
      • Spare Parts Shop
      • Subscription Article
      • Copper and brass product surcharges
      • Rating groups
      • B2B Platform Theme
      • E-Procurement (OCI-Punchout)
      • E-Procurement (cXML Purchase Order / Ariba)
      • Register Requests (wip)
      • Order lists
      • Bonus program
      • Product Request
      • URL Authentication
      • Cost centers
      • Discount Rate
      • Mobile sales portal (app)
      • Customer-specific assortments
      • Eventmanager (Beta)
      • Employee budgets
      • Order entry for Sales representatives (Beta)
    • Third Party Extensions
      • You want to provide a plugin?
    • Performance
    • FAQs
    • Support
  • Developer Guides
    • First Steps
      • Getting Started
      • Concept of Extensions
      • Dockware Setup (Docker)
      • How to start the b2b-platform vue.js watcher
      • How to build the b2b-platform (vue.js)
      • Protection of the Store-API
      • How to develop your first extensions
      • CLI-Commands
        • Migration of existing Shopware Customers
      • Cronjobs
      • Development Helpers
      • Example Plugins
    • Smart developer helpers
      • B2bPlatformContext
      • B2bContextTrait
      • EmployeePermissionTrait
      • B2B Body Classes
      • UseCustomer URL Parameter
      • Useful Vue.js Components for the B2B Platform
      • Useful Storefront Shopping World Elements
      • How to import external orders and offers?
    • How to's
      • Using B2Bsellers Suite with Shopware frontends
    • Guides for ERP-Interface
      • Overview - Full integrated ERP-Systems
      • Integration of ERP orders to Shopware 6
      • Integration Customers and Employees from ERP
    • Tips for Deployment / Continuous Integration
    • Typical errors
  • API-References
    • Database Schema
    • Entities
      • Custom Fields for existing Shopware Entities
      • Budget
      • BudgetEmployee
      • CollectionAccount
      • CustomerPrice
      • Employee
        • EmployeeCustomer
        • EmployeePermission
        • EmployeeRole
      • CustomerActivity
        • CustomerActivityType
      • Offer
        • OfferAddress
        • OfferCustomer
        • OfferItem
        • OfferStatus
      • ProductSubscription
      • ProductSubscriptionOrder
      • PasswordlessLogin
      • PaymentCondition
      • ProductExplodedView
      • B2bProductList
        • B2bProductListItem
        • B2bProductListType
      • RegisterRequest
        • RegisterRequestStatus
        • RegisterRequestActivity
      • SalesRepresentativeCustomer
    • Store-API
      • Account Request
      • Customer Activity
      • Customer Activity Type
      • Customer Last Orders
      • Customer List
      • Customer Price
      • Customer Sales Ranking
      • Customer Search
      • Delivery Interval
      • Delete Product Subscription
      • Document
      • Employee
      • Employee Permission
      • Employee Role
      • Employee Order
      • Event Product
      • Login Target List
      • Offer Document
      • Offer
      • Offer Mail
      • Offer Order
      • Offer Status
      • Ordered Products
      • Payment Condition
      • Platform Cms
      • Product List
      • Product Table Listing
      • Product Subscription
      • Product Subscription List
      • Sales Statistic
      • Snippet
    • Admin API
      • General Admin-API Info
      • Order Import Endpoint
      • Order Extension
  • Release Notes
    • B2BsellersCore
      • Version v1.1.4 - security update
      • Version v1.1.3
      • Version v1.1.2
      • Version v1.1.1
      • Version v1.1.0
      • Version v1.0.4
      • Version v1.0.3
      • Version v1.0.2
      • Version v1.0.1 - Hotfix
      • Version v1.0.0
      • Version v0.9.6
      • Version v0.9.5
      • Version v0.9.4
      • Version v0.9.3
      • Version v0.9.2
      • Version v0.9.1
Powered by GitBook
On this page
  • Useful Links
  • Changing default configuration options
  • Importing orders
  • Endpoint request body
  • Request body explanation

Was this helpful?

Edit on GitHub
  1. API-References
  2. Admin API

Order Import Endpoint

The endpoint offers a simplified way of importing orders into the shop, e.g. to transfer old orders from an ERP system.

Last updated 2 years ago

Was this helpful?

The Endpoint isn't available yet and will be released with the version 0.9.5 of the B2BSellers Core Plugin

Performance geek: Without any performance-optimization, you can insert 250 Orders under one minute!

Useful Links

Changing default configuration options

To change any default configuration option, you have to make the change in the b2b_sellers_core.yaml file. You can place it in your Shopware installation under config/packages/.

# config/packages/b2b_sellers_core.yaml
b2b_sellers_core:
  order_import:
    default_sales_channel_id: 3599498813f14f1a8abe0deb0e12d180
    default_currency_id: b7d2554b0ce847cd82f3ac9bd1c0dfca
    default_language_id: 2fbb5fe2e29a4d70aa5854ce7ce3e20b

The default_sales_channel_id isn't set out of the box and has to be provided in every order if not configured. The default_currency_id isn't set out of the box and the currency id of the Shopware defaults (Defaults::CURRENCY) is used when not provided. The default_language_id isn't set out of the box and the language id of the Shopware defaults (Defaults::LANGUAGE_SYSTEM) is used when not provided.

The default Ids can be overwritten by providing them in the order data

Importing orders

POST https://app.com/api/_action/order-import

Simplified endpoint for importing orders to Shopware

Request Body

Name
Type
Description

order*

array

{
	"success": true,
	"errors": [],
	"result": [
		{
			"row": 0,
			"id": "054386a889de4f9b9f449e687112d955"
		}
	]
}

{
	"succes": false,
	"errors": [
		{
			"row": 0,
			"errors": [
				"Value is not a valid UUID: 3599498813f14f1a8abe0deb0e12d1801"
			]
		}
	],
	"result": []
}

Endpoint request body

{
  "orders": [
    {
      "salesChannelId": "3599498813f14f1a8abe0deb0e12d1801", // (required) if default not configured
      //"currency": "EUR", // ISO-Code or ID
      //"language": "de-DE", // Locale code or ID
      //"customer": "10000", // customerNumber or ID
      "orderCustomer": { 
        "customer": "10000", // customerNumber or ID
        "salutation": "mr" // salutationKey or Id
        "firstName": "string",
        "lastName": "string",
        "email": "string",
        ...(default optional fields)
      }, 
      "orderDateTime": "2022-01-01 06:00:00",
      "shippingDateEarliest": "2022-01-12 06:00:00",
      "shippingDateLatest": "2022-01-14 06:00:00",
      "orderNumber": "T1236", // (required) update if exists
      "deliveryStatus": "open", // delivery state technicalName
      "orderStatus": "open", // order state technicalName
      "paymentStatus": "open", // transaction state technicalName
      "shippingMethod": "Standard", // translated name
      "paymentMethod": "Invoice", // translated name
      "lineItems": [
        {
          "type": "product",
          "price": 14.875,
          "netPrice": 12.50, 
          "quantity": 1,
          "product": "SWDEMO10001", // productNumber or ID (required for product type)
          "label": "string", // (optional for product line items)
          "good": true, // (optional)
          "removable": true, // (optional)
          "stackable": true, // (optional)
          "position": 1, // (optional)
          "description": "string", // (optional)
          "payload": [], // (optional)
          "customFields": [], // (optional)
        }
      ],
      "shippingCosts": {
        "price": 4.99,
        "netPrice": 4.99
      },
      "billingAddress": {
        "salutation": "mr", // salutationKey or Id
        "firstName": "firstName",
        "lastName": "lastName",
        "street": "street",
        "zipcode": "zipcode",
        "city": "city",
        "country": "DE" // ID or ISO-Code
      }
      "shippingAddress": { // (optional: billingAddress used)
        // same es billingAddress 
      }
    }
  ]
}

Minimal example:

{
  "orders": [
    {
      "salesChannelId": "3599498813f14f1a8abe0deb0e12d1801",
      "customer": "10000", 
      "orderDateTime": "2022-01-01 06:00:00",
      "shippingDateEarliest": "2022-01-12 06:00:00",
      "shippingDateLatest": "2022-01-14 06:00:00",
      "orderNumber": "T1236",
      "deliveryStatus": "open",
      "orderStatus": "open", 
      "paymentStatus": "open",
      "shippingMethod": "Standard",
      "paymentMethod": "Invoice",
      "lineItems": [
        {
          "type": "product",
          "price": 14.875,
          "netPrice": 12.50,
          "quantity": 1,
          "product": "SWDEMO10001"
        }
      ],
      "shippingCosts": {
        "price": 4.99,
        "netPrice": 4.99
      },
      "billingAddress": {
        "salutation": "mr",
        "firstName": "firstName",
        "lastName": "lastName",
        "street": "street",
        "zipcode": "zipcode",
        "city": "city",
        "country": "DE"
      }
    }
  ]
}

Request body explanation

Price

Taxes are calculated automatically. The overall order price is being calculated by the prices from line items and shipping costs.

Customer

The endpoint provides serveral options for the order customer data

  • The orderCustomer array can be generated by the endpoint when the customerId or the customerNumber are given in the "customer" field.

  • The orderCustomer can be provided normally and the customerId can't be fetched by providing the customerNumber inside of the orderCustomer array in the "customer" field.

Salutations

Salutations are accepted as Id or salutation key (e.g. mr,...)

States

States for order, delivery and transaction have to be the technical name of the state

Integration of ERP orders to Shopware 6