Amazon Yojaka Adapters API Returns Model

ReturnsManagement

createReturnItem

Create return

API to create a new return item in smart connect.


/returns

Usage and SDK Samples

curl -X POST "https://api.prod.dub.adapters.yojaka.xp.sellers.a2z.com/v1/returns"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ReturnsManagementApi;

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

public class ReturnsManagementApiExample {

    public static void main(String[] args) {
        
        ReturnsManagementApi apiInstance = new ReturnsManagementApi();
        CreateReturnItemInput body = ; // CreateReturnItemInput | The request body containing information about the return being created.
        try {
            CreateReturnItemOutput result = apiInstance.createReturnItem(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsManagementApi#createReturnItem");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ReturnsManagementApi;

public class ReturnsManagementApiExample {

    public static void main(String[] args) {
        ReturnsManagementApi apiInstance = new ReturnsManagementApi();
        CreateReturnItemInput body = ; // CreateReturnItemInput | The request body containing information about the return being created.
        try {
            CreateReturnItemOutput result = apiInstance.createReturnItem(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsManagementApi#createReturnItem");
            e.printStackTrace();
        }
    }
}
CreateReturnItemInput *body = ; // The request body containing information about the return being created.

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

// Create return
[apiInstance createReturnItemWith:body
              completionHandler: ^(CreateReturnItemOutput output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AmazonYojakaAdaptersApiReturnsModel = require('amazon_yojaka_adapters_api_returns_model');

var api = new AmazonYojakaAdaptersApiReturnsModel.ReturnsManagementApi()
var body = ; // {{CreateReturnItemInput}} The request body containing information about the return being created.

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

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

            var apiInstance = new ReturnsManagementApi();
            var body = new CreateReturnItemInput(); // CreateReturnItemInput | The request body containing information about the return being created.

            try
            {
                // Create return
                CreateReturnItemOutput result = apiInstance.createReturnItem(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ReturnsManagementApi.createReturnItem: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiReturnsManagementApi();
$body = ; // CreateReturnItemInput | The request body containing information about the return being created.

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

my $api_instance = WWW::SwaggerClient::ReturnsManagementApi->new();
my $body = WWW::SwaggerClient::Object::CreateReturnItemInput->new(); # CreateReturnItemInput | The request body containing information about the return being created.

eval { 
    my $result = $api_instance->createReturnItem(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ReturnsManagementApi->createReturnItem: $@\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.ReturnsManagementApi()
body =  # CreateReturnItemInput | The request body containing information about the return being created.

try: 
    # Create return
    api_response = api_instance.create_return_item(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReturnsManagementApi->createReturnItem: %s\n" % e)

Parameters

Body parameters
Name Description
body *
{

This object encapsulates all the data to be provided by an adapter to create a return from a marketplace/fulfilment channel into the Amazon Yojaka product. The return should only be created for an order that was fulfilled by SmartConnect.

Required: adapterAttributes,channelSku,creationTimestamp,marketplaceChannelName,merchantId,numberOfUnits,orderId,referenceId,returnReason,returnType,shipmentId
merchantId:
string

The id of the seller (merchant) for whom a return is being created. This is the id of the seller as registered in the marketplace that the adapter works with.

shipmentId:
string

The id of the shipment for the order being dropped as provided by the marketplace/fulfilment channel.

orderId:
string

The id of the order for which the return is being created.

referenceId:
string

A unique identifier at item level to identify return line items

marketplaceChannelName:
{

Provides details about the marketplace and the channel.

Required: marketplaceName
marketplaceName:
channelName:
}
returnLocationId:
string

The id of location where the return would be delivered back to

returnType:
string

The type of return to be created

Enum: CUSTOMER, REJECT
example: CUSTOMER
channelSku:
string

The SKU of the item in the particular marketplace/fulfilment channel.

example: 86675a94-2bdc-461b-a8aa-aa7abd6302f1
numberOfUnits:
integer (int32)

The number of units

returnReason:
string

The reason the return was created

exchangeOrderId:
string

The exchange order Id

rmaId:
string

The Return Merchandise Authorization (RMA) Id of the return to be created

creationTimestamp:
integer (int64)

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

example: 1563848475634
adapterAttributes:
{

Contains information for a particular adapter

Required: principal
principal:
id:
}
returnTrackingInfo:
{

Contains information for tracking a return.

Required: carrierName,trackingId
carrierName:
trackingId:
}
}

Responses

Status: 200 - Success. The return has been created

{

Contains the returnId of the return created

returnId:
string

The Id of the return created

}

Status: 400 - Bad request. One or more of the input parameters you have provided is invalid.

{

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.

}

updateReturnByTrackingId

Update Return By the TrackingId

This API is used to update the return details


/returns/update

Usage and SDK Samples

curl -X PUT "https://api.prod.dub.adapters.yojaka.xp.sellers.a2z.com/v1/returns/update?trackingId="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ReturnsManagementApi;

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

public class ReturnsManagementApiExample {

    public static void main(String[] args) {
        
        ReturnsManagementApi apiInstance = new ReturnsManagementApi();
        UpdateReturnByTrackingIdInput body = ; // UpdateReturnByTrackingIdInput | The request body containing information about the return being modified.
        String trackingId = trackingId_example; // String | The tracking Id of the return
        try {
            apiInstance.updateReturnByTrackingId(body, trackingId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsManagementApi#updateReturnByTrackingId");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ReturnsManagementApi;

public class ReturnsManagementApiExample {

    public static void main(String[] args) {
        ReturnsManagementApi apiInstance = new ReturnsManagementApi();
        UpdateReturnByTrackingIdInput body = ; // UpdateReturnByTrackingIdInput | The request body containing information about the return being modified.
        String trackingId = trackingId_example; // String | The tracking Id of the return
        try {
            apiInstance.updateReturnByTrackingId(body, trackingId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReturnsManagementApi#updateReturnByTrackingId");
            e.printStackTrace();
        }
    }
}
UpdateReturnByTrackingIdInput *body = ; // The request body containing information about the return being modified.
String *trackingId = trackingId_example; // The tracking Id of the return

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

// Update Return By the TrackingId
[apiInstance updateReturnByTrackingIdWith:body
    trackingId:trackingId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AmazonYojakaAdaptersApiReturnsModel = require('amazon_yojaka_adapters_api_returns_model');

var api = new AmazonYojakaAdaptersApiReturnsModel.ReturnsManagementApi()
var body = ; // {{UpdateReturnByTrackingIdInput}} The request body containing information about the return being modified.
var trackingId = trackingId_example; // {{String}} The tracking Id of the return

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.updateReturnByTrackingId(bodytrackingId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

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

            var apiInstance = new ReturnsManagementApi();
            var body = new UpdateReturnByTrackingIdInput(); // UpdateReturnByTrackingIdInput | The request body containing information about the return being modified.
            var trackingId = trackingId_example;  // String | The tracking Id of the return

            try
            {
                // Update Return By the TrackingId
                apiInstance.updateReturnByTrackingId(body, trackingId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ReturnsManagementApi.updateReturnByTrackingId: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiReturnsManagementApi();
$body = ; // UpdateReturnByTrackingIdInput | The request body containing information about the return being modified.
$trackingId = trackingId_example; // String | The tracking Id of the return

try {
    $api_instance->updateReturnByTrackingId($body, $trackingId);
} catch (Exception $e) {
    echo 'Exception when calling ReturnsManagementApi->updateReturnByTrackingId: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ReturnsManagementApi;

my $api_instance = WWW::SwaggerClient::ReturnsManagementApi->new();
my $body = WWW::SwaggerClient::Object::UpdateReturnByTrackingIdInput->new(); # UpdateReturnByTrackingIdInput | The request body containing information about the return being modified.
my $trackingId = trackingId_example; # String | The tracking Id of the return

eval { 
    $api_instance->updateReturnByTrackingId(body => $body, trackingId => $trackingId);
};
if ($@) {
    warn "Exception when calling ReturnsManagementApi->updateReturnByTrackingId: $@\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.ReturnsManagementApi()
body =  # UpdateReturnByTrackingIdInput | The request body containing information about the return being modified.
trackingId = trackingId_example # String | The tracking Id of the return

try: 
    # Update Return By the TrackingId
    api_instance.update_return_by_tracking_id(body, trackingId)
except ApiException as e:
    print("Exception when calling ReturnsManagementApi->updateReturnByTrackingId: %s\n" % e)

Parameters

Body parameters
Name Description
body *
{

This object encapsulates all the data to be provided by an adapter to update a return

Required: adapterAttributes,propertiesToBeUpdated,searchTrackingId
searchTrackingId:
string

The tracking Id of the return

propertiesToBeUpdated:
{

Contains the properties of the return that need to be updated

Required: lastUpdatedTimestamp,returnStatus
returnStatus:
lastUpdatedTimestamp:
otp:
validTill:
isReturnedWithOTP:
reverseTrackingInfo:
}
adapterAttributes:
{

Contains information for a particular adapter

Required: principal
principal:
id:
}
}
Query parameters
Name Description
trackingId*
String
The tracking Id of the return
Required

Responses

Status: 200 - Success. The return was successfully updated.

Status: 400 - Bad request. One or more of the input parameters you have provided is invalid.

{

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.

}