# Wiki source code of Implementation Guide: Cusin

Last modified by Fredrik Nilsson on 2026/05/05 12:40

#### Export

#### Office Formats

Export as PDF Export as ODT Export as RTF

#### Other Formats

Select the pages to export:

select all / none

Export as HTML
Show last authors

1 | = Introduction =
2 |
3 | (% class="jumbotron" %)
4 | (((
5 | (% class="container" %)
6 | (((
7 | This is a general step-for-step implementations guide that guide you through the creation of the CUSIN file that contains your invoice information.
8 | )))
9 | )))
10 |
11 | == Prerequisites ==
12 |
13 | Before you start implementing PayEx Invoice Service the following is required:
14 |
15 | * A sFTP Client
16 | * An agreement that includes PayEx Invoice Service (CUSIN)
17 | * Obtained credentials from PayEx
18 | * A basic understanding of [[file name convention and file format limitations>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.Cusin.WebHome||anchor="HNameconvention"]]
19 |
20 | Pease contact us if you have any questions on how to get started.
21 |
22 | == Overview ==
23 |
24 | Before getting started, have a look at the high level sequence diagram below, which will help you getting a better understanding of the whole process and the components necessary to implement Invoice Service.
25 |
26 | The invoice process using CUSIN is designed to operate batch-wise where multiple invoices are to be handled and sent to PayEx in a single file.
27 |
28 | {{plantuml}}
29 | @startuml
30 | skinparam sequence{
31 | ArrowColor #2DA944
32 | ActorFontColor #333333
33 | ActorFontStyle bold
34 | ActorFontSize 15
35 | ActorBackgroundColor #fefefe
36 | ActorBorderColor #2DA944
37 | LifeLineBorderColor #999999
38 | LifeLineBackgroundColor #dddddd
39 | ParticipantBorderColor #2DA944
40 | ParticipantBackgroundColor #ffffff
41 | ParticipantFontColor #333333
42 | ParticipantFontStyle bold
43 | }
44 | skinparam Roundcorner 10
45 | skinparam Shadowing false
46 | skinparam ActivityBorderColor #123123
47 | skinparam NoteBackgroundColor white
48 | skinparam NoteBorderColor #999999
49 | skinparam NoteFontColor #333333
50 | skinparam sequenceDividerBackgroundColor white
51 | skinparam sequenceDividerBorderColor #999999
52 | skinparam sequenceDividerFontStyle bold
53 | skinparam sequenceDividerFontSize 15
54 | '//Sequence start//'
55 | |||
56 | Customer->Company: Purchase information processed via Company's ERP
57 | |||
58 | Activate Customer
59 | ==[[/xwiki/wiki/developer/view/Main/Invoicing/invoice-service/Implementation%20guide/#HInvoicing Invoicing]]==
60 | Activate Company
61 | Activate PayEx
62 | Company->PayEx: Create <Cusin>
63 | PayEx->Company: Receive <Receipt>
64 | PayEx->Company: Receive <Errorlog>
65 | Deactivate Company
66 | PayEx->Customer: Distribute <Invoice>]
67 | |||
68 | Deactivate Customer
69 | hnote over Company: Invoice gets payed/closed or continues in claim process
70 | |||
71 | ==[[/xwiki/wiki/developer/view/Main/Invoicing/invoice-service/Implementation%20guide/#HReportsandAccounting Reports and Accounting]]==
72 | PayEx->Company: Receive <Bill Journal>
73 | Activate Company
74 | PayEx->Company: Receive <Customer Journal>
75 | PayEx->Company: Receive <SIE4>]
76 | PayEx->Company: Receive <ARAccounting>
77 | PayEx->Company: Receive <Balance Report>
78 | Deactivate PayEx
79 | Deactivate Company
80 | |||
81 | '//Sequence end//'
82 | @enduml
83 | {{/plantuml}}
84 |
85 | (% id="HWhatyoushoulddo2Cstepbystep." class="wikigeneratedid" %)
86 | All main steps of the invoice process are described below. **Please note** that all XML examples below are here primarily for display purposes, to help you get an understanding of the CUSIN file format and to aid you in the implementation.
87 |
88 | If you encounter any problem during implementation, don't hesitate to [[contact us>>mailto:invoice.client@payex.com]].
89 |
90 | == Invoicing ==
91 |
92 | The initial step is to create your [[CUSIN >>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.Cusin.WebHome]]file.
93 |
94 | === Cusin ===
95 |
96 | The first thing you need to do is to create a CUSIN file with extension .XML and UTF-8 encoding. Name it according to the filename convention.
97 |
98 | Head over to our [[technical reference section>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.Cusin.WebHome]] for a more extensive description of the file format, where you find more information of each element in the XML schema and CUSIN example file.
99 |
100 | **Please note! **If there are multiple invoices to be handled at the same time: do not send one invoice per file. We strongly suggest to batch them together in one single file. This will also speed up the process of creating and distributing the invoices.
101 |
102 | To learn more of how to edit invoice column length and use summary rows, visit the [[Invoice columns section>>url:https://developer.payex.com/xwiki/wiki/developer/view/Main/Invoicing/invoice-service/Invoice%20columns/]].
103 |
104 | (% class="wikigeneratedid" id="HTransferringfilestoPayEx" %)
105 | When you have a complete and validated CUSIN file, you are ready to transfer it to PayEx via sFTP.
106 |
107 | (% class="wikigeneratedid" %)
108 | Upon reception PayEx will process the file and send you a receipt in return. If something went wrong, you will also receive an error log.
109 |
110 | === Receipt ===
111 |
112 | When the CUSIN file, containing one or more activities - is processed a receipt will be created showing numbers of processed customers, numbers of processed invoices and total amount. A receipt is created for each file you send.
113 |
114 | Each activity has their own set of result parameters
115 |
116 | You can view the XSD and a detailed description [[here>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.Receipt.WebHome]].
117 |
118 | === Error log ===
119 |
120 | If errors are encountered during file processing an errorlog will be created. Errors may refer to insufficient customer information, invoice information or format errors. An error log is created for each file you send.
121 |
122 | The first part displays the processed item itself.
123 |
124 | The second part of the error log displays the response item message element that gives reference back to the processed file.
125 |
126 | You can view the XSD and a detailed description [[here>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.Errorlog.WebHome]].
127 |
128 | === (% style="color:inherit; font-family:inherit; font-size:23px" %)Invoice generation(%%) ===
129 |
130 | When you have transfered your CUSIN file to PayEx and it has been processed successfully the end result will look similar to the invoice example below.
131 |
132 | **Click on the invoice image to download the full PDF invoice example.** If you want to learn more about customizing your invoice, head over to our section that cover [[additional features and functions>>doc:Main.Invoicing.invoice-service.Implementation guide.Supplementary features.WebHome]].
133 |
134 | == [[image:invoice-example.PNG]] ==
135 |
136 | == Reports and Accounting ==
137 |
138 | You get response files from PayEx in the from of Bill and Customer Journal.
139 |
140 | === Bill Journal ===
141 |
142 | Bill Journal is the format used to notify changes in invoice status. Entries could relate to events such as a new claim process level, invoices getting closed and newly registered complaints and respites.
143 |
144 | You find the Bill Journal technical reference [[here>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.BillJournal.WebHome||anchor="HBillJournal"]].
145 |
146 | === Customer Journal ===
147 |
148 | Customer Journal is the format used to notify changes in customer information. Entries could relate to events such as a new legal address, activation/cancellation of consent and customer status changes due to decease.
149 |
150 | You find the Customer Journal technical reference [[here>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.CustomerJournal.WebHome||anchor="HCustomerJournal"]].
151 |
152 | === Accounting Detail ===
153 |
154 | Bookkeeping data is produced on two levels. You get accounting records on the transactional level as well as aggretated in the standardised SIE format type 4.
155 |
156 | Files are exported from PayEx on a daily schedule.
157 |
158 |
159 | **The Accounting Detai**l file describes the accounting records on the transaction level and Includes invoice number, book account, amount, value date, etc.
160 |
161 | You find the Accounting Detail technical reference [[here>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.6\. ARAccountingDetail.WebHome||anchor="HAccountingDetail" style="background-color: rgb(255, 255, 255);"]].
162 |
163 |
164 | **The SIE4** **file **describes the accounting records on an aggregated level, that includes total amounts per book account.
165 |
166 | You find the SIE4 technical reference [[here>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.SIE4.WebHome||anchor="HSIE4" style="background-color: rgb(255, 255, 255);"]].
167 |
168 | (% id="HBalanceReport" %)
169 | === Balance Report ===
170 |
171 | The [[Balance Report (Client Asset Disbursement)>>doc:Main.Invoicing.invoice-service.Implementation guide.Technical reference.BalanceReport.WebHome||anchor="HBalanceReport"]] includes:
172 |
173 | * **A payment summary** of amount sold, fees and, VAT and specification of total amount to be paid out.
174 | * **A sales specification**. Each record of "Client asset disbursement" listed is equal to the full Accounting Detail for the specified period.
175 | * (((
176 | **A Fees specification.** Depending on setup, fees are either deducted from the amount to be paid out, or (when applicable) to be invoiced separatly.Each fees row specify Quantity (sales), Amount (sales), Unit price, Provision and fee Amount.
177 | )))