Skip to content

Latest commit

 

History

History
343 lines (260 loc) · 22.6 KB

File metadata and controls

343 lines (260 loc) · 22.6 KB

Buyers.ShippingDetails

Overview

Available Operations

  • create - Add buyer shipping details
  • list - List a buyer's shipping details
  • get - Get buyer shipping details
  • update - Update a buyer's shipping details
  • delete - Delete a buyer's shipping details

create

Associate shipping details to a buyer.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.ShippingDetailsCreate;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.AddBuyerShippingDetailsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        AddBuyerShippingDetailsResponse res = sdk.buyers().shippingDetails().create()
                .buyerId("fe26475d-ec3e-4884-9553-f7356683f7f9")
                .shippingDetailsCreate(ShippingDetailsCreate.builder()
                    .build())
                .call();

        if (res.shippingDetails().isPresent()) {
            System.out.println(res.shippingDetails().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
buyerId String ✔️ The ID of the buyer to add shipping details to. fe26475d-ec3e-4884-9553-f7356683f7f9
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
shippingDetailsCreate ShippingDetailsCreate ✔️ N/A

Response

AddBuyerShippingDetailsResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

list

List all the shipping details associated to a specific buyer.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.ListBuyerShippingDetailsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        ListBuyerShippingDetailsResponse res = sdk.buyers().shippingDetails().list()
                .buyerId("fe26475d-ec3e-4884-9553-f7356683f7f9")
                .call();

        if (res.shippingDetailsList().isPresent()) {
            System.out.println(res.shippingDetailsList().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
buyerId String ✔️ The ID of the buyer to retrieve shipping details for. fe26475d-ec3e-4884-9553-f7356683f7f9
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.

Response

ListBuyerShippingDetailsResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

get

Get a buyer's shipping details.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.GetBuyerShippingDetailsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        GetBuyerShippingDetailsResponse res = sdk.buyers().shippingDetails().get()
                .buyerId("fe26475d-ec3e-4884-9553-f7356683f7f9")
                .shippingDetailsId("bf8c36ad-02d9-4904-b0f9-a230b149e341")
                .call();

        if (res.shippingDetails().isPresent()) {
            System.out.println(res.shippingDetails().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
buyerId String ✔️ The ID of the buyer to retrieve shipping details for. fe26475d-ec3e-4884-9553-f7356683f7f9
shippingDetailsId String ✔️ The ID of the shipping details to retrieve. bf8c36ad-02d9-4904-b0f9-a230b149e341
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.

Response

GetBuyerShippingDetailsResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

update

Update the shipping details associated to a specific buyer.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.ShippingDetailsUpdate;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.UpdateBuyerShippingDetailsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        UpdateBuyerShippingDetailsResponse res = sdk.buyers().shippingDetails().update()
                .buyerId("fe26475d-ec3e-4884-9553-f7356683f7f9")
                .shippingDetailsId("bf8c36ad-02d9-4904-b0f9-a230b149e341")
                .shippingDetailsUpdate(ShippingDetailsUpdate.builder()
                    .build())
                .call();

        if (res.shippingDetails().isPresent()) {
            System.out.println(res.shippingDetails().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
buyerId String ✔️ The ID of the buyer to update shipping details for. fe26475d-ec3e-4884-9553-f7356683f7f9
shippingDetailsId String ✔️ The ID of the shipping details to update. bf8c36ad-02d9-4904-b0f9-a230b149e341
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
shippingDetailsUpdate ShippingDetailsUpdate ✔️ N/A

Response

UpdateBuyerShippingDetailsResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

delete

Delete the shipping details associated to a specific buyer.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.DeleteBuyerShippingDetailsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        DeleteBuyerShippingDetailsResponse res = sdk.buyers().shippingDetails().delete()
                .buyerId("fe26475d-ec3e-4884-9553-f7356683f7f9")
                .shippingDetailsId("bf8c36ad-02d9-4904-b0f9-a230b149e341")
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
buyerId String ✔️ The ID of the buyer to delete shipping details for. fe26475d-ec3e-4884-9553-f7356683f7f9
shippingDetailsId String ✔️ The ID of the shipping details to delete. bf8c36ad-02d9-4904-b0f9-a230b149e341
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.

Response

DeleteBuyerShippingDetailsResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*