Skip to content

Latest commit

 

History

History
330 lines (240 loc) · 18.1 KB

File metadata and controls

330 lines (240 loc) · 18.1 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

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$shippingDetailsCreate = new Gr4vy\ShippingDetailsCreate();

$response = $sdk->buyers->shippingDetails->create(
    buyerId: 'fe26475d-ec3e-4884-9553-f7356683f7f9',
    shippingDetailsCreate: $shippingDetailsCreate

);

if ($response->shippingDetails !== null) {
    // handle response
}

Parameters

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

Response

?AddBuyerShippingDetailsResponse

Errors

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

list

List all the shipping details associated to a specific buyer.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->buyers->shippingDetails->list(
    buyerId: 'fe26475d-ec3e-4884-9553-f7356683f7f9'
);

if ($response->shippingDetailsList !== null) {
    // handle response
}

Parameters

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

Response

?ListBuyerShippingDetailsResponse

Errors

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

get

Get a buyer's shipping details.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->buyers->shippingDetails->get(
    buyerId: 'fe26475d-ec3e-4884-9553-f7356683f7f9',
    shippingDetailsId: 'bf8c36ad-02d9-4904-b0f9-a230b149e341'

);

if ($response->shippingDetails !== null) {
    // handle response
}

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 ?string The ID of the merchant account to use for this request. default

Response

?GetBuyerShippingDetailsResponse

Errors

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

update

Update the shipping details associated to a specific buyer.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$shippingDetailsUpdate = new Gr4vy\ShippingDetailsUpdate();

$response = $sdk->buyers->shippingDetails->update(
    buyerId: 'fe26475d-ec3e-4884-9553-f7356683f7f9',
    shippingDetailsId: 'bf8c36ad-02d9-4904-b0f9-a230b149e341',
    shippingDetailsUpdate: $shippingDetailsUpdate

);

if ($response->shippingDetails !== null) {
    // handle response
}

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
shippingDetailsUpdate ShippingDetailsUpdate ✔️ N/A
merchantAccountId ?string The ID of the merchant account to use for this request. default

Response

?UpdateBuyerShippingDetailsResponse

Errors

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

delete

Delete the shipping details associated to a specific buyer.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->buyers->shippingDetails->delete(
    buyerId: 'fe26475d-ec3e-4884-9553-f7356683f7f9',
    shippingDetailsId: 'bf8c36ad-02d9-4904-b0f9-a230b149e341'

);

if ($response->statusCode === 200) {
    // 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 ?string The ID of the merchant account to use for this request. default

Response

?DeleteBuyerShippingDetailsResponse

Errors

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