Merchant Return Handling
General
The return address is mandatory information for each country a merchant is shipping to.
The return address can be set via Core Panel or Admin API.
Admin API
Create a Merchant Return Address
You can add multiple return addresses to a merchant.
Parameter | Details |
---|---|
id | Integer READ-ONLY The ID of the return address created by SCAYLE. |
name | String The name of the return address. |
street | String The street name of the return address. |
streetNo | String The street number of the return address. |
zipCode | String The postal code of the return address. |
city | String The city name of the return address. |
countryCode | String ISO 3166 alpha 2 country code. |
dhlCode | String The DHL code of the return address. |
let newReturnAddress = {
name: "Return Point",
street: "Domstrasse",
streetNo: "10",
zipCode: "22303",
city: "Hamburg",
countryCode: "DE",
dhlCode: "JVGL0849489024"
};
let response = await adminApi.apis.Merchants.createMerchantReturnAddress({merchantIdentifier: 1}, {requestBody: newReturnAddress});
let createdReturnAddress = response.body;
console.log(createdReturnAddress.id);
Get Merchant Return Address
This method is used to get an existing merchant return address by its ID.
Parameter | Details |
---|---|
id | Integer READ-ONLY The ID of the return address created by SCAYLE. |
name | String The name of the return address. |
street | String The street name of the return address. |
streetNo | String The street number of the return address. |
zipCode | String The postal code of the return address. |
city | String The city name of the return address. |
countryCode | String ISO 3166 alpha 2 country code. |
dhlCode | String The DHL code of the return address |
let response = await adminApi.apis.Merchants.getMerchantReturnAddress({merchantIdentifier: 1, merchantReturnAddressId: 1});
let returnAddress = response.body;
console.log(returnAddress.id);
Get Merchant Return Address Collection
This method is used to get a collection of existing merchant return addresses.
Parameter | Details |
---|---|
limit | Integer Maximum number of items in the result. (default: |
filters[id] | String Comma-separated list of merchant return address IDs that should be used for filtering. |
filters[minId] | Integer Minimum ID of merchant return addresses that should be returned. |
filters[maxId] | Integer Maximum ID of merchant return addresses that should be returned. |
Parameter | Details |
---|---|
entities | MerchantReturnAddress A collection of merchant return addresses. |
cursor | Cursor An object containing information for use in pagination. |
let response = await adminApi.apis.Merchants.getMerchantReturnAddresses({merchantIdentifier: 1});
let returnAddresses = response.body.entities;
returnAddresses.forEach(
returnAddress => console.log(returnAddress.id)
);
Update Merchant Return Address
This method is used to update an existing merchant return address.
Parameter | Details |
---|---|
id | Integer READ-ONLY The ID of the return address created by SCAYLE. |
name | String The name of the return address. |
street | String The street name of the return address. |
streetNo | String The street number of the return address. |
zipCode | String The postal code of the return address. |
city | String The city name of the return address. |
countryCode | String ISO 3166 alpha 2 country code. |
dhlCode | String The DHL code of the return address. |
let merchantId = 1;
let response = await adminApi.apis.Merchants.getMerchantReturnAddress({merchantIdentifier: merchantId, merchantReturnAddressId: 1});
let returnAddress = response.body;
returnAddress.streetNo = "10";
response = await adminApi.apis.Merchants.updateMerchantReturnAddress({merchantIdentifier: merchantId, merchantReturnAddressId: returnAddress.id}, {requestBody: returnAddress});
returnAddress = response.body;
console.log(returnAddress.streetNo);
Delete Merchant Return Address
You can delete an existing merchant return address by its ID.
Parameter | Details |
---|---|
id | Integer READ-ONLY The ID of the return address created by SCAYLE. |
name | String The name of the return address. |
street | String The street name of the return address. |
streetNo | String The street number of the return address. |
zipCode | String The postal code of the return address. |
city | String The city name of the return address. |
countryCode | String ISO 3166 alpha 2 country code. |
dhlCode | String The DHL code of the return address. |
await adminApi.apis.Merchants.deleteMerchantReturnAddress({merchantIdentifier: 1, merchantReturnAddressId: 1});