In order to use this function, the necessary Pastel SDK files have to be installed on the host computer.

Import customer or supplier documents into Pastel.


  • Data path

    The location of the Pastel data files.

  • User id

    An optional user id to send with the document import.

  • Document type

    The document type to import. Available options are: Customer quotation, Customer sales orders, Customer invoices, Customer credit note, Customer debit note, Supplier purchase orders, Supplier GRNs, Supplier invoices, Supplier return/debit or Supplier credit to supplier.

  • Create batch

    If true, the document will not be updated to the General Ledger and will remain in a batch.

  • Header

    A list of pipe-separated ("|") strings that defines the header of the document. The header string must use the following layout:

    Document NumberCharacter8 characters maximum
    DeletedCharacterY=Deleted, =Not deleted
    Print StatusCharacterY=Printed, =Not printed
    Customer CodeCharacter7 characters maximum
    DateCharacterDD/MM/YYYY (Date defaults the period, unless it is not within the range of the year)
    Order NumberCharacter15 characters maximum
    Inc/ExcCharacterY=Inclusive, N=Exclusive
    DiscountNumeric4 characters
    Invoice Message 1-3Character3 separate fields of 30 characters maximum each
    Delivery Address 1-5Character5 separate fields of 30 characters maximum each
    Sales Analysis CodeCharacter5 characters maximum
    Settlement Terms CodeCharacter00-32
    Job CodeCharacter5 characters maximum
    Closing DateCharacterDD/MM/YYYY, expiry date for quotes, and expected delivery date for orders
    TelephoneCharacter16 characters maximum
    ContactCharacter16 characters maximum
    FaxCharacter16 characters maximum
    Exchange RateNumericExchange rate
    DescriptionCharacter40 characters
    ExemptRefCharacter16 characters
    Address (1-5)Character30 characters
    Ship / DeliverCharacter16 characters
    FreightCharacter10 characters
    On HoldCharacterY=On hold, N=Not on hold

    For additional formatting options, please consult the Pastel SDK help file.

  • Lines

    A pipe-separated ("|") string that defines the lines of the document. Each line has the following layout:

    Cost PriceNumericUnit cost price
    QuantityNumericLine Quantity
    Unit Selling PriceNumericExclusive selling price per unit
    Inclusive PriceNumericInclusive selling price per unit
    UnitCharacter4 characters maximum
    Tax TypeCharacter00-30
    Discount TypeCharacter0=None, 1=Settlement, 2=Overall, 3=Both
    Discount PercentageCharacter4 characters, omit decimals, e.g. 12.5%=1250
    CodeCharacter15 characters maximum, inventory or GL
    DescriptionCharacter40 characters maximum
    Line TypeCharacter4=Inventory, 6=GL, 7=Remarks
    Multi-storeCharacter3 characters maximum
    Cost CodeCharacter5 characters maximum

    For additional formatting options, please consult the Pastel SDK help file.


A string value that contains the result of a successful import operation.