Skip to content

Latest commit

 

History

History
265 lines (175 loc) · 6.17 KB

vendors.md

File metadata and controls

265 lines (175 loc) · 6.17 KB

Vendors

vendors_api = client.vendors

Class Name

VendorsApi

Methods

Bulk Create Vendors

Creates one or more Vendor objects to represent suppliers to a seller.

def bulk_create_vendors(body:)

Parameters

Parameter Type Tags Description
body Bulk Create Vendors Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Bulk Create Vendors Response Hash

Example Usage

body = {}
body[:vendors] = {}

result = vendors_api.bulk_create_vendors(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Bulk Retrieve Vendors

Retrieves one or more vendors of specified Vendor IDs.

def bulk_retrieve_vendors(body:)

Parameters

Parameter Type Tags Description
body Bulk Retrieve Vendors Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Bulk Retrieve Vendors Response Hash

Example Usage

body = {}
body[:vendor_ids] = ['INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4']

result = vendors_api.bulk_retrieve_vendors(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Bulk Update Vendors

Updates one or more of existing Vendor objects as suppliers to a seller.

def bulk_update_vendors(body:)

Parameters

Parameter Type Tags Description
body Bulk Update Vendors Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Bulk Update Vendors Response Hash

Example Usage

body = {}
body[:vendors] = {}
body[:vendors][:vendor] = {}

result = vendors_api.bulk_update_vendors(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Create Vendor

Creates a single Vendor object to represent a supplier to a seller.

def create_vendor(body:)

Parameters

Parameter Type Tags Description
body Create Vendor Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Create Vendor Response Hash

Example Usage

body = {}
body[:idempotency_key] = 'idempotency_key2'

result = vendors_api.create_vendor(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Search Vendors

Searches for vendors using a filter against supported Vendor properties and a supported sorter.

def search_vendors(body:)

Parameters

Parameter Type Tags Description
body Search Vendors Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Search Vendors Response Hash

Example Usage

body = {}

result = vendors_api.search_vendors(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Retrieve Vendor

Retrieves the vendor of a specified Vendor ID.

def retrieve_vendor(vendor_id:)

Parameters

Parameter Type Tags Description
vendor_id String Template, Required ID of the Vendor to retrieve.

Response Type

Retrieve Vendor Response Hash

Example Usage

vendor_id = 'vendor_id8'

result = vendors_api.retrieve_vendor(vendor_id: vendor_id)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Update Vendor

Updates an existing Vendor object as a supplier to a seller.

def update_vendor(body:,
                  vendor_id:)

Parameters

Parameter Type Tags Description
body Update Vendor Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.
vendor_id String Template, Required -

Response Type

Update Vendor Response Hash

Example Usage

body = {}
body[:idempotency_key] = '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe'
body[:vendor] = {}
body[:vendor][:id] = 'INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4'
body[:vendor][:name] = 'Jack\'s Chicken Shack'
body[:vendor][:version] = 1
body[:vendor][:status] = 'ACTIVE'
vendor_id = 'vendor_id8'

result = vendors_api.update_vendor(body: body, vendor_id: vendor_id)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end