python-sepaxml icon indicating copy to clipboard operation
python-sepaxml copied to clipboard

How to use the structured reference field for a SEPA payment?

Open haimat opened this issue 3 years ago • 9 comments

In SEPA PAIN.001 standard there are two fields for payment references - structured (<Strd>) and unstructured (<Ustrd>). Here in python-sepaxml one can use the description field in the payment information for the latter. But how can I fill the structured reference?

haimat avatar Dec 22 '22 10:12 haimat

Might be not implemented, at least I haven't used it yet.

raphaelm avatar Dec 22 '22 12:12 raphaelm

Seems so, I haven't found anything like <Strd> in the code. Just wondering - isn't that something, which is used very often?

haimat avatar Dec 22 '22 12:12 haimat

🤷‍♂️ I have not noticed it in the wild yet, but I haven't specifically looked either

raphaelm avatar Dec 22 '22 15:12 raphaelm

Interesting, at least here in Austria we use it a lot :-)

haimat avatar Dec 22 '22 16:12 haimat

Did you close this on purpose? it might be a valid addition to the library (even though I unlikely have time for it)

raphaelm avatar Dec 22 '22 21:12 raphaelm

I am not very good with XML, so I might not be of much help here. But after talking to our bank and testing it with various examples, I can at least describe how it should be. So with an unstructured reference, using the description field for a payment in python-sepaxml, we end up with this:

        <RmtInf>
          <Ustrd>This is an unstructured reference</Ustrd>
        </RmtInf>

And for a structured reference we instead need this:

        <RmtInf>
          <Strd>
            <CdtrRefInf>
              <Tp>
                <CdOrPrtry>
                  <Cd>SCOR</Cd>
                </CdOrPrtry>
              </Tp>
              <Ref>617094556122022</Ref>
            </CdtrRefInf>
          </Strd>
        </RmtInf>

The <Cd> is always this value of "SCOR", and the reference number should be in the <Ref> element. If you just replace the former with the latter, everything works fine. Note, however, that you are not allowed to use both structured and unstructured references for the same payment by SEPA standard.

Hope this helps!

haimat avatar Dec 23 '22 11:12 haimat

closed by accident

raphaelm avatar Apr 08 '23 20:04 raphaelm

I developed a little soft based on your code that could generate a xml sepa file with the fields payment references sepaxml.com available in multi-language

BenjoNX avatar Oct 29 '23 10:10 BenjoNX