POST

add_order

With this action you can add a new Shopgate order to your shop system. If there already is an order with the same number, the action must cancel and the error must be reported.

If you don’t use the Shopgate Cart Integration SDK you also have to call our Shopgate Merchant API method get_orders to get the order data.

Query parameters

action
string

Requested method

required
default : add_order
shop_number
string

Your shop number. Example: “11413”

required
offset
integer

Number of items (not item number, etc) to be skipped in the export.

limit
integer

Maximum number of items to be exported.

trace_id
string

Unique request trace ID. Example: “sma-9412”

required

Response

application/json
object

In case of an error

A JSON object including the error code, error text, API version and request trace ID is returned.

Otherwise a CSV file will be returned

error
integer

False means no error.

error_text
string or null

Error text; null means no error.

shopgate_library_version
string

Shopgate Library version. Example: “2.5.0”

plugin_version
string

Plugin version. Example: “2.5.3”

trace_id
string

Request trace-ID, needed as reference for contact Example: “sma-4f99573d74ae1”

external_order_number
string

Order number in your shop system. Example: “458323452”

external_order_id
string

Order id in your shop system. Example: “26345”

Error Codes

Code Description
2 cannot open/create logfile(s)
10 invalid value in configuration
11 error reading or writing configuration
20 no action specified
21 unknown action requested
22 disabled action requested
23 wrong response format
30 parameter “order_number” missing
60 duplicate order
62 no customer group found for customer
64 order status is sent
83 database error
84 unknown country code
85 unknown state code
100 no connection to server
101 Unknown action
102 error code received from merchant API
120 authentication failed
200 the coupon is not valid
201 the coupon code is not valid
202 products for coupon are not valid
203 delivery address for coupon is not valid
204 user is not valid for coupon
205 too many coupons in cart
999 Unknown error

Example

{
  "error": 0,
  "error_text": null,
  "shopgate_library_version": "2.1.0",
  "plugin_version": "2.1.0",
  "trace_id": "sma-3995",
  "external_order_id": "153003",
  "external_order_number": "141"
}