Create vehicle record for member

POST /api/members/{memberId}/vehicle-details

Overview

Registers a vehicle registration against a member, so the plate can later be resolved back to the members holding it through Get members by vehicle registration. A member may hold several vehicles; each call adds one.

Spaces are stripped before the registration is saved, so AB12 CDE and AB12CDE become the same value and only one of them can be saved. The 15-character limit, however, is applied to the string exactly as you send it, spaces included — so a spaced plate close to the limit can be rejected for length even though the stripped form would have fitted. Send the registration without spaces to avoid both traps.

A member cannot hold the same registration twice: each pair of member and registration must be unique, and a repeat comes back as a 409. Two different members holding the same registration is allowed, which is why the reverse lookup returns a list of member ids rather than one.

The response is a bare 201 with no body — no vehicle id is returned. To get the id you need for Update vehicle record or Delete vehicle record, read the member's vehicles back with Get member vehicle details after creating. If your token identifies a member, the memberId in the path must be that member or one of their linked members; a mismatch is rejected with 403 before anything else is checked. Tokens that carry no member identity are not subject to that check.

Endpoint

POST {base_url}/api/members/{memberId}/vehicle-details

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
memberIdinteger (int32)YesThe member the vehicle is registered to. The member must already exist — if not, the request fails with 400 Member does not exist, not 404.

Request body

FieldTypeRequiredDescription
vehicleRegistrationstringYesThe number plate to register. Omitting it fails validation with A vehicle registration is required in this request, and more than 15 characters with The vehicle registration cannot be more than 15 characters — both counted on the raw string, before spaces are removed. The value is saved with all spaces stripped, and the reverse lookup strips them too, so formatting is not preserved and cannot be used to distinguish two registrations.

Sample request

cURL
curl -X POST '{base_url}/api/members/{memberId}/vehicle-details' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "vehicleRegistration": "string"
}'

Errors

StatusMeaningWhen
400Bad requestEither the body failed validation — registration missing, or longer than 15 characters — in which case the response is a validation error object keyed by field name rather than a plain string, or the member does not exist, in which case the body is the string Member does not exist. Note that an unknown member is reported here rather than as a 404.
409ConflictThe vehicle registration already exists against this member — this member already holds this registration once spaces are stripped, since each pair of member and registration must be unique. Nothing is saved. A registration already held by a different member is not a conflict and will be accepted.
500Internal server errorAn unexpected server-side failure while saving, other than the duplicate above. The body is empty, and because nothing about the new record is returned, read the member's vehicles back before retrying.

This page as markdown · All pages · llms.txt