Documentation of the shops data exchange protocol - baselinker.com
Function list
Tests
ChangeLog
Remap Builder


OrderReturnAdd
The method allows add a new return from BaseLinker to the store. It provides return details, return products and return status.


Input parameters
Incoming as $_POST fields.
previous_order_return_idstringOrder return ID (if added to the store for the first time, the value is empty. If it was added before, the value contains the previous order return number)
baselinker_idintOrder return ID from BaseLinker pool
shop_order_idstringOrder ID from store database
return_status_idstringReturn status ID (status list to be downloaded by OrderReturnStatusesList method)
reference_numberstringReturn reference number
date_addintReturn date in UNIX_TIMESTAMP format
refund_account_numberstringAccount number for refund
refund_ibanstringIBAN for refund
refund_swiftstringSWIFT for refund
phonestringCustomer phone
emailstringCustomer email
currencychar(3)Return currency symbol
admin_commentsstringshort note from the operator to the return
refundedboolflag determining whether the return is refunded (0/1)
delivery_tracking_numberstringDelivery tracking number
delivery_fullnamestringDelivery address - full name
delivery_companystringDelivery address - company
delivery_addressstringDelivery address - street and home/local number
delivery_postcodestringDelivery address - postcode
delivery_citystringDelivery address - city
delivery_state_codestringDelivery address - State, region or province code
delivery_countrystringDelivery address - Country
delivery_country_codestringDelivery address - ISO country code (2 letters)
delivery_methodstringDelivery name
delivery_method_idstringDelivery ID
delivery_pricefloatDelivery price
productsArray (Sent as string in JSON format)An array containing the products of the return (in JSON format). Each element of the array is also an array containing the following fields:
| - idstringproduct ID
| - variant_idstringvariant ID (0 when main product)
| - namestringfull product or variant name
| - skustring(optional) Stock Keeping Unit
| - pricefloatgross price of one item
| - quantityintnumber of items purchased
| - taxfloattax amount expressed as a percentage, as a number from 0-100. Without % character.
| - auction_idstring(optional) auction ID (from external marketplace, e.g. Ebay, Etsy)(optional)
| - reason_idstringReturn reason ID (reason list to be downloaded by OrderReturnReasonsList method)
| - attributesarray(optional) array with selectable product attributes describing the purchased variant, in which each element contains the following fields:
      | - namestringattribute name
      | - valuestringattribute value
extra_field_1stringadditional field (any data)
extra_field_2stringadditional field (any data)



Outgoing data
Array fields that the method should return.
order_return_idstringID of the new order return saved in store database



Example:
Input data:

POST request: