Transaction Error

Description

A validation error.

Properties

Property Description
detail

A longer description of of the error encountered.

info

Additional information that may be provided to aid in error resolution.

Property Description
errors

If the error response is a result of validation errors, it will most likely be a 400 Bad Request response and contain this info.errors property. Each property name in the errors object is a property that failed validation. These properties contain objects with property names in the form of internal validation error message slugs paired with human-readable string values describing the validation failure. Each property may have multiple validation failure messages.

reason

An optional reason for the error response.

In some cases, more information is required to convey information about the error to the client. In these cases, one of the following reason slugs may be used.

Reason Slug Description
contract-not-ready-to-countersign The contract is in a state that does not allow countersigning. Its status must be ready-to-countersign to perform this action.
event-photo-count-limit The event has reached the maximum number of photos allowed.
plan-does-not-allow-uploads The studio is in a plan that does not allow uploads or they have reached the limit of photos the plan allows.
transactionErrors

If the error response includes credit card transaction errors that cannot be related back to a value on the request, this info.transactionErrors object is included. The response will be a 400 Bad Request response and contain this info.transactionErrors property.

Each property name in the transactionErrors object is a key that identifies a unique transaction error type. The value is a human-readable string in English language only, which could be displayed in a client if necessary. Otherwise, it is recommended that the client switch on the transactionErrors key names to display a translated error message in the end user's preferred language describing the error that occurred.

Possible info.transactionErrors keys:

  • noResponseReceived: No response received from payment gateway.
  • declined: Transaction was declined.
  • gatewayRejected: The payment gateway rejected transaction.
  • unexpected: An unexpected error occurred; value will be raw error message directly from the payment gateway.
status

The HTTP status code associated with this error.

title

A short description of the error encountered.

type

A namespace URI uniquely identifying the error type.

OpenAPI Schema

The following schema is based on OpenAPI 3.0 and is provided in our downloadable OpenAPI document.

{
  "description": "A validation error.",
  "properties": {
    "detail": {
      "description": "A longer description of of the error encountered.",
      "example": "There was a problem with your request. Please see `info` for more information.",
      "type": "string"
    },
    "info": {
      "description": "Additional information that may be provided to aid in error\nresolution.",
      "properties": {
        "errors": {
          "description": "If the error response is a result of validation errors, it\nwill most likely be a `400 Bad Request` response and contain\nthis `info.errors` property. Each property name in the\n`errors` object is a property that failed validation. These\nproperties contain objects with property names in the form\nof internal validation error message slugs paired with\nhuman-readable string values describing the validation\nfailure. Each property may have multiple validation failure\nmessages.",
          "example": {
            "name": {
              "notUnique": "The name must be unique"
            },
            "type": {
              "isEmpty": "Value is required and can't be empty"
            }
          },
          "type": "object"
        },
        "reason": {
          "description": "An optional reason for the error response.\n\nIn some cases, more information is required to convey information\nabout the error to the client. In these cases, one of the following\nreason slugs may be used.\n\n| Reason Slug | Description |\n| ----------- | ----------- |\n| `contract-not-ready-to-countersign` | The contract is in a state that does not allow countersigning. Its status must be `ready-to-countersign` to perform this action. |\n| `event-photo-count-limit` | The event has reached the maximum number of photos allowed. |\n| `plan-does-not-allow-uploads` | The studio is in a plan that does not allow uploads or they have reached the limit of photos the plan allows. |",
          "enum": [
            "contract-not-ready-to-countersign",
            "event-photo-count-limit",
            "plan-does-not-allow-uploads"
          ],
          "type": "string"
        },
        "transactionErrors": {
          "description": "If the error response includes credit card transaction\nerrors that cannot be related back to a value on the\nrequest, this `info.transactionErrors` object is included.\nThe response will be a `400 Bad Request` response and\ncontain this `info.transactionErrors` property.\n\nEach property name in the `transactionErrors` object is a\nkey that identifies a unique transaction error type. The\nvalue is a human-readable string in English language only,\nwhich could be displayed in a client if necessary.\nOtherwise, it is recommended that the client switch on the\n`transactionErrors` key names to display a translated error\nmessage in the end user's preferred language describing the\nerror that occurred.\n\nPossible `info.transactionErrors` keys:\n\n* `noResponseReceived`: No response received from payment\ngateway.\n* `declined`: Transaction was declined.\n* `gatewayRejected`: The payment gateway rejected\ntransaction.\n* `unexpected`: An unexpected error occurred; value will be\nraw error message directly from the payment gateway.",
          "type": "object"
        }
      },
      "type": "object"
    },
    "status": {
      "description": "The HTTP status code associated with this error.",
      "example": 400,
      "type": "integer"
    },
    "title": {
      "description": "A short description of the error encountered.",
      "example": "Bad Request",
      "type": "string"
    },
    "type": {
      "description": "A namespace URI uniquely identifying the error type.",
      "example": "https://developer.shootproof.com/errors#error-bad-request",
      "format": "uri",
      "type": "string"
    }
  },
  "type": "object"
}