FeedAMP FTP V2 Documentation (2022-10-21)

Integrating with FeedAMP Flexible Workflow via SFTP

Overview

FeedAMP (Automated MarketPlaces) provides an automated workflow for handling orders placed on marketplaces. Integration with FeedAMP can be achieved via SFTP, Rest API, as well as via popular e-commerce platform APIs (e.g. Shopify, Magento). The SFTP option can be used if no direct integration is available with your e-commerce platform. (NOTE: Non-secure FTP is not available as an integration option)

Product Information

General FeedAMP Information

FeedAMP operates at a frequency of 15 minutes for all polling actions. Integrations can also be paused and have operations run manually and individually.

File Types

The FeedAMP SFTP integration uses a set of custom text files to process orders. There are two main categories of files: Data and Report files. A brief overview is presented here; for more details on formatting and the records these files contain, see SFTP Files. (Note: This document uses the words “row” and “record” interchangeably)

Data Files

Data files are used for the various stages of automated order processing:

  • Orders files represent new orders being received and stored in FeedAMP.
  • Processed Orders files represent shipping and cancellation information for orders in FeedAMP.
  • Order Refunds files represent refunds for orders in FeedAMP.

Report Files

Report files are used for post-processing operations:

  • Archive files are exact copies of files generated by a merchant and ingested by FeedAMP. Archive files are created for Processed Orders and Order Refunds files.
  • Results files are reports that provide metrics on order-processing, including number of records processed successfully and error details. Results files are created for Processed Orders and Order Refunds files.

Processes

Order Processing Cycle

There are three main stages of FeedAMP order processing: Placement, Acknowledgement, and Fulfillment.

Order Placement

The actions FeedAMP performs initially:

  • Poll marketplaces for new orders
  • Insert received orders into the seller SFTP server

Order Acknowledgement

Only some marketplaces require order acknowledgement. After getting new orders, FeedAMP will:

  • Acknowledge receipt of orders to the marketplace (if applicable)

Order Fulfillment

Once orders have been placed, the following actions occur:

  • Poll shipment and cancellation information from seller's SFTP folder
  • Report order shipment and cancellation information to the order’s respective marketplace to complete the order life cycle

An order can have multiple shipments and/or multiple cancellations. Each order line must be a separate row in a Processed Orders file, though shipments and cancellations for a particular order line can be consolidated in a single row.

FeedAMP can handle shipments and cancellations for the same order spread across different files and supplied at different times. However, FeedAMP only reports shipment and cancellation updates to the Marketplace after it has accounted for all items in an order. Any fulfillment information received after an order has all records fulfilled will be disregarded.

Refund Processing Cycle

For refund processing, the 2 stages/actions FeedAMP performs are:

  • Poll for new refunds from the merchant’s SFTP server
  • Report refund information to the order’s marketplace

Each refund is applied to a single order line in a single order, although there can be multiple refunds for a given order line (e.g. one refund for 1 of 3 quantity of the order line, and then another refund for the remaining 2).

Refunds can be applied to orders only after they have been fulfilled. Be careful not to issue a refund for an item after already canceling the item; this may result in the refund total exceeding the amount due to the customer.

Return Processing Cycle

For return processing, the 3 stages/actions FeedAMP performs are:

Returns Placement

The actions FeedAMP performs initially are:

  • Poll marketplaces for new returns from the Marketplace
  • Place the returns on the merchant’s FTP server. (Returns will either be unauthorized or pre-authorized)

Returns Authorization

If the marketplace does not pre-authorize returns and requires returns to be authorized

  • Poll the client’s SFTP server looking for return authorization files
    • If found authorized the returns in the file with the return’s originating marketplace. If the originating marketplace pre-authorized returns, this step is not needed.

Returns Refund

Authorized the marketplace to either complete or cancel the return request

  • Poll the client’s SFTP server looking for return refund files

    • The refund action on the returns are processed in the returns originating
    • marketplace
  • Report refund information to the order’s origin marketplace to close out the return

    Returns are stand alone records that can relate to FeedAMP orders OR orders that exist outside of our system. Returns can only be applied to orders after they have been fulfilled, the order state should be either Fulfilled or Complete.

Integration Setup

Marketplace Integrations

If you have not already set up your Marketplace account(s), you will need to do so before enabling FeedAMP. Marketplaces may provide you their respective processes to follow.

Typically, the process includes:

  • Authorizing/associating Feedonomics as a developer-agent to make API calls on behalf of the seller
  • Entering financial info
  • Entering tax settings
  • Entering shipping settings
  • Entering store page profile information, including details such as customer support policy

Once you have set up your account(s), provide Feedonomics with the API authentication keys and/or login credentials to the seller accounts for all marketplaces automated using FeedAMP.

SFTP Configuration

SFTP Server

  • If you are hosting the SFTP server, provide credentials to Feedonomics, including the port number. Alternatively, Feedonomics can host the SFTP server at no additional charge. - The SFTP adapter supports two methods of connecting to SFTP server. The default is libcurl, but if the target SFTP server is less flexible with encryption algorithms, PHPSecLib can be tried - Specify to Feedonomics the directories to place Orders files and retrieve Processed Orders files, as well as Order Refunds files if you are using FeedAMP to automate order refunds.

File System Settings

Permissions

  • Ensure that the SFTP server is configured such that the FeedAMP user has read/write/execute permissions to all the directories and files specified in the “Directories” section below. - Ensure all files retain read/write/execute permissions for the FeedAMP user to access them. Write access is necessary for FeedAMP to move files to the archive directory after reading and processing.

Directories

Files types are separated by directory. The default SFTP paths for each file are as follows, relative to the base directory path.

  • Directories for Order Placement: - orders/ - Directories for Order Fulfillment: - processed_orders - processed_orders/archive - processed_orders/results - Directories for Order Refunds: - order_refunds - order_refunds/archive - order_refunds/results - Directories for Order Returns: - returns/new_returns - returns/authorized_returns - returns/refund_returns/full_refund - returns/refund_returns/partial_refund

Development Details

Life-cycle

  • Successful integration with FeedAMP follows a "reported once" paradigm rather than a "current state" paradigm. In other words, do not output shipping or cancellations in a Processed Orders file if it was already output at an earlier point in time. The same applies for Order Refunds files. - FeedAMP produces fresh Order files, and the seller produces Processed Orders files (and Order Refunds files). The consumer of files is responsible for making the decision whether to delete files and when. FeedAMP will not report an order more than once.

SFTP Files

FeedAMP File Types

FeedAMP SFTP Integrations use two main categories of file: Data Files are used during the various stages of order processing, while Report Files present info relevant for post-processing and debugging.

Data Files

  • Orders files represent new orders (separated into one order line per row) that FeedAMP has detected.
    • These files are created by FeedAMP for the merchant’s system to process and ingest.
    • A single Orders file may contain records for multiple orders.
  • Processed Orders files represent shipping and cancellation information for orders that were originally reported by FeedAMP.
    • These files are created by the merchant’s system and retrieved by FeedAMP to report to the marketplace.
    • A file may contain fulfillment information for one or more orders (broken up into order lines). Each non-empty line in a Processed Orders file is considered a “record.”
    • Processed Orders file can contain records for partial order fulfillments (e.g. shipping action taken on 2 items of a particular order).
    • Fulfilled lines are matched to order lines by mp_line_number by default. If the seller would like to match the fulfillment by sku, this configuration option must be selected. ▫ Columns relating to cancellations (i.e. quantity_cancelled and cancellation_reason) must be present even if a Processed Order file contains only shipments.
    • Columns relating to shipments must be present even if a Processed Order file contains only cancellations.
  • Order Refunds files represent refunds (outside of cancellations) that the merchant wishes to issue to orders that were originally reported by FeedAMP.
    • Order Refunds handling is optional, and may not be available for all marketplaces. Consult with your Feedonomics onboarding specialist for more information.
    • Like Processed Orders files, these files are created by the merchant’s system and retrieved by FeedAMP for reporting to the marketplace.
    • Each non-empty line in an Order Refunds file (after the header) is considered a “record.” ▫ Refunds should only be created for orders that have been reported as fulfilled to the marketplace.
    • Refunds should only be created for items that have been shipped.
  • Return Placement files represent returns that were submitted by a customer through the marketplace for orders that were originally reported by FeedAMP. .
    • Returns are optional and are not available for all marketplaces. Consult with your Feedonomics onboarding specialist for more information.
    • These files are created by FeedAMP for the merchant’s system to process and ingest.
    • A single Returns Placement file may contain records for multiple returns.
  • Return Authorization files represent the approval of the return requests for orders that were originally reported by FeedAMP.
    • Returns Authorizations are optional and authorizing a return is not available for all marketplaces. Consult with your Feedonomics onboarding specialist for more information.
    • These files are created by the merchant’s system and retrieved by FeedAMP to report the authorization to the marketplace.
    • A file may contain fulfillment information for one or more returns (broken up into return lines). Each non-empty line in a Processed Orders file is considered a “record.”
    • Returns can either be authorized or rejected.
    • If the return is rejected, it will be moved to a closed state in FeedMAP
  • Return Refund files represent the refund amounts for returns to be refunded on the marketplace, for orders that were originally reported by FeedAMP.
    • Returns Refunds are optional and refunding a return is not available for all marketplaces. Consult with your Feedonomics onboarding specialist for more information.
    • These files are created by the merchant’s system and retrieved by FeedAMP to refund the amounts to the marketplace.
    • A file may contain refund information for one or more returns
    • Refund amounts can either be for full amounts or partial depending on what the marketplace supports.
    • For partial refunds, item cost must be > 0
    • For shipping cost must be 0 if not refunding or >0 and less than the shipping cost for that order line.
    • Refunds can be rejected depending on the marketplace. Consult with your Feedonomics onboarding specialist for more information.

Report Files

  • Archive files are exact copies of the files the merchant generated, after having been read and ingested by FeedAMP. A file is archived after FeedAMP reads and attempts to process the file. - Results files are detailed reports of files that were read by FeedAMP. They outline how many records were successfully processed. Records that failed to process are identified, and a detailed error message is annotated to the record.
    • If there is a file-level error (e.g. incorrect header), then a detailed file-level error message is included instead of record-level error messages.

File Name Format

File names must adhere to the following format:

{file_prefix}_{marketplace_name}_{yyyymmddhhmmss}.{file_type}

File Prefix

By default, file prefixes for each type of file are the same as their corresponding file type’s directory names. For example:

  • Prefix for Orders files:
    • orders
  • Prefix for Processed Orders files:
    • processed_orders
  • Prefix for Order Refunds files:
    • order_refunds

Marketplace Name

The “marketplace_name” is FeedAMP's identification of the marketplace integration. This refers specifically to the integration name, rather than the type of marketplace used. The formatting requirements for “marketplace_name” are:

  • Case-sensitive
    • File prefix must match name as it appears in FeedAMP UI
  • Whitespace characters
    • Avoiding whitespace characters is recommended. Separating words by underscore is preferred
  • If you have separate integrations to the same marketplace, (e.g. Amazon_US, Amazon_UK, Amazon_AU), then each marketplace name must be distinct

Timestamp

File name timestamps can be in any time zone as long as they are consistent. Feedonomics will provide file name timestamps in GMT time zone for all applicable file types.

Examples:

orders_walmart_20171231235959.csv

orders_walmart_ca_20171231235959.csv

processed_orders_amazon_us_20171231235959.tsv

processed_orders_amazon_uk_20171231235959.tsv

order_refunds_ebay_20180125012500.tsv

Note: When opening a file with a spreadsheet processor, the data may get unintentionally mutated by column type defaults. In order to prevent this, be sure to specify each column as "text"/"raw" rather than "general"/"standard" when opening. Alternatively, open the file with a text editor (e.g. Notepad++, Sublime Text, Visual Studio Code) to preserve the raw data.

File Content Format

Date/time values in file contents should be in ISO-8601 format.

All files must use a delimiter-separated values format. The SFTP platform provides configuration options

to match the desired file type and delimiter settings. The default format for files is as follows:

  • Tab-separated (\t) values format (TSV)

  • Delimited with a space character ( )

  • Enclosed with double quotes (“) if necessary

  • Enclosures escaped with backslash (\)

Exception: The Results file has a set number of lines above the header that provide general results information. See the Results File Formatting section below for more details.

Fields Format

Descriptions and logic for each field can be found in the documentation file named FeedAMP_SFTP_Integration_Specs_V4.7.xlsx

Example files can be found in the provided sample_files directory. Note that the format for some fields is subject to change depending on how each marketplace represents them, and not all information in the sample files may be completely accurate to that of real orders.

  • Orders file

    • Single-line
      • sample_files/orders/orders_Test_Amazon_20210303233538.tsv
    • Multi-line
      • sample_files/orders/orders_Test_Amazon_20210304021028.tsv
  • Processed Orders file

    • Waiting to be processed
      • sample_files/processed_orders/processed_orders_Test_Amazon_202 10303233538.tsv
    • Archive (already processed)
      • Shipments and Cancellations
        • sample_files/processed_orders/archive/processed_orders_Test_Amazon_20210304021028.tsv
    • Results
      • Success
        • sample_files/processed_orders/results/processed_orders_Test_Walmart_20210304185936_results.tsv
      • Failure
        • sample_files/processed_orders/results/processed_orders_Test_Amazon_20210304021028_results.tsv
  • Order Refunds file

    • sample_files/order_refunds/order_refunds_Test_Amazon_20210304021028 .tsv
  • Return Files

    • New Returns
    • sample_files/returns/new_returns/returns_Test_Marketplace_20220728141845.tsv

    IMPORTANT: When you first set up the FTP integration, the identity and order of the fields in the order file will be locked to the specifications reflected in the FeedAMP_FTP_Integration_Specs file. If new fields are made available in future releases, your FeedAMP configuration can be modified to add additional fields. In order to ensure backwards compatibility, existing columns will not be removed or renamed.

Post-Processing

After processing a file from a merchant (i.e. Processed Orders file or an Order Refunds file), FeedAMP will archive it and generate a results file.

Archive

All files processed by FeedAMP will be moved into the archive directory of the current directory. The file name and contents are preserved.

Results

For each file processed by FeedAMP, a corresponding results file will be generated in the results directory. The results file name will be of the format *_results.{extension} . The wildcard (*) refers to the original file name.

Results File Contents

If FeedAMP determines a file, header, or row within a file to be invalid in any way, the reason for

rejection and steps to rectify and re-submit the record for reprocessing will be provided in the results file.

  • X out of TOTAL records (rows) successfully processed

    • If there were file-level errors (e.g. malformed header), then the number of records will be reported as 0, since no records were even attempted to be processed.
  • Any file-level error details - Any record-level error details, including the line number in the original file (the original file can be found in the archive directory) Common reasons for rejecting a record are:

    • Parsing errors
      • Invalid column name
      • Incorrect column-separator character (spaces vs. commas vs. tabs)
      • Incorrect line ending (line endings must be unit-format, i.e. “\n”)
      • Incorrect escape characters
      • Characters with unrecognized encoding
    • Mismatch in column count between the current record and header
    • Unrecognized order number or order line number
    • Over-fulfillment or over-cancellation
    • Missing carrier and/or tracking number

Results File Formatting

The results file always begins with a single line that specifies how many records were processed. It then has two optional sections: “File Level Errors” and “Record Errors”. Record errors are presented in TSV format with a header.

Error Handling

The combination of the original file under the file’s corresponding archive directory along with details of the file-level or row-level errors in the results file will allow you to know when rejections occurred and for what reasons.

Once the error is understood, you can create a new file containing the corrected rows under the folder that FeedAMP polls to process the file types (i.e. the directories for Processed Orders / Order Refunds). FeedAMP will then process the order during its next cycle as normal.

IMPORTANT: It is vital that you give the new file a unique name that still fits the file formatting and naming conventions. If the file name identical to an already processed file is used, the corresponding Archive and Results files that were already generated will be overwritten.

Getting Started

Development Steps

  • Implement the capability to read and process newly placed Orders files placed into the SFTP server by FeedAMP, as FeedAMP polls for new orders from the marketplaces. - Ensure that orders are ingested robustly before modifying, moving, or deleting any Orders files. - Once all items in an order are shipped or cancelled, produce a Processed Orders file containing shipment and/or cancellation information. - Any orders that require a refund (not including the implicit refund that comes from item cancellation) may be processed by producing an Order Refunds file. - Results files for both Processed Orders and Order Refunds files will provide feedback on the successful or failed submission of a file.

Testing

  • After all development and marketplace setup is complete, order testing is recommended before going live. - Testing will involve coordination and action on the part of both you and your Feedonomics onboarding specialist. - One or more test orders will need to be created in the marketplace and passed through the entire order life cycle to confirm integration is functional. - Refund testing is also recommended if you are using that option.

Technical Support

For technical support please create a FeedSupport ticket. A marketplace team specialist will be able to assist you. If you do not have FeedSupport access yet, please contact your Account Manager.