Skip to content

Latest commit

 

History

History
293 lines (195 loc) · 7.09 KB

vendors.md

File metadata and controls

293 lines (195 loc) · 7.09 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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Bulk Create Vendors Response Hash.

Example Usage

body = {
  :vendors => {
    'key0': {},
    'key1': {}
  }
}


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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Bulk Retrieve Vendors Response Hash.

Example Usage

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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Bulk Update Vendors Response Hash.

Example Usage

body = {
  :vendors => {
    'key0': {
      :vendor => {}
    },
    'key1': {
      :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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Create Vendor Response Hash.

Example Usage

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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of 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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of 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

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Update Vendor Response Hash.

Example Usage

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

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