moov-io / imagecashletter

X9’s Specifications for ICL (Image Cash Letter) to provide Check 21 services. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/imagecashletter/
Apache License 2.0
64 stars 39 forks source link

ImageReferenceKey should be numeric (no spaces) #179

Open neilmanley opened 3 years ago

neilmanley commented 3 years ago

Actual: 123, Expected: 0123, according to X9Validator.

What were you trying to do? Create X9.37 files for mobile check deposit. What did you expect to see? No warnings/errors on the X9 file What did you see? A warning that the ImageReferenceKey should be numeric values (no spaces) How can we reproduce the problem? Validate using X9Validator (https://x9ware.com/)

atonks2 commented 3 years ago

Thanks for documenting this @neilmanley! I'll reference a couple versions of ICL specs to see if this field is consistent between them.

atonks2 commented 3 years ago

I started looking into this field and it's not clear to me whether this field should allow spaces. A couple references to it in X9.100-187-2016:

Each record containing an ImageReferenceKey specifies it as Type: ANS Alphameric/special and describes it as:

The Image Reference Key is a data string or value that is used to find the image of the item in the image archive system (for example, it may be a URL).

From Annex H:

The Image Reference Key is a number or set of data values, assigned by the creator of the record

@neilmanley have you stumbled across any addition information on this? From what I'm reading I'm inclined to leave the field as alphanumeric to provide flexibility. One modification I could see making, however, would be to check and see if the field only contains numeric chars. We could make sure that if the field is numeric we include a leading 0 instead of a space where needed.

adamdecaf commented 3 years ago

Do we have a definition of what "set of data values" is in this context?

atonks2 commented 3 years ago

Do we have a definition of what "set of data values" is in this context?

I couldn't find anything more detailed. The most specific statement I found is above that quote, where it says it could be a URL.

adamdecaf commented 3 years ago

We could offer a function or two that can return a properly formatted alphanumeric string and another that returns a parsed number.

ImageReferenceKeyNumber() *int64
atonks2 commented 3 years ago

I found another example, this one in IBM's docs:

...this value is set to the concatenation of the 8–character business date, 15–digit ISN, and the 2–character business category.

adamdecaf commented 3 years ago

I assume the "2–character business category" is an integer?

atonks2 commented 3 years ago

I assume the "2–character business category" is an integer?

I'm not sure. There's no reference to business category in the X9 spec, so I just looked more into that IBM doc. They use "Business Category" as the value for record 52's (Image View Data Record) Cycle Number. The spec for cycle number says it's a conditional, alphanumeric code "assigned by the institution that creates the bundle". IBM says in their case it's "assigned by the Gateway for this transaction".