Returns Label Generation API

The Returns Label API is a RESTful service focused on creating return shipping labels. By receiving specific order details as input, this API generates a shipping label and provides a link for accessing it. End users can also obtain the shipping label through a unique link that is included in the API's output.
Operations
POST /api/v1/returns/labels/generate
GET /api/v1/returns/labels/{return_reference_number}
Generate Return Labels API
POST https://ws.narvar.com/api/v1/returns/labels/generate

Authentication

BasicAuth

This API facilitate the creation of returns and the generation of corresponding shipping labels.

By accepting specific details about the order, such as the order number, and the return cart information, it is able to produce a shipping label.

The required customer information is derived from the order details, which are integrated with Narvar, either through a custom Order Management System (OMS) or an Order API ingestion process.

Should the return label creation be successful, the response from the API will contain a link to access the shipping label. Conversely, if the label generation fails due to particular reasons, the API will provide appropriate error messages

Service Endpoints

Authentication The REST API requests are sent over TLS and secured by HTTP Basic Authentication.

Request body

application/json

Please refer to the “Request” link for more information.

Examples
{
  "order_number": "784313102",
  "rma_number": "1000000641",
  "carrier": "fedex",
  "billing_zip": "221212",
  "email": "abc@narvar.com",
  "order_items": [
    {
      "quantity": "1",
      "sku": "190041535590",
      "return_reason_code": "SMSIZE",
      "return_reason_comment": "does not fit for"
    }
  ]
}

Responses

200 200

Success response

Body
application/json

Please refer to the “Response” link for more information.

Examples

Denotes an example of successful return

{
    "status": "SUCCESS",
    "messages": [
        {
            "code": "response.status.success",
            "message": "Label Returned"
        }
    ],
    "return_reference_number": "J08eGNjJPkKNwq49",
    "order_number": "00268003",
    "rma_number": "1000003089",
    "return_methods": [
        {
            "type": "MAIL",
            "carrier": {
                "name": "UPS"
            },
            "label_url": "https://returns.narvar.com/returns/testretailer/viewlabel?return_id=J08eGNjJPkKNwq49",
            "tracking_number": "1Z301Y939007701991",
            "tracking_url": "https://tracking.narvar.com/testretailer/tracking/ups?tracking_numbers=1Z301Y939007701991&order_number=testorder&type=ret&locale=en_US",
            "qr_code_url": "https://s3/qrcode/b07af26a-b208-4e83-b3f6-544a33422f9.jpg"
        }
    ]
}
400 400

Bad request. Params are missing or invalid.

Body
application/json
Examples

Denotes an example of failed response return

{
  "status": "FAILURE",
  "messages": [
    {
      "code": "inv.request",
      "message": "Invalid Request. Params are missing."
    }
  ]
}
Basic
Advance

With mandatory attributes

curl -X POST "https://ws.narvar.com/api/v1/returns/labels/generate"  \
--header 'Authorization: Basic AYFQYTASJJATYNA61S881S81='
--header "Content-Type: application/json"  \
--d '{
    "order_number": "1221211",
    "order_items": [
        {
            "quantity": 1,
            "return_reason_code": "TEST",
            "sku": "12312123"
        }
    ]
}'

With All values

curl 'https://returns.narvar.com/api/v1/returns/labels/generate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic AADDAG=' \
--d '{
    "order_number": "784313102",
    "rma_number": "1000000641",
    "carrier": "fedex",
    "billing_zip": "221212",
    "order_items": [
      {
        "quantity": 1,
        "sku": "190041535590",
        "return_reason_code": "SMSIZE",
        "return_reason_comment": "does not fit for"
      }
    ]
  }'
Retrieve Label
GET https://ws.narvar.com/api/v1/returns/labels/{return_reference_number}

Authentication

BasicAuth

The purpose of this API is to fetch labels associated with orders that have been returned using Narvar’s platform.

The API requires the return_reference_number as input, serving as a unique identifier for locating the label.

The response from the API will provide a link that can be used to access the URL leading to the label.

Path variables

return_reference_number
string required

Request parameters

return_reference_number
string required

A unique return reference number from the narvar returns. e.g The unique return reference number from Narvar returns can be sourced through the Generate Return Labels API call

Responses

200 OK
Body
Examples
{
    "status": "SUCCESS",
    "messages": [
        {
            "code": "response.status.success",
            "message": "Label Returned"
        }
    ],
    "return_reference_number": "J08eGNjJPkKNwq49",
    "order_number": "00268003",
    "rma_number": "1000003089",
    "return_methods": [
        {
            "type": "MAIL",
            "carrier": {
                "name": "UPS"
            },
            "label_url": "https://returns.narvar.com/returns/testretailer/viewlabel?return_id=J08eGNjJPkKNwq49",
            "tracking_number": "1Z301Y939007701991",
            "tracking_url": "https://tracking.narvar.com/testretailer/tracking/ups?tracking_numbers=1Z301Y939007701991&order_number=testorder&type=ret&locale=en_US",
            "qr_code_url": "https://s3/qrcode/b07af26a-b208-4e83-b3f6-544a33422f9.jpg"
        }
    ]
}
400 400
Body
Definitions

Descriptions of the objects present in both the request and response data structures.

Request

This request encompasses order details, items within the order, RMA (Return Merchandise Authorization) specifications, and the justifications for the return.

Object
order_number
string required

The order number associated with the return.

Min length: 1
Max length: 50
rma_number
string nullable

The return merchandise authorization (RMA) number, that would be associated with the return created

Max length: 255
Default:
RA
carrier
string nullable

If the Rule method evaluation yields multiple carriers for the return method, the carrier value is then used as a filter criterion.

Enumeration:
ups
fedex
usps
dhl
billing_zip
string nullable

If the billing_zip is supplied, it will be cross-checked with the order information.

order_items
Array of OrderItem required

The items in the order to be returned.

OrderItem

Contains items that require return, accompanied by a justification for the return reason specified for each item

Object
quantity
number required

The quantity of the item to be returned.

item_id
string nullable

If the item is uniquely distinguished by its item_id, then this value must be provided.

Max length: 100
return_reason_code
string required

The code indicating the reason for the return. Retailer reason code as configured in the HUB

return_reason_comment
string nullable

User comments captured

Max length: 255
sku
string required

The SKU (stock keeping unit) identifier for this item.

Max length: 100
Types: Request
Response

The response confirms a successful/failure transaction, denoted by the status. Relevant details about the order, including a unique return order number and RMA number, are presented.

The response also provides methods for return, specifying the type and associated carrier. Additionally, provides URLs for return labels, tracking, and a QR code, as applicable.

Object
status
string

Status of response

Enumeration:
SUCCESS
FAILURE
messages
Array of Message

Arrays of resaons for the failure

return_reference_number
string

A unique Narvar return_reference_number which can be used to retrieve the label later.

order_number
string

Return order number. Should be same as passed in the request

rma_number
string

A distinct rma_number associated with the return. If provided in the request, it must correspond accurately

return_methods
Array of ReturnMethod
ReturnMethod
Object
properties
type
string

Carrier type for the return

Example:
MAIL
label_url
string

URL to access label.

Example:
https://returns-narvar.com/returns/retailer/viewlabel?return_id=gbZ1AoqzlP1QABRmO
tracking_number
string

Tracking number of the returns package(s).

tracking_url
string

URL to track return on Narvar experience.

qr_code_url
string

Link to the generated QR code. This will be populated only when retun method of type is evaluated to Printerless/QR code generation

carrier

Carrier details

additional properties
string
Types: Response
Carrier
Object
name
string

Name of the Carrier

Examples:
UPSFedEx
Types: ReturnMethod
Message
Object
code
string

Property constant that can be used for message localization

Enumeration:
invalid.return.label.order

Missing or Invalid Order number

invalid.return.label.items

Missing order items

invalid.return.label.items.sku

Missing/Invalid item sku

invalid.return.label.items.quantity

Missing/Invalid item quantity

message
string

Description of the error in English

ErrorResponse
Object
Example:
{
  "status": "FAILURE",
  "messages": [
    {
      "code": "inv.request",
      "message": "Invalid Request. Params are missing."
    }
  ]
}
status
string

Status value of the Error

Enumeration:
FAILURE
Example:
FAILURE
messages
Array of Message

JSON object array of type “messages”.