Skip to Content

BuyerIdentityInput

Input for buyer identity information.

Input Definition

input BuyerIdentityInput { email: String phone: String countryCode: String }

Fields

FieldTypeRequiredDefaultDescription
emailStringNoNoneThe email address of the buyer
phoneStringNoNoneThe phone number of the buyer
countryCodeStringNoNoneThe country code for the buyer (ISO 3166-1 alpha-2)

Usage Examples

Basic Usage

mutation { updateBuyerIdentity(input: { email: "jane.doe@example.com" }) { buyer { email phone countryCode } } }

Complex Input

mutation { updateBuyerIdentity(input: { email: "john.smith@example.com" phone: "+14155552671" countryCode: "US" }) { buyer { email phone countryCode } } }

With Variables

mutation UpdateBuyerIdentity($buyerInput: BuyerIdentityInput!) { updateBuyerIdentity(input: $buyerInput) { buyer { email phone countryCode } } }
{ "buyerInput": { "email": "alice.williams@example.com", "phone": "+442071838750", "countryCode": "GB" } }

Nested Objects

This input type does not contain nested objects.

Validation Rules

  • email must be a valid email address format if provided.
    Example: "user@example.com"
    Invalid example: "user@@example" will cause a validation error.

  • phone should be a valid phone number string, including country code prefix if applicable.
    Example: "+14155552671"
    Invalid example: "123-abc-7890" may cause validation errors depending on backend rules.

  • countryCode must be a valid ISO 3166-1 alpha-2 country code when provided.
    Example: "US", "GB", "FR"
    Invalid example: "USA", "UK" (should be "GB") will cause validation errors.

Error Examples

  • Missing required fields:
    No fields are required in this input type, so omitting all fields is valid.

  • Invalid email format:

    { "errors": [ { "message": "Invalid email format for field 'email'." } ] }
  • Invalid country code:

    { "errors": [ { "message": "Field 'countryCode' must be a valid ISO 3166-1 alpha-2 code." } ] }
  • Invalid phone number format:

    { "errors": [ { "message": "Field 'phone' contains invalid characters." } ] }

Best Practices

  • Always validate email and phone formats on the client side before sending requests to reduce errors.
  • Use ISO 3166-1 alpha-2 codes for countryCode to ensure consistency and compatibility.
  • Provide at least one field (email, phone, or countryCode) to meaningfully identify the buyer.
  • Use GraphQL variables for input objects to improve query readability and reusability.
  • Handle validation errors gracefully by informing users of the exact field and issue.
  • Keep input minimal and only include fields relevant to the operation context.
  • No related input types are defined in the source content.

Notes

  • This API currently requires no authentication; however, this may change in future versions.
  • BuyerIdentityInput is designed to be flexible with all fields optional, allowing partial updates or identification.
  • Since all fields are optional, ensure your business logic handles cases where none or only some fields are provided.
Last updated on