Calling the returns Hook

In order tu register a returns into the Naiz Fit system, a POST call must be done to the URL enabled by Naiz Fit for receiving returns information, which is as follows:

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 returns data to be registered.

Structure

The JSON must have and maintain the following data structure:

Field Type Description
date String Date of the return in the following format 'YYYY-MM-DD HH:mm:ss' (ej: '2020-31-12 10:00:00')
partnerHash String Partner Hash provided by Naiz Fit to the merchant.
domain String Full domain form which the return is being done.
internalRef String Order identifier previously registered.
status Ìnt Order status (0: New, 1: Processed)
total Double Quantity reimbursed in the same currency as the original order.
reason String Reason for the return.
size_reason Boolean true if the reason is due to a wrong size selected by the customer.
lines Line[] List of Line objects the information of each of the products returned.

Structure oif the Line object

Field Type Description
internalRef String Internal reference that identifies the product.
product_name String Name of the product.
naiz_code String Naiz Fit code for the product, failing that internal reference.
quantity Int Amount of products returned for this model.
reason String Reason for the return.
size_reason Boolean true f the reason is due to a wrong size selected by the customer.

Example:

{
  "date": "2020-06-01 12:34:56",
  "partnerHash": "XXXX-XXXX-XXXX-XXXX-XXXX",
  "domain": "www.dominio.com",
  "internalRef": "REF0001",
  "status": 1,
  "total": 30.0,
  "reason": "No le vale",
  "size_reason": true,
  "lines": [
    {
      "internalRef": "PRODUCTO01",
      "product_name": "Producto de Calidad superior",
      "naiz_code": "PRODUCTO01",
      "quantity": 1,
      "reason": "No le vale",
      "size_reason": true
    },
    {
      "internalRef": "PRODUCTO02",
      "product_name": "Producto de Calidad muy superior",
      "naiz_code": "PRODUCTO02",
      "quantity": 2,
      "reason": "No le gusta",
      "size_reason": false  
    }
  ]
}

Result

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