Prerequisites

You should have

  • a valid api merchant-token enabled for api access & order management access
  • an api-client
  • at least one order in the Hublify Marketplace

 

Getting a list of orders

To check for new orders, retrieve a list of your orders

Request URL

https://{your hublify url}/api/merchant_10/order_getList

Request parameter (optional)

While not mandatory, it is recommended to filter your request

// Example to retrieve the time and id of your orders with unshipped items: 
{
    "fields": [
        "orderid",
        "o_time_ordered",
    ],
    "filter": {
        "drvd_oi_qty_not_shipped": {
            "search": "> 0"
        }
    }
}

Response

If your request was successful, you receive the details for your orders.

See "Getting order details" for a more extensive list of result data

{
    "status": true,
    "data": [
        {
            "orderid": "A00001234-MRCH00123",            // the Hublify internal ID for this order
            "o_time_ordered": "2022-06-15 13:30:06"
        },
        {
            "orderid": "A00001233-MRCH00123",
            "o_time_ordered": "2022-06-14 12:30:06"
        },
        {
            "orderid": "A00001232-MRCH00123",
            "o_time_ordered": "2022-05-30 18:27:42"
        }
    ],
    "meta": {
        "FOUND_ROWS": "3"  // number of results matching your request
    }
}

Response - Error

If your request failed, you receive an error message.

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Request failed."
        }
    ]
}

 

Getting order details

To retrieve details about an order, you need the Hublify internal orderid

Request URL

https://{your hublify url}/api/merchant_10/order_get

Request parameter

{
    "filter": {
        "orderid": "A00001234-MRCH00123", // the Hublify internal orderid
    }
}

Response

If your request was successful, you receive all the detals about this order, that you need to fulfill it.
Depending on the hublify-system you might also be able to retrieve additional data that are not mentioned here.
 

{
    "status": true,
    "data": {
        "orderid": "A00001234-MRCH00123",
        "invoice_gender": "male",
        "invoice_title": "",
        "invoice_firstname": "Max",
        "invoice_lastname": "Muster",
        "invoice_company": "",
        "invoice_addrextra": "",
        "invoice_street": "Sample Street",
        "invoice_housenr": "1b",
        "invoice_zip": "22222",
        "invoice_town": "Hamburg",
        "invoice_country": "DE",
        "invoice_email": "max.muster@example.com",
        "email": "max.muster@example.com",
        "deliver_gender": "female",
        "deliver_title": "",
        "deliver_firstname": "Ella",
        "deliver_lastname": "Example",
        "deliver_company": "",
        "deliver_addrextra": "",
        "deliver_street": "Sample Street",
        "deliver_housenr": "1b",
        "deliver_zip": "22222",
        "deliver_town": "Hamburg",
        "deliver_country": "DE",
        "currency": "EUR",
        "total_netto": "144.9600",
        "total_brutto": "172.5000",
        "drvd_total_vat": "27.54",
        "quantity": "1.0000",
        "o_time_ordered": "2022-06-16 16:16:16",
        "orderitems": [
            {
                "oi_pcode": "M00000001",                       // The SKU for this item in the marketplace
                "oi_name": "Merchant Example 345",             // Human readable name
                "oi_quantity": "1.0000",                       // Quantity ordered
                "oi_vat_pct": "19.00",                         // VAT percentage
                "drvd_oi_price_single_brutto": "172.5000",     // Single Price incl. VAT for this item 
                "drvd_oi_total_brutto": "172.50",              // Total Price incl. VAT for this item
                "drvd_variant_specification": "",               
                "base_color": null,
                "oi_qty_shipped": "0.0000",                    // Quantity that is already confirmed as shipped
                "oi_qty_returned": "0.0000",                   // Quantity that is already confirmed as returned
                "prcmrch_pcode_merchant": "MM345",             // The SKU for this item in your system
                "prcmrch_condition": "",
            }
        ]
    }
}

Response - Error

If your request failed, you receive a message detailing the error that occurred.

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Order not found."
        }
    ]
}

 

Confirm shipment

Once you ship out the order, you have to confirm that you did.
You can do this either for the complete order or by specifying the items, if multiple shipments are required,

Single delivery

Request URL

https://{your hublify url}/api/merchant_10/order_createDelivery

Request parameter

You need the Hublify internal orderid and should specify the carrier and trackingcode for the delivery.
If no items are provided, all not yet delivered items of this order will be assumed.

{
    "filter": {
        "orderid": "A00003135-MRCH00002"
    },
    "fields": {
        "shp_c_label": "dhl",             // Shipping carrier, you used: e.g.: "dhl","ups","dpd","hermes","gls" 
        "dv_extcode": "DHLTRKMRCH1234",   // The tracking code for this delivery
        "dv_time_sent": null              // Default: current time. You can specify the time you sent it in the Format: "Y-m-d H:i:s"
    }
}

Response

If your request was successful, you receive a success-message

{
    "status": true,
    "msg": [
        {
            "type": "OK",
            "text": "Delivery successfully created for order."
        }
    ]
}

Response - Error

If your request failed, you receive an error or warning message.

{
    "status": true,
    "msg": [
        {
            "type": "WARNING",
            "text": "This order is already marked as shipped."
        }
    ]
}

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Order not found."
        }
    ]
}

Multiple partial deliveries

Request URL

https://{your hublify url}/api/merchant_10/order_createDelivery

Request parameter

If you send out the order in multiple partial deliveries, you need to provide details about the items included in each delivery.
Send an "order_createDelivery" request for each delivery.

{
    "filter": {
        "orderid": "A00003135-MRCH00002"
    },
    "fields": {
        "shp_c_label": "dhl",              // Shipping carrier 
        "dv_extcode": "TRKMRCHPART1",      // The tracking code for this delivery
        "dv_time_sent": null,              // Default: current time. Format: "Y-m-d H:i:s",
        "items": [                         // mandatory for partial delivery 
            {
                "dvi_cnt": 1,              // Quantity of this item included in this specific delivery
                "dvi_pcode": "M00000001"   // The SKU for this item in the marketplace
            }
        ]
    }
}

Response

If your request was successful, you receive a success-message

{
    "status": true,
    "msg": [
        {
            "type": "OK",
            "text": "Delivery successfully created for order."
        }
    ]
}

Response - Error

If your request failed, you receive an error or warning message.

{
    "status": true,
    "msg": [
        {
            "type": "WARNING",
            "text": "This order is already marked as shipped."
        }
    ]
}

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Some pcodes or quantities could not be matched to unshipped items in this order."
        }
    ],
    "data": {
        "unmatched": {
            "M000000X1": 8     // these SKUs and quantities could not be matched,
                               // either because the SKU-code couldn't be found
                               // or because the quantity was too high
        }
    }
}