সাব-অ্যাকাউন্ট তৈরি এবং পরিচালনা করুন

মার্চেন্ট এপিআই-এ, অ্যাকাউন্টগুলির অন্য অ্যাকাউন্টের সাথে একটি সাব-অ্যাকাউন্ট সম্পর্ক থাকতে পারে। আপনি আপনার উন্নত অ্যাকাউন্টের অধীনে নতুন সাব-অ্যাকাউন্ট তৈরি করতে বণিক অ্যাকাউন্ট API ব্যবহার করতে পারেন। এই কল করার জন্য আপনার একটি বিদ্যমান উন্নত অ্যাকাউন্ট থাকতে হবে। আপনি আপনার অ্যাকাউন্টের অধীনে বিদ্যমান স্বতন্ত্র বণিক অ্যাকাউন্টগুলি সরাতে মার্চেন্ট API ব্যবহার করতে পারবেন না।

থার্ড-পার্টি প্রদানকারীরা মার্চেন্ট অ্যাকাউন্ট এপিআই ব্যবহার করে একটি ইন্টারফেস তৈরি করতে পারে যা বণিকদের তাদের অ্যাকাউন্টের বিশদ বিবরণ তৈরি এবং পরিচালনা করতে দেয়।

একটি সাব-অ্যাকাউন্ট তৈরি করুন

আপনার উন্নত অ্যাকাউন্টের অধীনে একটি নতুন উপ-অ্যাকাউন্ট তৈরি করতে, accounts.createAndConfigure এ কল করুন:

  1. account ফিল্ডে সাব-অ্যাকাউন্টের বিশদ বিবরণ দিন।
  2. users ক্ষেত্রে কোনো নতুন অনুমোদিত ব্যবহারকারী উল্লেখ করুন। ব্যবহারকারীর অ্যাক্সেসও পিতামাতার অ্যাকাউন্ট থেকে উত্তরাধিকারসূত্রে পাওয়া যায়।
  3. service ক্ষেত্রে accountAggregation নির্দিষ্ট করুন।

    এখানে অ্যাকাউন্ট account/123 অধীনে একটি সাব-অ্যাকাউন্ট তৈরি করার একটি উদাহরণ রয়েছে, যা সাব-অ্যাকাউন্টের জন্য একটি সমষ্টি:

    POST https://merchantapi.googleapis.com/accounts/v1beta/accounts:createAndConfigure
    
    {
      "account": {
        "accountName": "merchantStore",
        "adultContent": false,
        "testAccount": false,
        "timeZone": {
          "id": "America/New_York",
        }
        "languageCode": "en-US",
      },
      "service": [
        {
          "accountAggregation": {},
          "provider": "providers/123"
        }
      ]
    }
    

নিচের নমুনা দেখায় কিভাবে আপনি একটি নতুন সাব-অ্যাকাউন্ট তৈরি করতে CreateAndConfigureAccountRequest প্যাকেজ ব্যবহার করতে পারেন।

জাভা

  public static void createSubAccount(Config config) throws Exception {

    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    // Creates service settings using the credentials retrieved above.
    AccountsServiceSettings accountsServiceSettings =
        AccountsServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    // Creates parent/provider to identify the MCA account into which to insert the subaccount.
    String parent = getParent(config.getAccountId().toString());

    // Calls the API and catches and prints any network failures/errors.
    try (AccountsServiceClient accountsServiceClient =
        AccountsServiceClient.create(accountsServiceSettings)) {

      CreateAndConfigureAccountRequest request =
          CreateAndConfigureAccountRequest.newBuilder()
              .setAccount(
                  Account.newBuilder()
                      .setAccountName("Demo Business")
                      .setAdultContent(false)
                      .setTimeZone(TimeZone.newBuilder().setId("America/New_York").build())
                      .setLanguageCode("en-US")
                      .build())
              .addService(
                  AddAccountService.newBuilder()
                      .setProvider(parent)
                      .setAccountAggregation(AccountAggregation.getDefaultInstance())
                      .build())
              .build();

      System.out.println("Sending Create SubAccount request");
      Account response = accountsServiceClient.createAndConfigureAccount(request);
      System.out.println("Inserted Account Name below");
      // Format: `accounts/{account}
      System.out.println(response.getName());
    } catch (Exception e) {
      System.out.println(e);
    }
  }

পরিষেবার শর্তাবলী স্বীকার করুন

সাব-অ্যাকাউন্টগুলি মার্চেন্ট সেন্টারের পরিষেবার শর্তাবলী (TOS) এর উত্তরাধিকারী হয় যা পিতামাতার অ্যাকাউন্ট স্বাক্ষর করেছে।

আপনার ব্যবসার তথ্য আপডেট করুন

আপনি আপনার ব্যবসার তথ্য সম্পাদনা করতে বণিক অ্যাকাউন্ট API ব্যবহার করতে পারেন।

  • আপনার ব্যবসার তথ্য দেখতে, accounts.getBusinessInfo কল করুন।
  • আপনার ব্যবসার তথ্য সম্পাদনা করতে, accounts.updateBusinessInfo কল করুন।