Exceptions

Commerce API returns exceptions in the HTTP response body when something goes wrong. The format of the message is application/problem+json media type and the response body will contain the following members:

An exception has the following properties:

Property

Description

type

A URI that identifies the problem detail type

title

A short human-readable summary about the problem

status

The HTTP status code for the exception.

detail

A human-readable explanation about the problem

instance

A reference code that identifies the specific occurrence of the problem

Exception example

{
    "type": "https://docs.progleasing.com/errors#error221"
    "title":""
    "status":"403"
    "detail":""
    "instance":""
}

A Model Validation exception has the following properties:

Property

Description

errors

An array of errors encountered. Each error present contains s field title and the validation error or errors associated with that field.

title

A short human-readable summary about the problem

status

The HTTP status code for the exception.

traceId

A reference code that identifies the specific occurrence of the problem

Model Validation Exception example

{
   "errors":{
      "To":[
         "The 'To' field is required."
      ],
      "From":[
         "The 'From' field is required."
      ]
   },
   "title":"Field Validation Error",
   "status":"403",
   "traceId":"7384833-9003-ff00-b63f-7374889300ff"
}

Did this page help you?