Overview
The SwervePay REST API provides standard HTTP 1.1 responses to client requests. The success or failure of a particular client request can be determined by the HTTP status code provided in the response header. It is extremely important that client applications check the status code on all responses and act accordingly. Successful responses will be indicated by an HTTP 200 Status code.

There are three types of results for any request resulting in a successful response.

  • Status-only responses (e.g., DELETE record)
  • Single-record responses (e.g., detail record GET request)
  • List responses (e.g., query for records)

The type of result will be defined in the associated resource specific documentation.

All unsuccessful (non-200) responses that occur in the client request processing will cause the server to return error data within the response metadata.

The Content-Type header of the response will dictate the response data format provided. The default Content-Type utilized is application/json (JSON) unless a different format is provided in the Accept header of the client request.

The content types the server will accept

  • application/json (JSON)
  • application/xml (XML)

Below is the overview of formatting concepts for each content type.

JSONXML
The entire response payload will be encapsulated in a hash.The entire response payload will be encapsulated within an outermost parent element named <responseRecord>.
The response hash will include a (possibly empty) child hash under a key named metadata.The response record will include a (possibly empty) element named <metadata>.
Single-record responses will be provided in a child hash of the main response hash. The key for this record hash will be determined by the specific resource.Single-record responses will be provided in a child element of the main response element. The element name will be determined by the specific resource.
List responses will be provided in a child array of hashes, with each hash in this array containing a single response record. The key for this array will be determined by the specific resourceList responses will be provided in an ordered list of child elements of the same name, with each element containing a single response record. The element name will be determined by the specific resource.