Understanding the structure of Straddle API responses
meta
: Contains metadata about the request.response_type
: Indicates the type of data returned (eg “object” or “array”).data
: Contains the actual payload of the response.data
property contains the main payload.response_type
is set to “object” for single item responses.data
contains an array of objects, typically with summarized information.response_type
is set to “array”.meta
includes additional pagination-related information.meta
object in paginated responses includes:
page_number
: Current page numberpage_size
: Number of items per pagetotal_items
: Total number of items across all pagessort_order
: Sorting order (“asc” or “desc”)sort_by
: Field used for sortingdata
property.response_type
is set to “error”.error
object provides details about the error.error
object in error responses includes:
status
: HTTP status code (integer)type
: Predefined general type of error (e.g., “/field_validation”)title
: Generic message for this type of issuedetail
: Specific message regarding this exact requestitems
: Array of error objects with more specific detailsitems
array contains:
reference
: Identifier for the error (e.g., field name, error code)detail
: Detailed description of the specific errorresponse_type
: Always check the response_type
to determine how to parse the response.
error
object in failed requests to provide meaningful feedback to users or for debugging.
api_request_id
: Log the api_request_id
for all requests. This is crucial for troubleshooting and communicating with Straddle support.
data
property.