API documentation
Method list
Test your request
Changelog


addOrderReturn
The method allows adding a new order return to BaseLinker.


Input parameters
order_idint(optional) Order ID in BaseLinker panel
status_idintOrder return status (the list available to retrieve with getOrderReturnStatusList)
custom_source_idint(optional) Identifier of custom order source defined in BaseLinker panel. If not provided, default order source is assigned.
reference_numbervarchar(100)(optional) Reference number from external source.
date_addintDate of order return creation (in unix time format)
currencychar(3)3-letter currency symbol (e.g. EUR, PLN)
refundedboolInformation whether the order return is already refunded. The value "1" automatically marks order return as refunded.
admin_commentsvarchar(200)Seller comments
emailvarchar(150)Buyer e-mail address
phonevarchar(100)Buyer phone number
user_loginvarchar(30)Marketplace user login
delivery_pricefloatGross delivery price
delivery_fullnamevarchar(100)Delivery address - name and surname
delivery_companyvarchar(100)Delivery address - company
delivery_addressvarchar(100)Delivery address - street and number
delivery_postcodevarchar(100)Delivery address - postcode
delivery_cityvarchar(100)Delivery address - city
delivery_statevarchar(20)Delivery address - state/province
delivery_country_codechar(2)Delivery address - country code (two-letter, e.g. EN)
extra_field_1varchar(50)Value of the "additional field 1"
extra_field_2varchar(50)Value of the "additional field 2"
custom_extra_fieldsarrayA list containing order return custom extra fields, where the key is the extra field ID and value is an extra field content for given extra field. The list of extra fields can be retrieved with getOrderReturnExtraFields method.
In case of removing a field the empty string is expected.
In case of file the following format is expected:
{
    "title": "file.pdf" (varchar(40) - the file name)
    "file": "data:4AAQSkZJRgABA[...]" (binary - the file body limited to 2MB)
}
productsarrayReturn product array. Each element of the array is also an array containing fields:
storage (varchar) - type of magazine from which the product comes (available values: "db" - BaseLinker internal catalog, "shop" - the online store magazine, "warehouse" - a connected wholesaler).
storage_id (int) - the identifier of the magazine from which the product comes (one of the shops connected to the account). Value "0" for a product from the BaseLinker internal catalog.
product_id (varchar) - Product identifier in BaseLinker or store magazine. Blank if the product number is unknown
variant_id (int) - Product variant ID. Blank if the variant number is unknown
name (varchar) - Product name
sku (varchar) - Product sku
ean (varchar) - Product ean
location (varchar) - Product location
warehouse_id (int) - Product source warehouse identifier. Only applies to products from BaseLinker inventory. By default warehouse_id is determined based on the source of the order.
attributes (varchar) - Specific product attributes (e.g. "Color: blue")
price_brutto (float) - Single item gross price
tax_rate (float) - VAT tax rate e.g. "23", (value from range 0-100, EXCEPTION values: "-1" for "EXPT"/"ZW" exempt from VAT, "-0.02" for "NP" annotation, "-0.03" for "OO" VAT reverse charge)
quantity (int) - Quantity of pieces
weight (float) - Single item weight
status_id (int) - Identifier of return item status
return_reason_id (int) - Identifier of return reason
refund_account_numbervarchar(50)Bank account number to issue a refund
refund_ibanvarchar(34)IBAN of the bank account
refund_swiftvarchar(11)SWIFT of the bank account



Output data
The method returns the data in JSON format.
statusvarchar(30)SUCCESS - request executed correctly
ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code
return_idintIdentifier of added return.



Sample
Input data:
Output data:
A sample request in PHP: