Calling the orders Hook

To register an order, a POST call must be made to the Naiz Fit URL enabled for the reception of orders.

https://backend.production.naiz.fit/api/partners/hook/DOMAIN/HASH

Important

You must replace the "DOMAIN" element of the url with your full domain (e.g. www.example.com). You must replace the "HASH" element of the Partner Hash for your online shop (e.g. 12345678123412341234123412341234).

Body and Format

The "body" of the request must be a valid JSON text containing the orders data to be registered.

Structure

The JSON structure can be agreed with Naiz Fit to adapt it to your needs as long as the non-optional data is maintained. We propose the following structure:

Field Type Description
date String Date the order was placed.
consumerHash String Naiz Fit identifier of the ordering customer if any (stored in the COOKIE or in the LOCALSTORAGE variable "naiz_consumer_hash" of the browser when a size recommendation has been made).
partnerHash String Partner Key provided by Naiz Fit to the merchant.
domain String Full domain from which the order is placed
currency String Identifier code of the currency in which the order was placed
status Ìnt Order status (0: New, 1: Processed, 2: Shipped).
total Double Total order price
subtotal Double Optional. Subtotal price of the order.
taxes Double Optional. Taxes.
shipping Double Optional. Delivery price.
discount Double Optional. Discounts.
internalRef String Internal order reference.
internalCartRef String Internal order cart reference.
lines Line[] List of objects of type Line with the information of each of the products of the order.

Structure of the "Line" object

Field Type Description
internalRef String Internal reference identifying the product.
productName String Product name
naizCode String Optional. Product Naiz Fit code
quantity Int Number of products ordered for this model.
price Double Product prize.
size String Purchased product size.

Example:

{
  "date": "2020-06-01 12:34:56",
  "consumerHash": "XXXX-XXXX-XXXX-XXXX-XXXX",
  "partnerHash": "XXXX-XXXX-XXXX-XXXX-XXXX",
  "domain": "www.dominio.com",
  "internalRef": "REF0001",
  "internalCartRef": "CART0001",
  "status": 1,
  "total": 30.0,
  "subtotal": 27.5,
  "currency": "EUR",
  "lines": [
    {
      "internalRef": "PRODUCTO01",
      "productName": "Superior quality product",
      "naizCode": null,
      "quantity": 1,
      "price": 12.5,
      "size": "XL"
    },
    {
      "internalRef": "PRODUCTO02",
      "productName": "Most superior quality product",
      "naizCode": null,
      "quantity": 2,
      "price": 10.99,
      "size": "L"
    }
  ]
}

Result

In case the registration has been satisfactory, a result with code http 200 will be received.