(buyers.shippingDetails)
- 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
Associate shipping details to a buyer.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.buyers.shippingDetails.create({}, "fe26475d-ec3e-4884-9553-f7356683f7f9");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { buyersShippingDetailsCreate } from "@gr4vy/sdk/funcs/buyersShippingDetailsCreate.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await buyersShippingDetailsCreate(gr4vy, {}, "fe26475d-ec3e-4884-9553-f7356683f7f9");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("buyersShippingDetailsCreate failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
buyerId |
string | ✔️ | The ID of the buyer to add shipping details to. | [object Object] |
shippingDetailsCreate |
components.ShippingDetailsCreate | ✔️ | N/A | |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippingDetails>
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.SDKError | 4XX, 5XX | */* |
List all the shipping details associated to a specific buyer.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.buyers.shippingDetails.list("fe26475d-ec3e-4884-9553-f7356683f7f9");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { buyersShippingDetailsList } from "@gr4vy/sdk/funcs/buyersShippingDetailsList.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await buyersShippingDetailsList(gr4vy, "fe26475d-ec3e-4884-9553-f7356683f7f9");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("buyersShippingDetailsList failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
buyerId |
string | ✔️ | The ID of the buyer to retrieve shipping details for. | [object Object] |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippingDetailsList>
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.SDKError | 4XX, 5XX | */* |
Get a buyer's shipping details.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.buyers.shippingDetails.get("fe26475d-ec3e-4884-9553-f7356683f7f9", "bf8c36ad-02d9-4904-b0f9-a230b149e341");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { buyersShippingDetailsGet } from "@gr4vy/sdk/funcs/buyersShippingDetailsGet.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await buyersShippingDetailsGet(gr4vy, "fe26475d-ec3e-4884-9553-f7356683f7f9", "bf8c36ad-02d9-4904-b0f9-a230b149e341");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("buyersShippingDetailsGet failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
buyerId |
string | ✔️ | The ID of the buyer to retrieve shipping details for. | [object Object] |
shippingDetailsId |
string | ✔️ | The ID of the shipping details to retrieve. | [object Object] |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippingDetails>
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.SDKError | 4XX, 5XX | */* |
Update the shipping details associated to a specific buyer.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.buyers.shippingDetails.update({}, "fe26475d-ec3e-4884-9553-f7356683f7f9", "bf8c36ad-02d9-4904-b0f9-a230b149e341");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { buyersShippingDetailsUpdate } from "@gr4vy/sdk/funcs/buyersShippingDetailsUpdate.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await buyersShippingDetailsUpdate(gr4vy, {}, "fe26475d-ec3e-4884-9553-f7356683f7f9", "bf8c36ad-02d9-4904-b0f9-a230b149e341");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("buyersShippingDetailsUpdate failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
buyerId |
string | ✔️ | The ID of the buyer to update shipping details for. | [object Object] |
shippingDetailsId |
string | ✔️ | The ID of the shipping details to update. | [object Object] |
shippingDetailsUpdate |
components.ShippingDetailsUpdate | ✔️ | N/A | |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippingDetails>
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.SDKError | 4XX, 5XX | */* |
Delete the shipping details associated to a specific buyer.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.buyers.shippingDetails.delete("fe26475d-ec3e-4884-9553-f7356683f7f9", "bf8c36ad-02d9-4904-b0f9-a230b149e341");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { buyersShippingDetailsDelete } from "@gr4vy/sdk/funcs/buyersShippingDetailsDelete.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await buyersShippingDetailsDelete(gr4vy, "fe26475d-ec3e-4884-9553-f7356683f7f9", "bf8c36ad-02d9-4904-b0f9-a230b149e341");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("buyersShippingDetailsDelete failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
buyerId |
string | ✔️ | The ID of the buyer to delete shipping details for. | [object Object] |
shippingDetailsId |
string | ✔️ | The ID of the shipping details to delete. | [object Object] |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<any>
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.SDKError | 4XX, 5XX | */* |