vendors_api = client.vendors
VendorsApi
- Bulk Create Vendors
- Bulk Retrieve Vendors
- Bulk Update Vendors
- Create Vendor
- Search Vendors
- Retrieve Vendor
- Update Vendor
Creates one or more Vendor objects to represent suppliers to a seller.
def bulk_create_vendors(body:)
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. |
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
.
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
Retrieves one or more vendors of specified Vendor IDs.
def bulk_retrieve_vendors(body:)
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. |
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
.
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
Updates one or more of existing Vendor objects as suppliers to a seller.
def bulk_update_vendors(body:)
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. |
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
.
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
Creates a single Vendor object to represent a supplier to a seller.
def create_vendor(body:)
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. |
This method returns a \ApiResponse
instance. The data
property in this instance returns the response data which is of type Create Vendor Response Hash
.
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
Searches for vendors using a filter against supported Vendor properties and a supported sorter.
def search_vendors(body:)
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. |
This method returns a \ApiResponse
instance. The data
property in this instance returns the response data which is of type Search Vendors Response Hash
.
body = {}
result = vendors_api.search_vendors(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves the vendor of a specified Vendor ID.
def retrieve_vendor(vendor_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
vendor_id |
String |
Template, Required | ID of the Vendor to retrieve. |
This method returns a \ApiResponse
instance. The data
property in this instance returns the response data which is of type Retrieve Vendor Response Hash
.
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
Updates an existing Vendor object as a supplier to a seller.
def update_vendor(body:,
vendor_id:)
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 | - |
This method returns a \ApiResponse
instance. The data
property in this instance returns the response data which is of type Update Vendor Response Hash
.
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