registerGuestBuyer(guestBuyerInput)
Registers a guest buyer account against a webstore.
registerGuestBuyer uses this Commerce API resource.
webstoreId—(Required) The ID of the webstore. The ID prefix is0ZE.accountId—(Required) The ID of the account to register as a guest buyer. The ID prefix is001.version—(Required) The API version for the adapter, for example,v62.0. Without this parameter, the call doesn’t fire.registerGuestBuyerInput—(Optional) The request body. Pass an empty object{}when no fields are required.
A Promise that resolves with a RegisterGuestBuyerOutput object with these fields:
success—Indicates whether the registration was successful. Check this field even when thePromiseresolves, because it can befalsewithout the call throwing an error.errors—A list of errors if the registration failed. Each error has these fields:errorCode—A machine-readable error code.message—A human-readable error message.errorEntityId—The ID of the entity the error relates to, when applicable.
registerGuestBuyer is an imperative function, not a @wire adapter. It performs a mutation and must be called in response to a user action.
Always check the success field on the resolved value. A resolved Promise doesn’t guarantee a successful registration. If the call itself fails, the Promise rejects with an error.