페이지 이동경로
  • Docs>
  • Kakao Sync

Kakao Sync

Retrieve shipping address

IMPORTANT

This API is only allowed for the service that adopted Kakao Sync. To see the advantages of Kakao Sync, refer to Concept > Kakao Sync. Before implementing this API, read Design terms and policies.

This document contains how to retrieve shipping address using the Legacy SDK for Android and iOS. We recommend using the latest SDK for Android and iOS.

If you develop with other languages, see the following development guides:

Tag used in this document
Tag Description
Login required The API marked with this tag requires Kakao Login. You must implement the Kakao Login function first, and then call the corresponding API by using the access token issued when a user logs in.

Legacy Android Login required

Before you begin

To use this API on the Legacy Android,

  • A user must be in a logged-in state.
  • You must add the usermgmt module by referring to Install SDK.
How to implement

Call the shippingAddresses() method defined in the UserManagement class of the com.kakao.usermgmt package.

The response is the same as the response of the Web. Refer to the Response of Web for more details of the response.

UserManagement.getInstance().shippingAddresses(new
ApiResponseCallback<ShippingAddressResponse>() {
  @Override
  public void onSessionClosed(ErrorResult errorResult) {
    // Login is required.
  }

  @Override
  public void onFailure(ErrorResult errorResult) {
  }

  @Override
  public void onSuccess(ShippingAddressResponse result) {
    if (result.shippingAddresses != null) {
      // Succeeded in retrieving shipping addresses 
    } else if (result.shippingAddressNeedsAgreement()) {
      // Request additional consent to retrieve shipping address. 
    } else {
      // If impossible to get the shipping address for a user 
    }
  }
});

Legacy iOS Login required

Before you begin

To use this API on the Legacy iOS,

  • You must implement Kakao Login beforehand.
  • A user has been logged in with a Kakao Account.
How to implement

Call the shippingAddressTask() method to request a shipping address.

The response is the same as the response of the Web. Refer to the Response of Web for more details of the response.

KOSessionTask.shippingAddressTask(completionHandler: { (userShippingAddress, error) in
  if let userShippingAddress = userShippingAddress {
    if let shippingAddresses = userShippingAddress.shippingAddresses {
      // Success to retrieve shipping addresses
    } else if userShippingAddress.shippingAddressNeedsAgreement {
      // Request additional consent to retrieve shipping address. 
      KOSession.shared()?.updateScopes(["shipping_address"], completionHandler: { (error) in
        if let error = error as NSError? {
          if error.code == KOErrorCancelled.rawValue {
            // If a user refuses to provide a shipping address
          } else {
            // Other errors
          }
        } else {
          // If a user consents to providing a shipping address,
          // possible to get shipping addresses when requesting this API 
        }
      })
    } else {
      // If impossible to get the shipping address for a user 
    }
  }
})

See more

Legacy Android

Legacy iOS