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.
POST request:
| previous_order_return_id | string | Order 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_id | int | Order return ID from BaseLinker pool |
| shop_order_id | string | Order ID from store database |
| return_status_id | string | Return status ID (status list to be downloaded by OrderReturnStatusesList method) |
| reference_number | string | Return reference number |
| date_add | int | Return date in UNIX_TIMESTAMP format |
| refund_account_number | string | Account number for refund |
| refund_iban | string | IBAN for refund |
| refund_swift | string | SWIFT for refund |
| phone | string | Customer phone |
| string | Customer email | |
| currency | char(3) | Return currency symbol |
| admin_comments | string | short note from the operator to the return |
| refunded | bool | flag determining whether the return is refunded (0/1) |
| delivery_tracking_number | string | Delivery tracking number |
| delivery_fullname | string | Delivery address - full name |
| delivery_company | string | Delivery address - company |
| delivery_address | string | Delivery address - street and home/local number |
| delivery_postcode | string | Delivery address - postcode |
| delivery_city | string | Delivery address - city |
| delivery_state_code | string | Delivery address - State, region or province code |
| delivery_country | string | Delivery address - Country |
| delivery_country_code | string | Delivery address - ISO country code (2 letters) |
| delivery_method | string | Delivery name |
| delivery_method_id | string | Delivery ID |
| delivery_price | float | Delivery price |
| products | Array (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: |
| | - id | string | product ID |
| | - variant_id | string | variant ID (0 when main product) |
| | - name | string | full product or variant name |
| | - sku | string | (optional) Stock Keeping Unit |
| | - price | float | gross price of one item |
| | - quantity | int | number of items purchased |
| | - tax | float | tax amount expressed as a percentage, as a number from 0-100. Without % character. |
| | - auction_id | string | (optional) auction ID (from external marketplace, e.g. Ebay, Etsy)(optional) |
| | - reason_id | string | Return reason ID (reason list to be downloaded by OrderReturnReasonsList method) |
| | - attributes | array | (optional) array with selectable product attributes describing the purchased variant, in which each element contains the following fields: |
| | - name | string | attribute name |
| | - value | string | attribute value |
| extra_field_1 | string | additional field (any data) |
| extra_field_2 | string | additional field (any data) |
Outgoing data
Array fields that the method should return.
| order_return_id | string | ID of the new order return saved in store database |
Example:
Input data:POST request:
Documentation of the shops data exchange protocol - baselinker.com