LegitGrailsLegitGrails
Status unavailable
  • Developers
  • API Reference
Information
Catalog
    List brandsgetList categoriesgetList answer timesgetList photo indexesgetList modelsget
Photos
    Upload photospostSubmit requested photospost
Balance
    Get credit balanceget
Orders
    List ordersgetCreate an orderpostGet an ordergetSubmit requested photospost
Audit
    List account audit eventsget
Webhooks
    List webhook endpointsgetCreate a webhook endpointpostDelete a webhook endpointdelete
Schemas
LegitGrails API
LegitGrails API

Photos

Download schema

Upload source images and submit requested replacement images.


Upload photos

POST
https://api.legitgrails.com/v1/integrations
/photos
Bearer

Uploads one or more image files and returns one result per file in the same order. Send every part under the repeated field name photos.

HTTP 200 indicates that the batch was processed, not that every file uploaded. Check each result's status. An uploaded result contains a managed url that must be used in order or update-photo requests; a failed result contains an error and no url. Validation happens before upload, so an invalid file rejects the complete request rather than producing an individual failed result.

Supported image formats are JPEG, PNG, HEIC, HEIF, WebP, and AVIF. Send at most 10 files per request. Each file can be up to 100 MiB and must not exceed 8,000 pixels in either dimension or 50 megapixels.

Upload photos › Request Body

photos
​string[] · application/octet-stream · minItems: 1 · maxItems: 10 · required

Upload photos › Responses

One upload result per submitted file, including per-file failures.

​PhotoUploadResult[] · minItems: 1 · maxItems: 10
oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · status="uploaded" · requires: url, original_name
type = object · status="failed" · requires: original_name, error
Properties for Variant 1:
UploadedPhoto
status
​string · enum · required

The file uploaded successfully.

Enum values:
uploaded
url
​string · uri · pattern: ^https://media\.legi… · required

Managed URL to use unchanged in a subsequent order request.

original_name
​string · required

Filename supplied for the multipart part.

POST/photos
curl https://api.legitgrails.com/v1/integrations/photos \ --request POST \ --header 'Content-Type: multipart/form-data' \ --header 'Authorization: Bearer <token>' \ --form 'photos=string'
Example Request Body
{ "photos": [ "string" ] }
text
Example Responses
[ { "status": "uploaded", "url": "https://media.legitgrails.com/uploads/tusd/example-photo", "original_name": "overall-picture.jpg" } ]
json
application/json

Submit requested photos

POST
https://api.legitgrails.com/v1/integrations
/orders/{id}/update_photos
Bearer

Resolves the current photos_to_resubmit request for an order selected by LegitGrails UUID or external_id.

Every requested index_code must appear. For each entry, supply exactly one of url or is_unable_to_provide: true. Multiple URL entries may use the same index up to its max_photos; an unable-to-provide entry must be the sole entry for its index. Every URL must be a managed URL returned by POST /photos; other URLs are rejected.

Acceptance is reported with HTTP 202 and status: accepted.

Submit requested photos › path Parameters

id
​string · minLength: 1 · required

LegitGrails order UUID or an external_id supplied when creating the order.

Submit requested photos › Request Body

SubmitUpdatePhotosRequest
​SubmitUpdatePhoto[] · minItems: 1 · maxItems: 75 · required

Entries resolving every requested index. Repeated URL entries for one index are allowed up to its max_photos.

note
​string · maxLength: 1000

Optional note about the submitted photos.

Submit requested photos › Responses

The complete photo-update response was accepted.

SubmitUpdatePhotosResponse
id
​string · uuid · required
status
​string · enum · required
Enum values:
accepted
POST/orders/{id}/update_photos
curl https://api.legitgrails.com/v1/integrations/orders/:id/update_photos \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "photos": [ { "index_code": "overall-picture", "url": "https://media.legitgrails.com/uploads/tusd/example-replacement" }, { "index_code": "serial-number", "is_unable_to_provide": true } ], "note": "The serial-number label is no longer attached to the item." }'
Example Request Body
{ "photos": [ { "index_code": "overall-picture", "url": "https://media.legitgrails.com/uploads/tusd/example-replacement" }, { "index_code": "serial-number", "is_unable_to_provide": true } ], "note": "The serial-number label is no longer attached to the item." }
json
application/json
Example Responses
{ "id": "6a21d480-38ac-4cc3-9c0c-bd0145b687af", "status": "accepted" }
json
application/json

CatalogBalance