Skip to content

Submit a store check

POST
/{currentTeam}/audit-types/{auditType}/submissions
curl --request POST \
--url https://api.tradeops.cc/v1/example/audit-types/1/submissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "customer_id": 1, "submission_ulid": "example", "data": { "additionalProperty": "example" }, "latitude": 1, "longitude": 1, "status": "in_progress" }'

Scores the answers, starts any workflows and returns the saved check. Only checklists that reps can start themselves accept submissions here.

currentTeam
required
string

The current team slug

auditType
required
integer

The audit type ID

include
Array<string>
Allowed values: auditType auditType.fields auditType.fields.auditType auditType.fields.auditType.fields auditType.fields.auditType.fields.auditType customer customer.locations
fields[submissions]
Array<string>
Allowed values: data status score max_score latitude longitude submitted_at reviewed_at review_notes created_at updated_at
fields[audit_types]
Array<string>
Allowed values: name slug description icon color status settings created_at updated_at
fields[fields]
Array<string>
Allowed values: name label type section options validation order required score_weight conditional
fields[customers]
Array<string>
Allowed values: name slug number type channel region territory address city parish latitude longitude contact_name contact_phone contact_email metadata is_active created_at updated_at
fields[customer_locations]
Array<string>
Allowed values: name address city state_province latitude longitude contact_name contact_phone contact_email is_primary is_active created_at updated_at
Media typeapplication/json
StoreSubmissionRequest
object
customer_id
required

The customer’s numeric id from the sync package. Optional when the checklist doesn’t need a customer.

integer
submission_ulid
string | null
data
required

Answers keyed by field name. Each field’s type sets what its value looks like.

object
key
additional properties
latitude
number | null
>= -90 <= 90
longitude
number | null
>= -180 <= 180
status
string
Allowed values: in_progress submitted

SubmissionResource

Media typeapplication/vnd.api+json
object
data
required
SubmissionResource
object
id
required
string
type
required
string
Allowed value: submissions
attributes
object
data
object
status
string
score
string | null
max_score
string | null
latitude
string | null
longitude
string | null
submitted_at
string | null format: date-time
reviewed_at
string | null format: date-time
review_notes
string | null
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
auditType
object
data
required
object
id
required
string
type
required
string
Allowed value: audit_types
customer
object
data
required
object
id
required
string
type
required
string
Allowed value: customers
links
required
object
self
required
string
included
Array
Any of:
AuditTypeResource
object
id
required
string
type
required
string
Allowed value: audit_types
attributes
object
name
string
slug
string
description
string | null
icon
string | null
color
string | null
status
string
settings
object
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
fields
object
data
required
Array<object>
object
id
required
string
type
required
string
Allowed value: fields
links
required
object
self
required
string

Example

{
"data": {
"type": "submissions",
"relationships": {
"auditType": {
"data": {
"type": "audit_types"
}
},
"customer": {
"data": {
"type": "customers"
}
}
}
},
"included": [
{
"type": "audit_types",
"relationships": {
"fields": {
"data": [
{
"type": "fields"
}
]
}
}
}
]
}

Unauthenticated

Media typeapplication/json
object
message
required

Error overview.

string

Example generated

{
"message": "example"
}

Authorization error

Media typeapplication/json
object
message
required

Error overview.

string

Example generated

{
"message": "example"
}

Not found

Media typeapplication/json
object
message
required

Error overview.

string

Example generated

{
"message": "example"
}

Validation error

Media typeapplication/json
object
message
required

Errors overview.

string
errors
required

A detailed description of each field that failed validation.

object
key
additional properties
Array<string>

Example generated

{
"message": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}

Too many requests. Wait for Retry-After seconds before trying again.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}
Retry-After
integer

Seconds until you can try again.