coupon.importCoupons
    • 3 Minutes to read
    • Dark
      Light

    coupon.importCoupons

    • Dark
      Light

    Article summary

    General Information

    This method allows the marketer to import a list of coupon codes that are stored online in a data file. This is the preferred method to use for importing coupon codes into the platform because the codes themselves can be stored separately from the API method call, and the import process is asynchronous which is more conducive to importing large file sizes.

    Arguments

    Field

    Description

    Field Type

    Required

    Example

    bank_id

    The identification number of the bank you want to insert the coupon codes into. To view the ID of any given coupon bank, login to Empower Enterprise and navigate to Assets >> Manage Coupon Banks

    number

    Yes

    4

    notification_email

    A comma-separated list of email addresses that will receive the notification when the import completes or fails.

    string

    Yes

    jsmith@example.com, john_doe@example.com

    compression

    Only include this element if the data file is compressed. Valid compression types are:

    • zip

    • gzip

    string

    No

    zip

    data_url

    The URL of the data source containing the coupon codes to be imported. Include this element only if you are using the HTTP or HTTPS transfer protocols.

    The only allowable file extensions include the following:

    • .txt

    • .csv

    • .tab

    • .zip

    • .gzip

    string

    Conditional. Required if you are using HTTP(S) as your file transfer protocol.

    https://www.example.com/couponCodes.zip

    ftp_server

    The IP Address or the hostname of the FTP server hosting the data file containing the coupon codes to be imported. Include this element only if you are using the FTP or sFTP transfer protocols.

    string

    Conditional. Required if you are using sFTP or FTP as your file transfer protocol.

    ftp.example.com

    ftp_user_name

    Username of the FTP site.

    string

    Conditional. Required if you are using sFTP or FTP as your file transfer protocol.

    coupon_user

    ftp_user_pass

    The password of the FTP site.

    string

    Conditional. Required if you are using sFTP or FTP as your file transfer protocol.

    bX9berGaFd

    filename

    The name of the data file on the FTP server that contains the coupon codes to be imported. The file name should also include the FTP direct path to the file if applicable. The only allowable file extensions include the following:

    • .txt

    • .csv

    • .tab

    • .zip

    • .gzip

    string

    Conditional. Required if you are using sFTP or FTP as your file transfer protocol.

    /promo1/couponCodes.zip

    ftp_ssl

    A boolean indicating whether SSL should be applied where:

    • 0 – (default) Do not apply SSL

    • 1 – apply SSL

    string

    No

    1

    sftp

    A boolean indicating whether the FTP is using sFTP security where:

    • 0 – (default) The server is not sFTP

    • 1 – The server is sFTP

    string

    No

    1

    Response

    Field

    Description

    Example

    bank_id

    The bank_id that was originally entered in the input parameters.

    4

    notification_email

    The email addresses that were originally entered in the input parameters.

    jsmith@example.com, john_doe@example.com

    task_id

    The job ID number assigned to the import task. Use the value returned in this XML element as one of the input parameters for the Utilities.getTasks API method call in order to retrieve the current status of the coupon code import job.

    92794

    Response Codes

    Response Code

    Response Text

    Condition

    644

    Action not taken, invalid compression

    The <compression%gt; element specified an invalid compression type or the one used on the data file does not match the one specified.

    645

    Action not taken, data_url or ftp_server is required

    if HTTP(S) is the transfer protocol, and the fully qualified URL is missing. If FTP is the specified transfer protocol, then the hostname or IP address of the FTP server is missing.

    646

    Action not taken, cannot pass both data_url and ftp_server

    Both elements were included in the parameters. To eliminate ambiguity, the parameters need to include one or the other.

    647

    Action not taken, FTP username and password are required

    FTP is the specified transfer protocol and the user name and/or password is missing.

    648

    Action not taken, the filename is required

    FTP is the specified transfer protocol and the filename is missing.

    649

    Action not taken, invalid file type

    The file extension of the data file is not supported.

    654

    Action was not taken, and the data file was not copied

    There was an error in retrieving the data file from either the web or FTP server. This error could arise for any number of reasons including an invalid URL or FTP server, an invalid FTP username and/or password, the host web server or FTP server being unavailable, etc. 


    Was this article helpful?