Skip to content

fix(customers): update the customer with its own phone number - #73

Open
roncodes wants to merge 1 commit into
mainfrom
fix/update-customer-own-phone
Open

roncodes wants to merge 1 commit into
mainfrom
fix/update-customer-own-phone

Conversation

@roncodes

@roncodes roncodes commented Nov 6, 2026

Copy link
Copy Markdown
Member

Summary

Customers / Update Authenticated Customer sent "phone": "{{customer_phone}}". That's +15555550123, the number of the customer the contract seeds. The session, though, belongs to the customer Create a Customer makes with {{$randomPhoneNumber}}.

Fleet-Ops 0.7.0 (fleetbase/fleetops#420) refuses to move a number another account holds, and needs a code sent to the new number for any change. So the request answered 422 Changing your phone number needs a valid verification code. The API is right, and the request was asking to take another account's number.

  • Create a Customer keeps the number it created the account with, in created_customer_phone.
  • Update Authenticated Customer sends that back, so it stays a profile update.
  • The description and params document phone_code, which is required when the number changes, and the refusal for a number another account holds.

customer_phone itself is unchanged, because Request Customer Login SMS and Request Customer Creation Code use it for the seeded customer.

Related Issue

Found by a local contract run of the Laravel 12 release train.

Type of Change

  • Bug fix

Implementation Notes

Fleet-Ops 0.7.0 also adds POST /customers/me/phone-code to send that code. This collection doesn't cover it yet. Adding a request means regenerating the fleetbase-php contract manifest and SDK examples, so it's a separate change.

Validation

  • Lint
  • Manual validation
npm run postman:lint
  Fleetbase API, Core API, Integrated Vendor Flow, Ledger API, Storefront API: No issues found. Errors: 0

Fleetbase API collection against a local Laravel 12 stack (fleetbase#749, core-api 2.0, fleetops 0.7.0):
  before: Customers / Update Authenticated Customer -> 422
  after:  Customers / Update Authenticated Customer -> Pass

The "after" run reused the earlier run's database. Its other failures (Create a Vehicle 500 and its cascade) come from a unique engine_number sent twice, and pass on a fresh database.

Documentation Impact

  • No documentation changes needed
  • Documentation updated in fleetbase/fleetbase.io
  • Documentation needed but not included

No request is added or removed, so expected_requests in fleetbase-php's contract-lock.json and the fleetbase.io catalog are unaffected. The generated reference picks up the new phone_code param and the changed body on its next regeneration.

Update Authenticated Customer sent {{customer_phone}}, the seeded customer's number,
from a session for the customer Create a Customer made with a random number. Fleet-Ops
0.7.0 refuses to move a number that another account holds, and needs a code sent to
the new number for any change, so the request answered 422.

Create a Customer now keeps the number it created the account with, and the update
sends that back. The params and description document `phone_code`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant