paytrail / api-documentation

Paytrail Payment API documentation
MIT License
6 stars 11 forks source link

vatPercentage cannot be zero? #100

Closed martin55 closed 4 months ago

martin55 commented 11 months ago

Describe the bug

Payload schema doesn't accept item's 'vatPercentage' when it's zero (0).

In docs vatPercentage is described with type 'integer' therefore it should accept also 0. My customer's use case also requires it to be zero.

Steps to Reproduce

Send create request with items e.g.

"items": [
    {
      "unitPrice": 1590,
      "units": 1,
      "vatPercentage": 0,
      "productCode": "#927502759",
      "stamp": "10743336-b969-4d5c-87f7-0ef8594d24ef"
    }
  ],

Expected behaviour

It should not throw any validation error.

Actual behaviour

It returns schema validation error.

Request payload schema validation failed. Validate request against the provided schema. 
[ "instance.items[0] requires property \"vatPercentage\"" ]
jfrojd-paytrail commented 10 months ago

Hi @martin55 .

VatPercentage of 0 is accepted and is a supported. I cannot reproduce this issue in testing, can you please provide a full payload you are sending or the value of the request-id header in the error response you are getting?