Introduction

PayEx CUSIN is a file format for customers to send customer and invoice information to PayEx. 

What you need before you get started

  • sFTP Client
  • Agreement that includes PayEx CUSIN
  • Obtained credentials from PayEx
  • Basic understanding of file name convention and file format limitations

To get a grasp of what we expect of your implementation when you are finished, we recommend that you take a peek at the following diagram before you get started.

 insert fancy diagram here

What you should do, step by step

Below is an example provided in .XML

Note that the example is for a basic usage of the file format. It is provided to help understanding the file format and give the implementation a head start. For more extensive usage of the file format, head over to the API reference.

If you encounter any problem with the implementation, please visit the troubleshooting section.

Step 1 Create file and add XML declaration

Create a file with extension .XML and UTF-8 encoding. Name it according to the filename convention.

Add a row on root level with XML declaration, with XML-version 1.0 and UTF-8 encoding.

You can read more about this here.

Filename: CUSIN_<CompanyNumber>_<DateTime>_<SerialNumber>.XML

  <︖xml version="1.0" encoding="utf-8"︖> (xwiki eats the declaration while using default question mark)

Step 2 Add CUSIN Header

Add a CUSIN Header at root level with the following attributes.

  • XSD version
  • Createion date and time
  • Company number
  • Company name

You can read more about this here.

 <︖xml version="1.0" encoding="utf-8"︖>
 <CUSIN Version="2.0" CreatedDateTime="2017-12-07T14:54:55" CompanyName="Test Company" CompanyNo="9999">
 </CUSIN>

Step 3 Distribution Date

Set your distribution date.

Add a child element DistributionDate. This can be set to a date (in the future) of your choosing or you can leave it up to us.

In this example we have set the value toAsSoonAsPossible.

You can read more about this here

<︖xml version="1.0" encoding="utf-8"︖>
<CUSIN Version="2.0" CreatedDateTime="2017-12-07T14:54:55" CompanyName="Test Company" CompanyNo="9999">
<DistributionDate>
<AsSoonAsPossible />
</DistributionDate>
</CUSIN>

Step 4 CUSINInfo

Define CUSINInfo per customer.

In order to define the CUSINInfo per customer you need to do add the following child elements:
Add CustomerNo, CustomerInfo and Invoices to the CUSINInfo parent.

You can read more about this here.

We will go into more details related to CustomerInfo element and Invoices element in the coming steps.
 

<︖xml version="1.0" encoding="utf-8"︖>
<CUSIN Version="2.0" CreatedDateTime="2017-12-07T14:54:55" CompanyName="Test Company" CompanyNo="9999">
<DistributionDate>
<AsSoonAsPossible />
</DistributionDate>
<CUSINInfo>
<CustomerNo>1</CustomerNo>
<CustomerInfo/>
<Invoices/>
</CUSINInfo>
</CUSIN>

Step 5 Customer info

In order to define the CustomerInfo per customer you need to do add the following child elements:
Add Name, RegNo, DistributionAddressInfo, PaymentInfo and  DistributionInfo to the CustomerInfo parent.

You can read more about this here.


<︖xml version="1.0" encoding="utf-8"︖>
<CUSIN Version="2.0" CreatedDateTime="2017-12-07T14:54:55" CompanyName="Test Company" CompanyNo="9999">
<DistributionDate>
 <AsSoonAsPossible />
</DistributionDate>
<CUSINInfo>
 <CustomerNo>1</CustomerNo>
 <CustomerInfo>
  <Name>Firstname Lastname</Name>
  <RegNo CountryCode="SE">400513-0564</RegNo>
  <DistributionAddressInfo>
   <Addresses>
    <Address AddressType="LegalAddress">
     <Addressee>Firstname Lastname</Addressee>
     <StreetAddress>Street 2</StreetAddress>
     <ZipCode>12345</ZipCode>
     <City>Big city</City>
     <CoAddress>CoAdress</CoAddress>
     <CountryCode>SE</CountryCode>
    </Address>
    <Address AddressType="BillingAddress">
     <Addressee>Firstname Lastname</Addressee>
     <StreetAddress>Another street 10</StreetAddress>
     <ZipCode>53214</ZipCode>
     <City>Big city</City>
     <CoAddress>CoAdress</CoAddress>
     <CountryCode>SE</CountryCode>
    </Address>
   </Addresses>
   <E-MailAddress>test@test.com</E-MailAddress>
  </DistributionAddressInfo>
  <PaymentInfo>
   <Set>
    <PaymentRules>
     <PaymentRule Rule="UseBGAGSE">
      <Value>1</Value>
     </PaymentRule>
    </PaymentRules>
   </Set>
  </PaymentInfo>
  <DistributionInfo>
   <Set>
    <BillTypes>
     <BillType DistributionBillType="I_Invoice">
      <DistributionType>PostalService</DistributionType>
     </BillType>
    </BillTypes>
   </Set>
  </DistributionInfo>
 </CustomerInfo>
 <Invoices/>
</CUSINInfo>
</CUSIN>

Step 6 Invoices

In order to define the Invoice(s) per customer you need to do add the following child elements:
Add 1, 2, 3, 4 and  5 to the Invoices parent.

You can read more about this here.


<︖xml version="1.0" encoding="utf-8"︖>
<CUSIN Version="2.0" CreatedDateTime="2017-12-07T14:54:55" CompanyName="Test Company" CompanyNo="9999">
<DistributionDate>
<AsSoonAsPossible />
</DistributionDate>
<CUSINInfo>
<CustomerNo>1</CustomerNo>
<CustomerInfo>
<Name>Firstname Lastname</Name>
<RegNo CountryCode="SE">400513-0564</RegNo>
<DistributionAddressInfo>
<Addresses>
<Address AddressType="LegalAddress">
<Addressee>Firstname Lastname</Addressee>
<StreetAddress>Street 2</StreetAddress>
<ZipCode>12345</ZipCode>
<City>Big city</City>
<CoAddress>CoAdress</CoAddress>
<CountryCode>SE</CountryCode>
</Address>
<Address AddressType="BillingAddress">
<Addressee>Firstname Lastname</Addressee>
<StreetAddress>Another street 10</StreetAddress>
<ZipCode>53214</ZipCode>
<City>Big city</City>
<CoAddress>CoAdress</CoAddress>
<CountryCode>SE</CountryCode>
</Address>
</Addresses>
<E-MailAddress>test@test.com</E-MailAddress>
</DistributionAddressInfo>
<PaymentInfo>
<Set>
<PaymentRules>
<PaymentRule Rule="UseBGAGSE">
<Value>1</Value>
</PaymentRule>
</PaymentRules>
</Set>
</PaymentInfo>
<DistributionInfo>
<Set>
<BillTypes>
<BillType DistributionBillType="I_Invoice">
<DistributionType>PostalService</DistributionType>
</BillType>
</BillTypes>
</Set>
</DistributionInfo>
</CustomerInfo>
<Invoices>
<InvoiceWithDistribution>
<InvoiceNo>3210</InvoiceNo>
<InvoiceDate>2017-12-07</InvoiceDate>
<Amount Currency="SEK">
<AmountExclVat>1000.00</AmountExclVat>
<VatAmount>250.00</VatAmount>
</Amount>
<DistributionInfo>
<InvoicePrintInfo>
<InvoicePrintBlocks>
<StandardPrintBlock>
<BasePrintBlock>
<SubOrderBlocks>
<SubOrderBlock TableType="A7">
<ColumnHeadLine>
<Columns>
<Column ColumnNo="1">
<Text>Article</Text>
</Column>
<Column ColumnNo="2">
<Text>Description</Text>
</Column>
<Column ColumnNo="3">
<Text>Quantity</Text>
</Column>
<Column ColumnNo="4">
<Text>Unit</Text>
</Column>
<Column ColumnNo="5">
<Text>Unit Price</Text>
</Column>
<Column ColumnNo="6">
<Text>Discount</Text>
</Column>
<Column ColumnNo="7">
<Text>Amount</Text>
</Column>
</Columns>
</ColumnHeadLine>
<Rows>
<Row>
<Columns>
<Column ColumnNo="1">
<Text>231</Text>
</Column>
<Column ColumnNo="2">
<Text>Monthly fee</Text>
</Column>
<Column ColumnNo="3">
<Text>1.00</Text>
</Column>
<Column ColumnNo="4">
<Text></Text>
</Column>
<Column ColumnNo="5">
<Text>1000,00</Text>
</Column>
<Column ColumnNo="6">
<Text></Text>
</Column>
<Column ColumnNo="7">
<Text>1000,00</Text>
</Column>
</Columns>
</Row>
<Row>
<Columns>
<Column ColumnNo="1">
<Text> </Text>
</Column>
</Columns>
</Row>
</Rows>
</SubOrderBlock>
<SubOrderBlock TableType="A3">
<Rows>
<Row>
<Columns>
<Column ColumnNo="2">
<Text>Amount excl. VAT</Text>
</Column>
<Column ColumnNo="3">
<Text>1000,00</Text>
</Column>
</Columns>
</Row>
<Row>
<Columns>
<Column ColumnNo="2">
<Text>VAT</Text>
</Column>
<Column ColumnNo="3">
<Text>250,00</Text>
</Column>
</Columns>
</Row>
<Row>
<Columns>
<Column ColumnNo="2">
<Text>VAT 25%</Text>
</Column>
<Column ColumnNo="3">
<Text>250,00 (1000,00)</Text>
</Column>
</Columns>
</Row>
</Rows>
</SubOrderBlock>
</SubOrderBlocks>
</BasePrintBlock>
</StandardPrintBlock>
</InvoicePrintBlocks>
</InvoicePrintInfo>
</DistributionInfo>
</InvoiceWithDistribution>
</Invoices>
</CUSINInfo>
</CUSIN>

Validation

The XML-file must be validated with the lastest XML Schema Definition (XSD).
This is found here (provide  link).

Transfer the file

Step 7 FTP the file

Step X: Template

Lorem Ipsum

Text A

Text B

Created by Tore Aasebo on 2018/02/19 16:09