고객 session을 검증할 때는 request에 전달하는 customerId가 올바른 profile과 일치하는지 확인하여 Checkout에서 정확한 고객 정보가 표시되도록 해야 합니다. 또한 cart를 생성할 때 metadata에 customerId를 포함하지 마세요. 포함하면 덮어써집니다.
고객이 인증되고 주문이 완료되면, order query로 주문 세부 정보를 조회할 때 order.references에서 customerId를 확인할 수 있어 주문을 올바른 고객과 연결할 수 있습니다.
2
Customer profile로 cart 생성
두 mutation을 모두 호출하면 다음 값을 받습니다.
cart를 생성하기 위한 createCart mutation의 cartId.
고객 인증을 위한 checkoutCustomerProfileAuthenticate mutation의 oneTimePassword.
이 두 값을 Zonos.init function의 createCartId callback에 전달하면 제공된 customer profile 정보를 Checkout에 로드할 수 있습니다.
checkoutCustomerProfileAuthenticate는 해당 checkout session에 대한 일회용 비밀번호(one-time password)를 발급하므로 쇼퍼가 반드시 있어야 합니다. Checkout 외부에서 profile을 생성하거나 업데이트하려는 경우—예를 들어 고객 목록을 미리 로드하거나, 자체 시스템에서 profile 변경 사항을 동기화하거나, 고객의 첫 주문 전에 면세 정보를 연결하는 경우—대신 checkoutCustomerUpsert를 사용하세요.
Customer profiles
Customer profiles
재방문 쇼퍼 정보를 Zonos Checkout에 미리 로드하세요.Customer profiles는 계정이 있는 고객이 주소 및 결제 세부 정보를 미리 로드하여 Checkout 경험을 간소화합니다.
이 기능은 현재 커스텀 API 통합에서만 사용할 수 있습니다. Checkout 플러그인을 사용하는 판매자에게는 아직 제공되지 않습니다.
재판매업체, 정부 기관, 비영리 단체에 판매하는 경우, 고객의 면세 증명서를 customer profile에 동기화할 수도 있습니다.
인증된 고객 정보 전송
customer profile을 인증하려면 backend server가 독립적인 API call 두 개를 수행해야 하며, 더 나은 성능을 위해 두 호출을 병렬로 실행하는 것을 권장합니다.
createCart: Zonos cart를 생성합니다. 자세한 내용은 custom integration 문서의 Set up Zonos Checkout 섹션을 참조하세요.checkoutCustomerProfileAuthenticate: 고객 정보를 제출하고 검증합니다.mutation checkoutCustomerProfileAuthenticate($input: CheckoutCustomerProfileAuthenticateInput!) {checkoutCustomerProfileAuthenticate(input: $input) {emailcustomerIdorganizationIdnamephonelocations {administrativeAreacountryCodelocalityline1line2postalCode}oneTimePassword}}고객 session을 검증할 때는 request에 전달하는
customerId가 올바른 profile과 일치하는지 확인하여 Checkout에서 정확한 고객 정보가 표시되도록 해야 합니다. 또한 cart를 생성할 때 metadata에customerId를 포함하지 마세요. 포함하면 덮어써집니다.고객이 인증되고 주문이 완료되면, order query로 주문 세부 정보를 조회할 때
order.references에서 customerId를 확인할 수 있어 주문을 올바른 고객과 연결할 수 있습니다.Customer profile로 cart 생성
두 mutation을 모두 호출하면 다음 값을 받습니다.
cart를 생성하기 위한
createCartmutation의cartId.고객 인증을 위한
checkoutCustomerProfileAuthenticatemutation의oneTimePassword.이 두 값을
Zonos.initfunction의createCartIdcallback에 전달하면 제공된 customer profile 정보를 Checkout에 로드할 수 있습니다.Zonos.init({...checkoutSettings: {...createCartId: async () => {const result = await fetch('https://api.merchant.com/api/get-cart-info',{body: JSON.stringify(payload),method: 'POST',},);const json =await result.json();return {cartId: json.cartId,customerAuthenticationToken:json.customerProfileAuthenticate?.checkoutCustomerProfileAuthenticate.oneTimePassword ||'',};}},}Customer profile 관리
고객 정보를 처음 제출하면 Zonos가 제공된 고객 정보를 저장합니다. Payment method는 Stripe에 안전하게 저장됩니다. 새로운 주소 또는 payment method 세부 정보가 전달될 때마다 고객 profile에 추가됩니다.
주소와 payment method는 추가만 가능하며, 기존 항목은 수정하거나 삭제할 수 없습니다. 고객의 이름, 이메일, 전화번호는
checkoutCustomerUpsert로 업데이트할 수 있습니다.쇼퍼 없이 profile 생성 또는 업데이트
checkoutCustomerProfileAuthenticate는 해당 checkout session에 대한 일회용 비밀번호(one-time password)를 발급하므로 쇼퍼가 반드시 있어야 합니다. Checkout 외부에서 profile을 생성하거나 업데이트하려는 경우—예를 들어 고객 목록을 미리 로드하거나, 자체 시스템에서 profile 변경 사항을 동기화하거나, 고객의 첫 주문 전에 면세 정보를 연결하는 경우—대신checkoutCustomerUpsert를 사용하세요.mutation checkoutCustomerUpsert($input: CheckoutCustomerProfileInput!) {checkoutCustomerUpsert(input: $input) {customerIdemailnamephonelocations {administrativeAreacountryCodeline1line2localitypostalCode}}}Profile은
customerId를 기준으로 일치시키므로, 반복 호출해도 중복 profile이 생성되지 않고 동일한 profile이 업데이트됩니다. 전체 고객 목록에 대해 일정에 따라 실행해도 안전합니다.업데이트가 적용되는 방식에 대해 알아두어야 할 세 가지 사항은 다음과 같습니다.
name만 전송하면 이름만 업데이트되고 이메일과 전화번호는 기존 값 그대로 유지됩니다.checkoutCustomerUpsert는oneTimePassword를 반환하지 않습니다. Profile을 Checkout에 로드하려면 여전히 해당 session의 one-time password를 발급하는checkoutCustomerProfileAuthenticate가 필요합니다.CheckoutCustomerProfileInput
checkoutCustomerUpsert
이 페이지가 도움이 되었나요?