addOrderReturn
The method allows adding a new order return to BaseLinker.
Input parameters
Output data:
A sample request in PHP:
order_id | int | (optional) Order ID in BaseLinker panel |
status_id | int | Order return status (the list available to retrieve with getOrderReturnStatusList) |
custom_source_id | int | (optional) Identifier of custom order source defined in BaseLinker panel. If not provided, default order source is assigned. |
reference_number | varchar(100) | (optional) Reference number from external source. |
date_add | int | Date of order return creation (in unix time format) |
currency | char(3) | 3-letter currency symbol (e.g. EUR, PLN) |
refunded | bool | Information whether the order return is already refunded. The value "1" automatically marks order return as refunded. |
admin_comments | varchar(200) | Seller comments |
varchar(150) | Buyer e-mail address | |
phone | varchar(100) | Buyer phone number |
user_login | varchar(30) | Marketplace user login |
delivery_price | float | Gross delivery price |
delivery_fullname | varchar(100) | Delivery address - name and surname |
delivery_company | varchar(100) | Delivery address - company |
delivery_address | varchar(100) | Delivery address - street and number |
delivery_postcode | varchar(100) | Delivery address - postcode |
delivery_city | varchar(100) | Delivery address - city |
delivery_state | varchar(20) | Delivery address - state/province |
delivery_country_code | char(2) | Delivery address - country code (two-letter, e.g. EN) |
extra_field_1 | varchar(50) | Value of the "additional field 1" |
extra_field_2 | varchar(50) | Value of the "additional field 2" |
custom_extra_fields | array | A 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) } |
products | array | Return 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_number | varchar(50) | Bank account number to issue a refund |
refund_iban | varchar(34) | IBAN of the bank account |
refund_swift | varchar(11) | SWIFT of the bank account |
Output data
The method returns the data in JSON format.
status | varchar(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_id | int | Identifier of added return. |
Sample
Input data:Output data:
A sample request in PHP: