Amazon Yojaka API Returns Model

ReturnsListingRetrieval

getReturn

Returns a single return

Use this API to retrieve complete details about a single return, given the return's id.


/returns/{id}

Usage and SDK Samples

curl -X GET "https://api.sandbox.dub.yojaka.xp.sellers.a2z.com/v1/returns/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ReturnsListingRetrievalApi;

import java.io.File;
import java.util.*;

public class ReturnsListingRetrievalApiExample {

    public static void main(String[] args) {
        
        ReturnsListingRetrievalApi apiInstance = new ReturnsListingRetrievalApi();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        String id = id_example; // String | The return's Amazon Yojaka assigned id.
        try {
            ReturnItem result = apiInstance.getReturn(xAmzAccessToken, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsListingRetrievalApi#getReturn");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ReturnsListingRetrievalApi;

public class ReturnsListingRetrievalApiExample {

    public static void main(String[] args) {
        ReturnsListingRetrievalApi apiInstance = new ReturnsListingRetrievalApi();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        String id = id_example; // String | The return's Amazon Yojaka assigned id.
        try {
            ReturnItem result = apiInstance.getReturn(xAmzAccessToken, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsListingRetrievalApi#getReturn");
            e.printStackTrace();
        }
    }
}
String *xAmzAccessToken = xAmzAccessToken_example; // The LWA access token for authorizing the request
String *id = id_example; // The return's Amazon Yojaka assigned id.

ReturnsListingRetrievalApi *apiInstance = [[ReturnsListingRetrievalApi alloc] init];

// Returns a single return
[apiInstance getReturnWith:xAmzAccessToken
    id:id
              completionHandler: ^(ReturnItem output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AmazonYojakaApiReturnsModel = require('amazon_yojaka_api_returns_model');

var api = new AmazonYojakaApiReturnsModel.ReturnsListingRetrievalApi()
var xAmzAccessToken = xAmzAccessToken_example; // {{String}} The LWA access token for authorizing the request
var id = id_example; // {{String}} The return's Amazon Yojaka assigned id.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getReturn(xAmzAccessToken, id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getReturnExample
    {
        public void main()
        {

            var apiInstance = new ReturnsListingRetrievalApi();
            var xAmzAccessToken = xAmzAccessToken_example;  // String | The LWA access token for authorizing the request
            var id = id_example;  // String | The return's Amazon Yojaka assigned id.

            try
            {
                // Returns a single return
                ReturnItem result = apiInstance.getReturn(xAmzAccessToken, id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ReturnsListingRetrievalApi.getReturn: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiReturnsListingRetrievalApi();
$xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
$id = id_example; // String | The return's Amazon Yojaka assigned id.

try {
    $result = $api_instance->getReturn($xAmzAccessToken, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ReturnsListingRetrievalApi->getReturn: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ReturnsListingRetrievalApi;

my $api_instance = WWW::SwaggerClient::ReturnsListingRetrievalApi->new();
my $xAmzAccessToken = xAmzAccessToken_example; # String | The LWA access token for authorizing the request
my $id = id_example; # String | The return's Amazon Yojaka assigned id.

eval { 
    my $result = $api_instance->getReturn(xAmzAccessToken => $xAmzAccessToken, id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ReturnsListingRetrievalApi->getReturn: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ReturnsListingRetrievalApi()
xAmzAccessToken = xAmzAccessToken_example # String | The LWA access token for authorizing the request
id = id_example # String | The return's Amazon Yojaka assigned id.

try: 
    # Returns a single return
    api_response = api_instance.get_return(xAmzAccessToken, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReturnsListingRetrievalApi->getReturn: %s\n" % e)

Parameters

Path parameters
Name Description
id*
String
The return's Amazon Yojaka assigned id.
Required
Header parameters
Name Description
X-Amz-Access-Token*
String
The LWA access token for authorizing the request
Required

Responses

Status: 200 - Success. The response contains details of a single return.

{

Contains information about an return that is being processed by Amazon SmartConnect.

Required: fulfillmentLocationId,id,lastUpdatedTimestamp,returnMarketplaceChannelDetails,returnMetadata,returnShippingInfo,returnStatus,returnType
id:
string

The return's id. This id is assigned by Amazon SmartConnect.

example: 8bdc492b-8bf4-44c6-938f-7b97867e418f
merchantSku:
string

The seller's identifier for the SKU.

example: MSKU1
numberOfUnits:
integer minimum:1

Total number of units in the return.

example: 5
returnType:
string

Contains the return type.

Enum: CUSTOMER, REJECT, RETURNLESS
example: CUSTOMER
returnStatus:
string

The current status of the return.

Enum: CREATED, CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER, CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER, CUSTOMER_CANCELLED_PICK_UP, CUSTOMER_RESCHEDULED_PICK_UP, PICKED_FROM_CUSTOMER, IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, REJECTED, CANCELLED
example: ACCEPTED
fulfillmentLocationId:
string

Id of the fullfillment Location for which return was placed

example: 41179z94-2bdc-461b-a8aa-aa7kzd6365z5
returnLocationId:
string

The Amazon SmartConnect id of the location to which this return is dropped.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
returnMetadata:
{

Metadata about the return.

Required: fulfillmentOrderId,returnReason
returnReason:
string

The reason for the item to get returned

fulfillmentOrderId:
string

SmartConnect ID of the fullfillment order for which return was placed

example: 4e66ead7-d2e1-45ff-a7fe-2dece27e4b64
rmaId:
string

RMA Id of return

example: DnPkxvqqRRMA
invoiceInfo:
{

Invoice related information for the return dropped to Amazon SmartConnect.

Required: id
id:
}
}
creationTimestamp:
integer (int64)

The number of milliseconds since epoch in UTC when the return was created.

example: 1604923992000
lastUpdatedTimestamp:
integer (int64)

The number of milliseconds since epoch in UTC when the return was last updated.

example: 1563848475634
returnShippingInfo:
{

Information about the shipment of the return packages.

deliveryTimestamp:
integer (int64)

The timestamp (in UTC) at which the marketplace/channel the order was delievered to seller.

example: 1569834371226
pickupTimestamp:
integer (int64)

The timestamp (in UTC) at which the marketplace/channel picked up the return

example: 1569834371226
forwardTrackingInfo:
{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
trackingId:
}
reverseTrackingInfo:
{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
trackingId:
}
}
returnMarketplaceChannelDetails:
{

Marketplace Channel specific custom attributes for the return. These attributes are not mandatory and each channel can provide it differently. Connectors can read them based on the type provided to parse the value.

marketplaceChannel:
{

Provides details about the marketplace and the channel.

Required: marketplaceName
marketplaceName:
channelName:
}
merchantId:
string

The id, in the marketplace, of the merchant or seller whom this return is dropped to

example: ABCDEFGH
shipmentId:
string

The marketplace specific shipment id.

example: 852f17e1-105d-4374-8198-ec87a9afe56d
customerOrderId:
string

The marketplace specific customer's order id

example: 13ERT3241KJ
returnLocationId:
string

The Amazon SmartConnect id of the location to which this return is dropped.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
channelSku:
string

The Amazon SmartConnect sku of the chanel.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
exchangeOrderId:
string

The marketplace id of exchange Order, This field is deprecated now.

example: 93DXT3241KZ
}
otpDetails:
{

OTP details of the return item

Required: otp,validTill
otp:
string

One time password to validate the return delivered to the seller.

example: 703669
validTill:
integer (int64)

The number of milliseconds since epoch in UTC till when the verification code is valid.

example: 1569834371226
}
returnedWithOTP:
boolean

A boolean value indicating if the return has been delivered with an OTP.

example: true
replanned:
boolean

A boolean value indicating if the return had been replanned.

example: true
replacement:
boolean

A boolean value indicating if the return is of replacement type.

example: true
exchange:
boolean

A boolean value indicating if the return is of exchange type.

example: true
previousTrackingInfo:
[ (1..∞)

A list of all the previous tracking information for the return.

{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
string

The name of the 3P courier service used to ship the package.

trackingId:
string

The tracking id of the package.

}
]
}

Status: 400 - Bad request. The response contains the error details.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 401 - Unauthorized. You are not authorized to invoke this API for the given parameters.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 404 - Not found. The specified return id is not found.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 500 - Internal server error. Contact Amazon support for assistance.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 503 - Service unavailable. Retry the request after some time.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

listReturns

Returns a list of active/open returns

Invoke this API to get a list of returns. This API returns data in pages.


/returns

Usage and SDK Samples

curl -X GET "https://api.sandbox.dub.yojaka.xp.sellers.a2z.com/v1/returns?returnLocationId=&returnStatus=&fromTimestamp=&toTimestamp=&cursor=&maxResults="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ReturnsListingRetrievalApi;

import java.io.File;
import java.util.*;

public class ReturnsListingRetrievalApiExample {

    public static void main(String[] args) {
        
        ReturnsListingRetrievalApi apiInstance = new ReturnsListingRetrievalApi();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        String returnLocationId = returnLocationId_example; // String | The location id for which returns need to be listed.
        String returnStatus = returnStatus_example; // String | Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.

        String fromTimestamp = fromTimestamp_example; // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
        String toTimestamp = toTimestamp_example; // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
        String cursor = cursor_example; // String | The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns.
        Integer maxResults = 56; // Integer | Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10.
        try {
            ListReturnsOutput result = apiInstance.listReturns(xAmzAccessToken, returnLocationId, returnStatus, fromTimestamp, toTimestamp, cursor, maxResults);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsListingRetrievalApi#listReturns");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ReturnsListingRetrievalApi;

public class ReturnsListingRetrievalApiExample {

    public static void main(String[] args) {
        ReturnsListingRetrievalApi apiInstance = new ReturnsListingRetrievalApi();
        String xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
        String returnLocationId = returnLocationId_example; // String | The location id for which returns need to be listed.
        String returnStatus = returnStatus_example; // String | Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.

        String fromTimestamp = fromTimestamp_example; // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
        String toTimestamp = toTimestamp_example; // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
        String cursor = cursor_example; // String | The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns.
        Integer maxResults = 56; // Integer | Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10.
        try {
            ListReturnsOutput result = apiInstance.listReturns(xAmzAccessToken, returnLocationId, returnStatus, fromTimestamp, toTimestamp, cursor, maxResults);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsListingRetrievalApi#listReturns");
            e.printStackTrace();
        }
    }
}
String *xAmzAccessToken = xAmzAccessToken_example; // The LWA access token for authorizing the request
String *returnLocationId = returnLocationId_example; // The location id for which returns need to be listed. (optional)
String *returnStatus = returnStatus_example; // Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.
 (optional)
String *fromTimestamp = fromTimestamp_example; // Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone. (optional)
String *toTimestamp = toTimestamp_example; // Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone. (optional)
String *cursor = cursor_example; // The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns. (optional)
Integer *maxResults = 56; // Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10. (optional)

ReturnsListingRetrievalApi *apiInstance = [[ReturnsListingRetrievalApi alloc] init];

// Returns a list of active/open returns
[apiInstance listReturnsWith:xAmzAccessToken
    returnLocationId:returnLocationId
    returnStatus:returnStatus
    fromTimestamp:fromTimestamp
    toTimestamp:toTimestamp
    cursor:cursor
    maxResults:maxResults
              completionHandler: ^(ListReturnsOutput output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AmazonYojakaApiReturnsModel = require('amazon_yojaka_api_returns_model');

var api = new AmazonYojakaApiReturnsModel.ReturnsListingRetrievalApi()
var xAmzAccessToken = xAmzAccessToken_example; // {{String}} The LWA access token for authorizing the request
var opts = { 
  'returnLocationId': returnLocationId_example, // {{String}} The location id for which returns need to be listed.
  'returnStatus': returnStatus_example, // {{String}} Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.

  'fromTimestamp': fromTimestamp_example, // {{String}} Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
  'toTimestamp': toTimestamp_example, // {{String}} Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
  'cursor': cursor_example, // {{String}} The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns.
  'maxResults': 56 // {{Integer}} Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listReturns(xAmzAccessToken, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listReturnsExample
    {
        public void main()
        {

            var apiInstance = new ReturnsListingRetrievalApi();
            var xAmzAccessToken = xAmzAccessToken_example;  // String | The LWA access token for authorizing the request
            var returnLocationId = returnLocationId_example;  // String | The location id for which returns need to be listed. (optional) 
            var returnStatus = returnStatus_example;  // String | Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.
 (optional) 
            var fromTimestamp = fromTimestamp_example;  // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone. (optional) 
            var toTimestamp = toTimestamp_example;  // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone. (optional) 
            var cursor = cursor_example;  // String | The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns. (optional) 
            var maxResults = 56;  // Integer | Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10. (optional) 

            try
            {
                // Returns a list of active/open returns
                ListReturnsOutput result = apiInstance.listReturns(xAmzAccessToken, returnLocationId, returnStatus, fromTimestamp, toTimestamp, cursor, maxResults);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ReturnsListingRetrievalApi.listReturns: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiReturnsListingRetrievalApi();
$xAmzAccessToken = xAmzAccessToken_example; // String | The LWA access token for authorizing the request
$returnLocationId = returnLocationId_example; // String | The location id for which returns need to be listed.
$returnStatus = returnStatus_example; // String | Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.

$fromTimestamp = fromTimestamp_example; // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
$toTimestamp = toTimestamp_example; // String | Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
$cursor = cursor_example; // String | The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns.
$maxResults = 56; // Integer | Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10.

try {
    $result = $api_instance->listReturns($xAmzAccessToken, $returnLocationId, $returnStatus, $fromTimestamp, $toTimestamp, $cursor, $maxResults);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ReturnsListingRetrievalApi->listReturns: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ReturnsListingRetrievalApi;

my $api_instance = WWW::SwaggerClient::ReturnsListingRetrievalApi->new();
my $xAmzAccessToken = xAmzAccessToken_example; # String | The LWA access token for authorizing the request
my $returnLocationId = returnLocationId_example; # String | The location id for which returns need to be listed.
my $returnStatus = returnStatus_example; # String | Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.

my $fromTimestamp = fromTimestamp_example; # String | Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
my $toTimestamp = toTimestamp_example; # String | Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
my $cursor = cursor_example; # String | The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns.
my $maxResults = 56; # Integer | Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10.

eval { 
    my $result = $api_instance->listReturns(xAmzAccessToken => $xAmzAccessToken, returnLocationId => $returnLocationId, returnStatus => $returnStatus, fromTimestamp => $fromTimestamp, toTimestamp => $toTimestamp, cursor => $cursor, maxResults => $maxResults);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ReturnsListingRetrievalApi->listReturns: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ReturnsListingRetrievalApi()
xAmzAccessToken = xAmzAccessToken_example # String | The LWA access token for authorizing the request
returnLocationId = returnLocationId_example # String | The location id for which returns need to be listed. (optional)
returnStatus = returnStatus_example # String | Use this parameter to filter returns in a particular state. A use-case would be to fetch all new
returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.
 (optional)
fromTimestamp = fromTimestamp_example # String | Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone. (optional)
toTimestamp = toTimestamp_example # String | Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone. (optional)
cursor = cursor_example # String | The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns. (optional)
maxResults = 56 # Integer | Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10. (optional)

try: 
    # Returns a list of active/open returns
    api_response = api_instance.list_returns(xAmzAccessToken, returnLocationId=returnLocationId, returnStatus=returnStatus, fromTimestamp=fromTimestamp, toTimestamp=toTimestamp, cursor=cursor, maxResults=maxResults)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReturnsListingRetrievalApi->listReturns: %s\n" % e)

Parameters

Header parameters
Name Description
X-Amz-Access-Token*
String
The LWA access token for authorizing the request
Required
Query parameters
Name Description
returnLocationId
String
The location id for which returns need to be listed.
returnStatus
String
Use this parameter to filter returns in a particular state. A use-case would be to fetch all new returns from Amazon Yojaka using the CUSTOMER_CANCELLED_PICK_UP returnStatus.
fromTimestamp
String
Use this parameter to filter returns whose latest update in Amazon Yojaka is after a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
toTimestamp
String
Use this parameter to filter returns whose latest update in Amazon Yojaka is before a particular date/time. The value is specified as the number of milliseconds since epoch in the UTC timezone.
cursor
String
The cursor value returned from a previous call to list returns. Use this to retrieve the next page of returns.
maxResults
Integer
Specify the maximum number of returns that are to be returned in the response. If omitted, this parameter defaults to 10.

Responses

Status: 200 - Success. The response contains a list of returns.

{

An object containing a list of returns. This is returned when returns are listed against a certain query. Note that all fields of the returned return are populated.

Required: returns
returns:
[

A list of returns.

{

Contains information about an return that is being processed by Amazon SmartConnect.

Required: fulfillmentLocationId,id,lastUpdatedTimestamp,returnMarketplaceChannelDetails,returnMetadata,returnShippingInfo,returnStatus,returnType
id:
string

The return's id. This id is assigned by Amazon SmartConnect.

example: 8bdc492b-8bf4-44c6-938f-7b97867e418f
merchantSku:
string

The seller's identifier for the SKU.

example: MSKU1
numberOfUnits:
integer minimum:1

Total number of units in the return.

example: 5
returnType:
string

Contains the return type.

Enum: CUSTOMER, REJECT, RETURNLESS
example: CUSTOMER
returnStatus:
string

The current status of the return.

Enum: CREATED, CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER, CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER, CUSTOMER_CANCELLED_PICK_UP, CUSTOMER_RESCHEDULED_PICK_UP, PICKED_FROM_CUSTOMER, IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, REJECTED, CANCELLED
example: ACCEPTED
fulfillmentLocationId:
string

Id of the fullfillment Location for which return was placed

example: 41179z94-2bdc-461b-a8aa-aa7kzd6365z5
returnLocationId:
string

The Amazon SmartConnect id of the location to which this return is dropped.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
returnMetadata:
{

Metadata about the return.

Required: fulfillmentOrderId,returnReason
returnReason:
string

The reason for the item to get returned

fulfillmentOrderId:
string

SmartConnect ID of the fullfillment order for which return was placed

example: 4e66ead7-d2e1-45ff-a7fe-2dece27e4b64
rmaId:
string

RMA Id of return

example: DnPkxvqqRRMA
invoiceInfo:
{

Invoice related information for the return dropped to Amazon SmartConnect.

Required: id
id:
string

The unique id of invoice corresponding to this return.

example: QESR-3245
}
}
creationTimestamp:
integer (int64)

The number of milliseconds since epoch in UTC when the return was created.

example: 1604923992000
lastUpdatedTimestamp:
integer (int64)

The number of milliseconds since epoch in UTC when the return was last updated.

example: 1563848475634
returnShippingInfo:
{

Information about the shipment of the return packages.

deliveryTimestamp:
integer (int64)

The timestamp (in UTC) at which the marketplace/channel the order was delievered to seller.

example: 1569834371226
pickupTimestamp:
integer (int64)

The timestamp (in UTC) at which the marketplace/channel picked up the return

example: 1569834371226
forwardTrackingInfo:
{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
string

The name of the 3P courier service used to ship the package.

trackingId:
string

The tracking id of the package.

}
reverseTrackingInfo:
{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
string

The name of the 3P courier service used to ship the package.

trackingId:
string

The tracking id of the package.

}
}
returnMarketplaceChannelDetails:
{

Marketplace Channel specific custom attributes for the return. These attributes are not mandatory and each channel can provide it differently. Connectors can read them based on the type provided to parse the value.

marketplaceChannel:
{

Provides details about the marketplace and the channel.

Required: marketplaceName
marketplaceName:
string

The name of the marketplace.

example: AMAZON_IN
channelName:
string

The name of the channel within the marketplace.

example: FBA
}
merchantId:
string

The id, in the marketplace, of the merchant or seller whom this return is dropped to

example: ABCDEFGH
shipmentId:
string

The marketplace specific shipment id.

example: 852f17e1-105d-4374-8198-ec87a9afe56d
customerOrderId:
string

The marketplace specific customer's order id

example: 13ERT3241KJ
returnLocationId:
string

The Amazon SmartConnect id of the location to which this return is dropped.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
channelSku:
string

The Amazon SmartConnect sku of the chanel.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
exchangeOrderId:
string

The marketplace id of exchange Order, This field is deprecated now.

example: 93DXT3241KZ
}
otpDetails:
{

OTP details of the return item

Required: otp,validTill
otp:
string

One time password to validate the return delivered to the seller.

example: 703669
validTill:
integer (int64)

The number of milliseconds since epoch in UTC till when the verification code is valid.

example: 1569834371226
}
returnedWithOTP:
boolean

A boolean value indicating if the return has been delivered with an OTP.

example: true
replanned:
boolean

A boolean value indicating if the return had been replanned.

example: true
replacement:
boolean

A boolean value indicating if the return is of replacement type.

example: true
exchange:
boolean

A boolean value indicating if the return is of exchange type.

example: true
previousTrackingInfo:
[ (1..∞)

A list of all the previous tracking information for the return.

{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
string

The name of the 3P courier service used to ship the package.

trackingId:
string

The tracking id of the package.

}
]
}
]
cursor:
string

A cursor representing information about the next page of returns that should be returned on subsequent calls. Use this value to page through the complete list of returns.

}

Status: 400 - Bad request. The response contains the error details.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 401 - Unauthorized. You are not authorized to invoke this API for the given parameters.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 500 - Internal server error. Contact Amazon support for assistance.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}

Status: 503 - Service unavailable. Retry the request after some time.

{

Represents information about an error/exception that occurred with an API call to Amazon Yojaka.

Required: errorCode,errorDescription,retryable
errorCode:
string

A unique Amazon Yojaka error code assigned to each class of errors.

example: SC_00001
errorDescription:
string

A human-readable description of the error.

example: A temporary failure occurred in the Amazon Yojaka product.
retryable:
boolean

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

}