2.3.6.Order creation

The order_push_url added to the store data request is used to push the order update to. For every update, a POST to the order_push_url will be processed.

The order data is pushed as JSON, following the structure below. Before accepting the order data, the request should be validated by matching the provided and calculated signature/hash. The signature/hash needs to be calculated like:

1) base64 decode the Auth header
2) explode/split the resulting string using the colon as the separator
3) the first part is the timestamp, the second part is sha512hex of the payload
4) concatenate timestamp, colon, and payload and calculate hmac/sha512 using API key* as the HMAC key
5) allow the request if the signature matches and the timestamp is fresh enough

*the API Key described is your MultiSafepay API key:

*Its recommended to only create an order on transaction status “completed”. This avoids unprocessed orders when people test qwindo.
Response

{ 
      "transaction_id":126207591,
      "order_id":"3e54d38ecf6d998940f8cb58805a6e88",
      "created":"2017-02-06T11:16:51",
      "currency":"EUR",
      "amount":4940,
      "description":"Bankoverboeking",
      "var1":null,
      "var2":null,
      "var3":null,
      "items":"<table border=\"0\" cellpadding=\"5\" width=\"100%\">\n<tr>\n<th width=\"10%\"><font size=\"2\" face=\"Verdana\">Quantity </font></th>\n<th align=\"left\"></th>\n<th align=\"left\"><font size=\"2\" face=\"Verdana\">Details </font></th>\n<th width=\"19%\" align=\"right\"><font size=\"2\" face=\"Verdana\">Price </font></th>\n</tr>\n<tr>\n<td align=\"center\"><font size=\"2\" face=\"Verdana\">3</font></td>\n<td width=\"6%\"></td>\n<td width=\"65%\"><font size=\"2\" face=\"Verdana\">Burlington Blackpool Herensok 21023</font></td>\n<td align=\"right\">&#8364;<font size=\"2\" face=\"Verdana\">5.37</font>\n</td>\n</tr>\n<tr>\n<td align=\"center\"><font size=\"2\" face=\"Verdana\">2</font></td>\n<td width=\"6%\"></td>\n<td width=\"65%\"><font size=\"2\" face=\"Verdana\">FALKE Colour Block Fantasiesok Heren 13311</font></td>\n<td align=\"right\">&#8364;<font size=\"2\" face=\"Verdana\">6.61</font>\n</td>\n</tr>\n<tr>\n<td align=\"center\"><font size=\"2\" face=\"Verdana\">1</font></td>\n<td width=\"6%\"></td>\n<td width=\"65%\"><font size=\"2\" face=\"Verdana\">FALKE Lhasa Effect Stripe Sok 15352</font></td>\n<td align=\"right\">&#8364;<font size=\"2\" face=\"Verdana\">8.26</font>\n</td>\n</tr>\n<tr bgcolor=\"#E9F1F7\">\n<td colspan=\"3\" align=\"right\"><font size=\"2\" face=\"Verdana\">\n\t\t\t\t\t\t\tShipping:\n\t\t\t\t\t\t\tBest Way - Table Rate</font></td>\n<td align=\"right\">&#8364;<font size=\"2\" face=\"Verdana\">3.90</font>\n</td>\n</tr>\n<tr bgcolor=\"#E9F1F7\">\n<td colspan=\"3\" align=\"right\"><font size=\"2\" face=\"Verdana\">VAT:</font></td>\n<td align=\"right\">&#8364;<font size=\"2\" face=\"Verdana\">7.90</font>\n</td>\n</tr>\n<tr bgcolor=\"#E9F1F7\">\n<td colspan=\"3\" align=\"right\"><font size=\"2\" face=\"Verdana\">Total:</font></td>\n<td align=\"right\">&#8364;<font size=\"2\" face=\"Verdana\">49.40</font>\n</td>\n</tr>\n</table>",
      "amount_refunded":0,
      "status":"initialized",
      "financial_status":"initialized",
      "reason":"",
      "reason_code":"",
      "fastcheckout":"YES",
      "modified":"2017-02-06T11:16:51",
      "customer":{ 
         "locale":"nl_NL",
         "first_name":"Test",
         "last_name":"Test",
         "address1":"Kraanspoor",
         "address2":null,
         "house_number":" 9",
         "zip_code":"1033 SC",
         "city":"Amsterdam",
         "state":null,
         "country":"NL",
         "country_name":null,
         "phone1":null,
         "phone2":"",
         "email":"demo@multisafepay.com"
      },
      "delivery":{ 
         "first_name":"",
         "last_name":"",
         "address1":"",
         "address2":null,
         "address3":null,
         "house_number":,
         "zip_code":"1032 LG",
         "city":"Amsterdam",
         "state":null,
         "country":"NL",
         "country_name":"Netherlands",
         "phone1":null,
         "phone2":null,
         "email":""
      },
      "payment_details":{ 
         "recurring_id":null,
         "type":"BANKTRANS",
         "account_id":null,
         "account_holder_name":"",
         "external_transaction_id":"1170361262075910"
      },
      "shopping_cart":{ 
         "items":[ 
            { 
               "name":"Demo product 1",
               "description":"",
               "unit_price":"5.3719000000",
               "currency":"EUR",
               "quantity":3,
               "merchant_item_id":10,
               "tax_table_selector":"NL21",
               "cashback":"",
               "image":"",
               "weight":{ 
                  "unit":null,
                  "value":null
               },
               "options":[ 
 
               ]
            },
            { 
               "name":"Demo product 2",
               "description":"",
               "unit_price":"6.6116000000",
               "currency":"EUR",
               "quantity":2,
               "merchant_item_id":2,
               "tax_table_selector":"NL21",
               "cashback":"",
               "image":"",
               "weight":{ 
                  "unit":null,
                  "value":null
               },
               "options":[ 
 
               ]
            },
            { 
               "name":"Demo product 3",
               "description":"",
               "unit_price":"8.2645000000",
               "currency":"EUR",
               "quantity":1,
               "merchant_item_id":8,
               "tax_table_selector":"NL21",
               "cashback":"",
               "image":"",
               "weight":{ 
                  "unit":null,
                  "value":null
               },
               "options":[ 
 
               ]
            }
         ]
      },
      "checkout_options":{ 
         "default":[ 
 
         ],
         "alternate":[ 
            { 
               "standalone":"",
               "name":"NL21",
               "rules":[ 
                  { 
                     "rate":"0.2100000000",
                     "country":null
                  }
               ]
            },
            { 
               "standalone":"",
               "name":"NL21",
               "rules":[ 
                  { 
                     "rate":"0.2100000000",
                     "country":null
                  }
               ]
            },
            { 
               "standalone":"",
               "name":"NL21",
               "rules":[ 
                  { 
                     "rate":"0.2100000000",
                     "country":null
                  }
               ]
            }
         ]
      },
      "order_adjustment":{ 
         "shipping":{ 
            "flat_rate_shipping":{ 
               "name":"Best Way - Table Rate",
               "cost":"3.90"
            }
         },
         "total_adjustment":"11.80",
         "total_tax":"7.90"
      },
      "order_total":"49.40",
      "costs":[ 
         { 
            "transaction_id":150458421,
            "description":"0.39 BANKTRANSFER",
            "type":"SYSTEM",
            "amount":0.39
         },
         { 
            "transaction_id":150458420,
            "description":"Bankoverboeking",
            "type":"INTERNAL",
            "amount":49.4
         }
      ]
   }
Suggest Edit