Grüezi!

On the following pages you will find the information required to transfer order details directly to us from your online store using the MeinEinkauf.ch Partner API.

The MeinEinkauf.ch partnership

MeinEinkauf.ch acts as an interface between German online vendors and Swiss customers.

We provide a service with which you can ship your goods to Swiss customers at German prices. Your customers can expect delivery from Germany with the following advantages:

  • All duties paid delivery to the customers’ doorstep
  • Short shipping times (in general German delivery time + 1 business day)
  • National instead of international shipping fees (enabling deliveries up to 30kg to be more reasonably priced)
  • Returns without additional customs fees at the border customs office

Our partnership offers an easier access to Swiss customers and the Swiss market.

How to become a partner

If you are interested in joining the MeinEinkauf.ch partner program, please contact partner@meineinkauf.ch or visit us at partner.meineinkauf.ch.

First steps

The MeinEinkauf.ch partner API directed at online vendors, logistics service providers and developers who are aquainted with the integration of a RESTful API into their IT system environment. Plugins for the most common shop systems will be introduced in the near future.

SSL

To secure the sensitive information that is transmitted with the order, all requests must be encrypted with SSL. MeinEinkauf.ch offers a valid and signed SSL certificate. Requests that are transmitted without SSL encoding will be rejected by our API.

REST

The MeinEinkauf.ch API is constructed according to the REST paradigm. Despite there being no defined REST standard, there are approaches and best-practises that can simplify the use of RESTful APIs. Interaction with API endpoints is made possible with standard HTTP methods POST, GET, PUT and DELETE. For these operations the acronym CRUD (Create, Read, Update, Delete) is used as well. You can find more information on REST here.

JSON

The MeinEinkauf.ch partner API exclusively uses JSON for data transmissions. Transmitted data must apply to valid JSON standards. API responses are also in JSON.

Availability

We value our partner APIs maximal availability which is ensured with state-of-the-art IT technologies. With scheduled updates and maintenance being a requirement, we do our best to keep maintenance times as low as possible. During maintenance the API is not accessible; in which case you will receive the HTTP status code 503 Service Unavailable. In this case it is necessary for the request to be sent again at a later time. You can find more information on possible HTTP status codes here.

Overview

API URL

The MeinEinkauf.ch partner API can be found at the following URL:

https://api.meineinkauf.ch/v1/

Authentication

All requests to the MeinEinkauf.ch Partner API must be authenticated by HTTP Basic authentication. The user name is api, the password is the API key we will provide.

Testing

Test API Key

In order to test the implementation in your online store, you may use MEINEINKAUF_TEST_API_KEY as the API key. The transmitted data will be validated at the actual conditions, as will the answers and possible error reports. However we do not persist transmitted test data.

Test System

Additionally to the test via API Key, we also provide a test system. After the test system has been set up, we will save the transmitted data. You can find it here:

https://api-test.meineinkauf.ch/v1/

This sandbox system is an exact copy of the productive system. Order processing is simulated in the test system. Every 15 minutes, routines ensure that all orders pass through all states and the process can be tested thoroughly.

The first request

To streamline introduction we have implemented an echo endpoint which returns a transmitted parameter. This way, you may test functions such as authentication and others.

Request:

curl https://api.meineinkauf.ch/v1/echo/HelloWorld \
  -X GET \
  -u 'api:MEINEINKAUF_TEST_API_KEY'

Response:

{
    "echo": "HelloWorld",
    "errors": [],
    "success": true,
    "testMode": true
}

HTTP Status Codes

  • 200 OK - Your request has been successful.
  • 201 Created - The transmitted data has been successfully processed and e.g. an order has been created.
  • 400 Bad Request - The endpoint does not exist or has been requested with an incorrect HTTP method.
  • 401 Unauthorized - The request could not be authenticated.
  • 422 Unprocessable Entity - The transmitted data is invalid.
  • 500 Internal Server Error - Due to an error on our page the request has not been processed. We are currently working on fixing the problem. Please send the request again at a later time.
  • 503 Service Unavailable - This status is given during scheduled maintenance work. The transmitted data has not been processed. Please send the request again at a later time.

API Error Codes

  • E0000 ApiKey is missing - You did not give an ApiKey.
  • E0001 Unknown ApiKey - The ApiKey is unknown.
  • E1000 Invalid JSON - The transmitted data is invalid. A detailed error report will be returned as well.
  • E1001 No order found for given ordernumber - The order does not exist.
  • E1002 No return consignment found for given reference - The return consignment does not exist.

Echo

The echo endpoint has been implemented to test the connection from your system to our API. It exclusively serves to render the transmitted parameters.

Post echo

Post echo

Authorizations:
basicAuth
Request Body schema: application/json
echo
required
string [ 1 .. 255 ] characters

Responses

Response Schema: application/json
echo
required
string (EchoResponse)
success
required
boolean (Success)
required
Array of objects (Errors)

Request samples

Content type
application/json
{
  • "echo": "Hello World!"
}

Response samples

Content type
application/json
{
  • "echo": "Hello World!",
  • "success": true,
  • "errors": [
    • {
      • "code": "string",
      • "message": "string",
      • "property": "string"
      }
    ]
}

Get echo

Get echo

Authorizations:
basicAuth
path Parameters
echo
required
string
Example: Hello World!

The string given back as echo

Responses

Response Schema: application/json
echo
required
string (EchoResponse)
success
required
boolean (Success)

Response samples

Content type
application/json
{
  • "echo": "Hello World!",
  • "success": true
}

Order

You may use our order endpoint to transfer the order files from your online shop directly to us, but also to request information about the current order status. The status may include information such as the Swiss tracking number for your customers to track their delivery.

Post order

Post order

Authorizations:
basicAuth
Request Body schema: application/json
orderNumber
required
string [ 1 .. 255 ] characters

Your order number

externalId
string [ 1 .. 255 ] characters

Unique identifier in your system which we will only pass through

orderDate
required
string^20\d{2}-\d{2}-\d{2}$

The order date in the format "YYYY-MM-DD" ISO-8601 (MEZ/MESZ)

currency
required
string
Enum: "eur" "chf"

The order currency

paymentType
required
string
Enum: "mastercard" "visa" "amex" "creditcard" "paypal" "prepayment" "invoice" "other"

The selected payment method

grossSum
required
number [ 0 .. 100000 ]

Gross total (incl. shipping cost, donactions and discounts)

soldOnMarketplace
boolean
Default: false

Set to true if the order was sold on a swiss marketplace

required
object (CustomerRequest)
required
object (AddressRequest)

If the invoice address is located in Switzerland or Liechtenstein, the street has to be transmitted in the property "street" and optionally the housenumber in the property "houseNumber". If the invoice address is not located in Switzerland or Liechtenstein, the address must be transmitted in the property "addressLine" according the the countrys format.

object (AddressRequest)

The shipping address must always be located in Switzerland or Liechtenstein. If it is empty, the invoice address will be taken as shipping address.

required
Array of objects (ConsignmentRequest) non-empty
object (ShippingCostRequest)

The shipping costs

Array of objects (DiscountRequest)

Potential discounts for this order

Array of objects (DonationRequest)

Potential additional donations to your order

object (InvoiceInformationRequest)

Responses

Response Schema: application/json
id
required
integer (ID)
success
required
boolean (Success)
required
Array of objects (Errors)

Request samples

Content type
application/json
{
  • "orderNumber": "1518180120",
  • "externalId": "9876",
  • "orderDate": "2018-02-21",
  • "currency": "chf",
  • "paymentType": "prepayment",
  • "grossSum": 80,
  • "soldOnMarketplace": false,
  • "customer": {
    • "customerNumber": "customer1234",
    • "contactEmail": "max@muster.ch"
    },
  • "invoiceAddress": {
    • "company": "Muster GmbH",
    • "salutation": "Frau",
    • "title": "Dr.",
    • "firstName": "Erika",
    • "lastName": "Musterfrau",
    • "street": "Musterstrasse",
    • "houseNumber": "28a",
    • "addressLine": "140 Av. des Champs-Élysées",
    • "additionalAddressLine": "Im Hinterhof",
    • "zip": "8005",
    • "city": "Zürich",
    • "country": "CH",
    • "state": "Zürich"
    },
  • "shippingAddress": {
    • "company": "Muster GmbH",
    • "salutation": "Frau",
    • "title": "Dr.",
    • "firstName": "Erika",
    • "lastName": "Musterfrau",
    • "street": "Musterstrasse",
    • "houseNumber": "28a",
    • "addressLine": "140 Av. des Champs-Élysées",
    • "additionalAddressLine": "Im Hinterhof",
    • "zip": "8005",
    • "city": "Zürich",
    • "country": "CH",
    • "state": "Zürich",
    • "telephone": "+41711234567"
    },
  • "consignments": [
    • {
      • "externalId": "9876",
      • "identificationBarcode": "123456789",
      • "grossWeight": 1200,
      • "dimensions": {
        • "width": 1,
        • "height": 1,
        • "length": 1
        },
      • "tracking": {
        • "carrier": "dhl",
        • "trackingNumber": "1234567890"
        },
      • "articles": [
        • {
          • "articleNumber": "12345678",
          • "externalId": "9876",
          • "payload": "Lorem ipsum dolor",
          • "name": "Gelbes Hemd",
          • "quantity": 2,
          • "grossWeight": 500,
          • "grossPrice": 35,
          • "vatRate": "standard",
          • "countryOfOrigin": "DE",
          • "attributes": {
            • "brand": "Foobar",
            • "color": "gelb",
            • "description": "Ein gelbes Hemd.",
            • "material": "100% Baumwolle",
            • "ean": "590123412345",
            • "upc": "036000291452",
            • "asin": "B005Z75C92",
            • "size": "XL",
            • "customIdentCode": "ABC1234",
            • "swissSocketAdapter": "Dreipolig"
            }
          }
        ]
      }
    ],
  • "shippingCost": {
    • "grossPrice": 10,
    • "vatRate": "standard"
    },
  • "discounts": [
    • {
      • "name": "Ihr Rabatt",
      • "grossPrice": -10,
      • "vatRate": "standard"
      }
    ],
  • "donations": [
    • {
      • "name": "Ihre Spende",
      • "grossPrice": 10,
      • "vatRate": "standard"
      }
    ],
  • "invoiceInformation": {
    • "invoiceDate": "2018-02-21",
    • "dueDate": "2018-03-21",
    • "additionalInvoiceText": "Vielen Dank!",
    • "esrInformation": {
      • "bankName": "Raiffeisenbank St. Gallen",
      • "bankZip": "9001",
      • "bankCity": "St. Gallen",
      • "bankAccount": "1234567890",
      • "postAccount": "01-12345-1",
      • "recipientName": "Musterfirma GmbH",
      • "recipientStreet": "Musterstrasse",
      • "recipientHouseNumber": "1a",
      • "recipientZip": "D-12345",
      • "recipientCity": "Musterstadt",
      • "referenceNumber": "12345678"
      },
    • "qrrInformation": {
      • "qrIban": "CH5212345678123456789",
      • "referenceNumber": "12345678",
      • "creditor": {
        • "name": "Musterfirma GmbH",
        • "addressLine1": "Musterstrasse 1a",
        • "addressLine2": "12345 Musterstadt",
        • "country": "DE"
        }
      }
    }
}

Response samples

Content type
application/json
{
  • "id": 1234,
  • "success": true,
  • "errors": [
    • {
      • "code": "string",
      • "message": "string",
      • "property": "string"
      }
    ]
}

Get multiple orders

Get multiple orders

Authorizations:
basicAuth
query Parameters
limit
integer [ 1 .. 50 ]
Default: 50

The numbers of items to return.

offset
integer >= 0
Default: 0

The number of items to skip before starting to collect the result set.

sort
string
Default: "orderDate:desc"
Enum: "id:desc" "id:asc" "orderDate:desc" "orderDate:asc" "created:desc" "created:asc" "processingStateChanged:desc" "processingStateChanged:asc"

The sorting of orders

processingStates
string
Example: processingStates=arrived,exported

Returns a subset of orders in certain processing states. Multiple states can be requested comma separated. Possible states: [open, arrival_assumed, arrived, partial_delivery_arrived, verified, verified_partially, exported, exported_partially, not_arrived, problem, cancellation]

By default orders in all processing states except for 'cancellation' are returned. If orders in processing state 'cancellation' should be included, the processing state has to be explicitly specified.

Responses

Response Schema: application/json
required
Array of objects (Orders)
success
required
boolean (Success)
count
required
integer (Count)
limit
required
integer (Limit)
offset
required
integer (Offset)
required
Array of objects (Errors)

Response samples

Content type
application/json
{}

Get single order

Get single order

Authorizations:
basicAuth
path Parameters
orderNumber
required
string
Example: 1518180120

Your order number

query Parameters
treatReferenceAsId
string
Default: "0"
Enum: "0" "1"

If set to 1, the given reference will be treated as the id of the resource

Responses

Response Schema: application/json
required
object (OrderResponse)
success
required
boolean (Success)
required
Array of objects (Errors)

Response samples

Content type
application/json
{}

Returns

At our returns endpoint, you may request information about returns that have been delivered and registered to our returns center in Switzerland.

Get multiple returns

Get multiple returns

Authorizations:
basicAuth
query Parameters
limit
integer [ 1 .. 50 ]
Default: 50

The numbers of items to return.

offset
integer >= 0
Default: 0

The number of items to skip before starting to collect the result set.

sort
string
Default: "id:desc"
Enum: "id:desc" "id:asc" "created:desc" "created:asc" "processingStateChanged:desc" "processingStateChanged:asc"

The sorting of returns

processingStates
string
Example: processingStates=open,ready_for_transfer

Returns a subset of returns in certain processing states. Multiple states can be requested comma separated. Possible states: [open, ready_for_transfer, transferred, completed]

Responses

Response Schema: application/json
required
Array of objects (Returns)
success
required
boolean (Success)
count
required
integer (Count)
limit
required
integer (Limit)
offset
required
integer (Offset)
required
Array of objects (Errors)

Response samples

Content type
application/json
{
  • "returns": [
    • {
      • "id": 1234,
      • "created": "2019-02-28T14:50:28+01:00",
      • "reference": "6019123456",
      • "processingState": "open",
      • "processingStateHistory": [
        • {
          • "state": "open",
          • "changed": "2019-02-28T14:50:28+01:00"
          }
        ],
      • "processingStateChanged": "2019-02-28T14:50:28+01:00",
      • "order": {
        • "id": 1234,
        • "externalId": "9876",
        • "orderNumber": "1518180120"
        },
      • "items": [
        • {
          • "id": 1234,
          • "reference": "8812452250",
          • "article": {
            • "id": 1234,
            • "articleNumber": "12345678",
            • "externalId": "9876",
            • "payload": "Lorem ipsum dolor",
            • "name": "Gelbes Hemd"
            },
          • "reason": "not_as_described",
          • "state": "used"
          }
        ],
      • "tour": {
        • "id": 1234,
        • "mrnDe": "12345678",
        • "mrnCh": "12345678",
        • "transferDate": "2019-03-02"
        },
      • "tracking": {}
      }
    ],
  • "success": true,
  • "count": 42,
  • "limit": 50,
  • "offset": 0,
  • "errors": [
    • {
      • "code": "string",
      • "message": "string",
      • "property": "string"
      }
    ]
}

Get single return

Get single return

Authorizations:
basicAuth
path Parameters
reference
required
string
Example: 6019123456

The reference number of a return

query Parameters
treatReferenceAsId
string
Default: "0"
Enum: "0" "1"

If set to 1, the given reference will be treated as the id of the resource

Responses

Response Schema: application/json
required
object (ReturnResponse)
success
required
boolean (Success)
required
Array of objects (Errors)

Response samples

Content type
application/json
{
  • "return": {
    • "id": 1234,
    • "created": "2019-02-28T14:50:28+01:00",
    • "reference": "6019123456",
    • "processingState": "open",
    • "processingStateHistory": [
      • {
        • "state": "open",
        • "changed": "2019-02-28T14:50:28+01:00"
        }
      ],
    • "processingStateChanged": "2019-02-28T14:50:28+01:00",
    • "order": {
      • "id": 1234,
      • "externalId": "9876",
      • "orderNumber": "1518180120"
      },
    • "items": [
      • {
        • "id": 1234,
        • "reference": "8812452250",
        • "article": {
          • "id": 1234,
          • "articleNumber": "12345678",
          • "externalId": "9876",
          • "payload": "Lorem ipsum dolor",
          • "name": "Gelbes Hemd"
          },
        • "reason": "not_as_described",
        • "state": "used"
        }
      ],
    • "tour": {
      • "id": 1234,
      • "mrnDe": "12345678",
      • "mrnCh": "12345678",
      • "transferDate": "2019-03-02"
      },
    • "tracking": {}
    },
  • "success": true,
  • "errors": [
    • {
      • "code": "string",
      • "message": "string",
      • "property": "string"
      }
    ]
}

OrderRequest

orderNumber
required
string [ 1 .. 255 ] characters

Your order number

externalId
string [ 1 .. 255 ] characters

Unique identifier in your system which we will only pass through

orderDate
required
string^20\d{2}-\d{2}-\d{2}$

The order date in the format "YYYY-MM-DD" ISO-8601 (MEZ/MESZ)

currency
required
string
Enum: "eur" "chf"

The order currency

paymentType
required
string
Enum: "mastercard" "visa" "amex" "creditcard" "paypal" "prepayment" "invoice" "other"

The selected payment method

grossSum
required
number [ 0 .. 100000 ]

Gross total (incl. shipping cost, donactions and discounts)

soldOnMarketplace
boolean
Default: false

Set to true if the order was sold on a swiss marketplace

required
object (CustomerRequest)
required
object (AddressRequest)

If the invoice address is located in Switzerland or Liechtenstein, the street has to be transmitted in the property "street" and optionally the housenumber in the property "houseNumber". If the invoice address is not located in Switzerland or Liechtenstein, the address must be transmitted in the property "addressLine" according the the countrys format.

object (AddressRequest)

The shipping address must always be located in Switzerland or Liechtenstein. If it is empty, the invoice address will be taken as shipping address.

required
Array of objects (ConsignmentRequest) non-empty
object (ShippingCostRequest)

The shipping costs

Array of objects (DiscountRequest)

Potential discounts for this order

Array of objects (DonationRequest)

Potential additional donations to your order

object (InvoiceInformationRequest)
{
  • "orderNumber": "1518180120",
  • "externalId": "9876",
  • "orderDate": "2018-02-21",
  • "currency": "chf",
  • "paymentType": "prepayment",
  • "grossSum": 80,
  • "soldOnMarketplace": false,
  • "customer": {
    • "customerNumber": "customer1234",
    • "contactEmail": "max@muster.ch"
    },
  • "invoiceAddress": {
    • "company": "Muster GmbH",
    • "salutation": "Frau",
    • "title": "Dr.",
    • "firstName": "Erika",
    • "lastName": "Musterfrau",
    • "street": "Musterstrasse",
    • "houseNumber": "28a",
    • "addressLine": "140 Av. des Champs-Élysées",
    • "additionalAddressLine": "Im Hinterhof",
    • "zip": "8005",
    • "city": "Zürich",
    • "country": "CH",
    • "state": "Zürich"
    },
  • "shippingAddress": {
    • "company": "Muster GmbH",
    • "salutation": "Frau",
    • "title": "Dr.",
    • "firstName": "Erika",
    • "lastName": "Musterfrau",
    • "street": "Musterstrasse",
    • "houseNumber": "28a",
    • "addressLine": "140 Av. des Champs-Élysées",
    • "additionalAddressLine": "Im Hinterhof",
    • "zip": "8005",
    • "city": "Zürich",
    • "country": "CH",
    • "state": "Zürich",
    • "telephone": "+41711234567"
    },
  • "consignments": [
    • {
      • "externalId": "9876",
      • "identificationBarcode": "123456789",
      • "grossWeight": 1200,
      • "dimensions": {
        • "width": 1,
        • "height": 1,
        • "length": 1
        },
      • "tracking": {
        • "carrier": "dhl",
        • "trackingNumber": "1234567890"
        },
      • "articles": [
        • {
          • "articleNumber": "12345678",
          • "externalId": "9876",
          • "payload": "Lorem ipsum dolor",
          • "name": "Gelbes Hemd",
          • "quantity": 2,
          • "grossWeight": 500,
          • "grossPrice": 35,
          • "vatRate": "standard",
          • "countryOfOrigin": "DE",
          • "attributes": {
            • "brand": "Foobar",
            • "color": "gelb",
            • "description": "Ein gelbes Hemd.",
            • "material": "100% Baumwolle",
            • "ean": "590123412345",
            • "upc": "036000291452",
            • "asin": "B005Z75C92",
            • "size": "XL",
            • "customIdentCode": "ABC1234",
            • "swissSocketAdapter": "Dreipolig"
            }
          }
        ]
      }
    ],
  • "shippingCost": {
    • "grossPrice": 10,
    • "vatRate": "standard"
    },
  • "discounts": [
    • {
      • "name": "Ihr Rabatt",
      • "grossPrice": -10,
      • "vatRate": "standard"
      }
    ],
  • "donations": [
    • {
      • "name": "Ihre Spende",
      • "grossPrice": 10,
      • "vatRate": "standard"
      }
    ],
  • "invoiceInformation": {
    • "invoiceDate": "2018-02-21",
    • "dueDate": "2018-03-21",
    • "additionalInvoiceText": "Vielen Dank!",
    • "esrInformation": {
      • "bankName": "Raiffeisenbank St. Gallen",
      • "bankZip": "9001",
      • "bankCity": "St. Gallen",
      • "bankAccount": "1234567890",
      • "postAccount": "01-12345-1",
      • "recipientName": "Musterfirma GmbH",
      • "recipientStreet": "Musterstrasse",
      • "recipientHouseNumber": "1a",
      • "recipientZip": "D-12345",
      • "recipientCity": "Musterstadt",
      • "referenceNumber": "12345678"
      },
    • "qrrInformation": {
      • "qrIban": "CH5212345678123456789",
      • "referenceNumber": "12345678",
      • "creditor": {
        • "name": "Musterfirma GmbH",
        • "addressLine1": "Musterstrasse 1a",
        • "addressLine2": "12345 Musterstadt",
        • "country": "DE"
        }
      }
    }
}

OrderResponse

id
required
integer
externalId
string
created
string
orderNumber
required
string
orderDate
string
processingState
required
string
Array of objects (ProcessingStateHistory)
processingStateChanged
string
required
Array of objects (ConsignmentResponse)
{}

ReturnResponse

id
required
integer
created
string
reference
required
string
processingState
required
string
required
Array of objects (ProcessingStateHistory)
processingStateChanged
string
required
object
required
Array of objects (ItemResponse)
required
object
object (TrackingResponse)
{
  • "id": 1234,
  • "created": "2019-02-28T14:50:28+01:00",
  • "reference": "6019123456",
  • "processingState": "open",
  • "processingStateHistory": [
    • {
      • "state": "open",
      • "changed": "2019-02-28T14:50:28+01:00"
      }
    ],
  • "processingStateChanged": "2019-02-28T14:50:28+01:00",
  • "order": {
    • "id": 1234,
    • "externalId": "9876",
    • "orderNumber": "1518180120"
    },
  • "items": [
    • {
      • "id": 1234,
      • "reference": "8812452250",
      • "article": {
        • "id": 1234,
        • "articleNumber": "12345678",
        • "externalId": "9876",
        • "payload": "Lorem ipsum dolor",
        • "name": "Gelbes Hemd"
        },
      • "reason": "not_as_described",
      • "state": "used"
      }
    ],
  • "tour": {
    • "id": 1234,
    • "mrnDe": "12345678",
    • "mrnCh": "12345678",
    • "transferDate": "2019-03-02"
    },
  • "tracking": {}
}

Imprint

MeinEinkauf AG
Fürstenlandstrasse 35
CH-9001 St. Gallen

MwSt-Nr.: CHE-331.561.017 MWST
Handelsregister-Nr.: CHE-320.3.072.275-1

The entire website is subject to Swiss legislation.