Skip to main content

Location

This page provides documentation for the location-related APIs available in the Piyovi platform. These APIs allow you to manage shipping locations for your organization.

Authentication​

All APIs require authentication using either API Key or OAuth 2.0 Bearer Token. For details, see Authentication Guide.

Location APIs Overview​

APIMethodEndpointDescription
Get LocationsGET/v1/locationsRetrieve a list of locations with pagination and filtering
Get LocationGET/v1/location/{id}Get detailed information about a specific location
Create LocationPOST/v1/locationCreate a new location
Update LocationPUT/v1/location/{id}Update an existing location
Delete LocationDELETE/v1/location/{id}Delete a location

Get Locations​

Endpoint​

GET https://api.piyovi.io/v1/locations

Parameters​

ParameterTypeRequiredDescription
QuerystringNoSearch term to filter locations
PageintegerYesPage number (1-based)
LimitintegerYesNumber of items per page
SortstringNoField to sort by (e.g., locationName)
OrderstringNoSort direction (ASC or DESC)

Example Request​

GET https://api.piyovi.io/v1/locations?Page=1&Limit=10&Query=warehouse&Sort=locationName&Order=ASC

Response Format​

{
"success": true,
"data": [
{
"id": "loc-123456",
"referenceId": "MAIN-WH",
"groupId": "group-123",
"locationName": "Main Warehouse",
"emailAddress": "[email protected]",
"address1": "123 Warehouse Blvd",
"city": "Chicago",
"stateProvince": "IL",
"defaultDescription": ["Consumer Electronics", "Retail Products"],
"contactName": "John Smith",
"country": "US",
"zipPostalCode": "60601",
"phoneNumber1": "312-555-1234",
"active": true,
"deleted": false,
"createdBy": "[email protected]",
"createdOnUtc": "2025-01-15T10:30:00Z",
"updatedBy": "[email protected]"
},
/* more location objects */
],
"pageNumber": 1,
"pageSize": 10,
"totalCount": 25,
"totalPages": 3,
"hasPreviousPage": false,
"hasNextPage": true
}

Get Location​

Endpoint​

GET https://api.piyovi.io/v1/location/{id}

Example Request​

GET https://api.piyovi.io/v1/location/loc-123456

Response Format​

{
"success": true,
"id": "loc-123456",
"referenceId": "MAIN-WH",
"groupId": "group-123",
"locationName": "Main Warehouse",
"emailAddress": "[email protected]",
"altEmailAddress": "[email protected]",
"faxNumber": "312-555-9876",
"phoneNumber1": "312-555-1234",
"phoneNumber2": "312-555-5678",
"active": true,
"address": {
"contactName": "John Smith",
"emailAddress": "[email protected]",
"phoneNumber1": "312-555-1234",
"address1": "123 Warehouse Blvd",
"address2": "Building A",
"city": "Chicago",
"stateProvince": "IL",
"country": "US",
"zipPostalCode": "60601"
},
"billingAddress": {
"contactName": "Finance Department",
"emailAddress": "[email protected]",
"phoneNumber1": "312-555-4321",
"address1": "789 Corporate Pkwy",
"city": "Chicago",
"stateProvince": "IL",
"country": "US",
"zipPostalCode": "60602"
},
"settings": {
"currencyCode": "USD",
"unitOfWeight": "LB",
"unitOfLength": "IN",
"defaultTimezone": "America/Chicago",
"manualShippingAvailable": true,
"defaultDescription": ["Consumer Electronics", "Retail Products"],
"defaultDeclaration": "Commercial Samples"
},
"dgDetail": {
"emergPhone": "800-555-1234",
"offererContractHolder": "John Smith",
"contractNo": "DG-12345"
},
"regionalSetting": {
"useItemData": true,
"defaultFreightClass": "70",
"defaultNmfcCode": "123456",
"autoCalcFreightClass": true,
"zeroFreightforOutboundThirdParty": false,
"zeroFreightforOutboundCollectOrRecipient": false
},
"tags": ["warehouse", "electronics", "midwest"]
}

Create Location​

Endpoint​

POST https://api.piyovi.io/v1/location

Request Format​

{
"referenceId": "EAST-WH",
"groupId": "group-123",
"locationName": "East Coast Warehouse",
"active": true,
"address": {
"contactName": "Sarah Johnson",
"emailAddress": "[email protected]",
"phoneNumber1": "212-555-1234",
"address1": "456 Storage Ave",
"city": "New York",
"stateProvince": "NY",
"country": "US",
"zipPostalCode": "10001"
},
"billingAddress": {
"contactName": "Finance Department",
"emailAddress": "[email protected]",
"phoneNumber1": "212-555-4321",
"address1": "789 Corporate Pkwy",
"city": "New York",
"stateProvince": "NY",
"country": "US",
"zipPostalCode": "10002"
},
"settings": {
"currencyCode": "USD",
"unitOfWeight": "LB",
"unitOfLength": "IN",
"defaultTimezone": "America/New_York",
"manualShippingAvailable": true,
"defaultDescription": ["Industrial Equipment", "Spare Parts"]
},
"regionalSetting": {
"useItemData": true,
"defaultFreightClass": "65",
"autoCalcFreightClass": true
},
"tags": ["warehouse", "industrial", "east-coast"]
}

Response Format​

{
"success": true,
"id": "loc-789012",
"referenceId": "EAST-WH"
}

Update Location​

Endpoint​

PUT https://api.piyovi.io/v1/location/{id}

Request Format​

The request format is the same as the Create Location API. You only need to include the fields you want to update.

Example Request​

PUT https://api.piyovi.io/v1/location/loc-123456
Content-Type: application/json

{
"locationName": "Main Warehouse - Updated",
"active": true,
"address": {
"phoneNumber1": "312-555-9999",
"address1": "123 Warehouse Blvd",
"address2": "Building B",
"city": "Chicago",
"stateProvince": "IL",
"country": "US",
"zipPostalCode": "60601"
},
"settings": {
"defaultDescription": ["Consumer Electronics", "Retail Products", "Household Goods"]
}
}

Response Format​

{
"success": true,
"id": "loc-123456",
"referenceId": "MAIN-WH"
}

Delete Location​

Endpoint​

DELETE https://api.piyovi.io/v1/location/{id}

Example Request​

DELETE https://api.piyovi.io/v1/location/loc-123456

Response Format​

{
"success": true,
"id": "loc-123456",
"referenceId": "MAIN-WH"
}

Field Reference​

Location Object Fields​

FieldTypeRequiredDescription
referenceIdstringYesYour reference identifier for the location
groupIdstringNoGroup identifier for organizing locations
locationNamestringYesName of the location
activebooleanYesWhether the location is active
addressobjectYesPhysical address of the location
billingAddressobjectNoBilling address (if different from physical address)
settingsobjectNoLocation-specific settings
dgDetailobjectNoDangerous goods details
regionalSettingobjectNoRegional shipping settings
tagsarrayNoTags for categorizing the location

Address Object Fields​

FieldTypeRequiredDescription
contactNamestringNoContact person's name
emailAddressstringNoEmail address
phoneNumber1stringNoPrimary phone number
phoneNumber2stringNoSecondary phone number
address1stringYesStreet address line 1
address2stringNoStreet address line 2
areastringNoArea or district
citystringYesCity name
stateProvincestringYesState or province
countrystringYesCountry code (2-letter ISO code)
zipPostalCodestringYesPostal or ZIP code
vatorTaxTypestringNoVAT or tax identifier type

Settings Object Fields​

FieldTypeRequiredDescription
currencyCodestringNoDefault currency code (e.g., USD, EUR)
unitOfWeightstringNoDefault unit of weight (e.g., LB, KG)
unitOfLengthstringNoDefault unit of length (e.g., IN, CM)
defaultTimezonestringNoDefault timezone (e.g., America/Chicago)
manualShippingAvailablebooleanNoWhether manual shipping is available
defaultDescriptionarrayNoDefault product descriptions
defaultDeclarationstringNoDefault customs declaration
logoobjectNoLocation logo image
defaultShiptoContactNamestringNoDefault ship-to contact name
defaultShiptoEmailAddressstringNoDefault ship-to email address

DG Detail Object Fields​

FieldTypeRequiredDescription
emergPhonestringNoEmergency phone number for dangerous goods
offererContractHolderstringNoDangerous goods contract holder name
contractNostringNoDangerous goods contract number

Regional Setting Object Fields​

FieldTypeRequiredDescription
useItemDatabooleanNoWhether to use item data for shipping
defaultFreightClassstringNoDefault freight class
defaultNmfcCodestringNoDefault NMFC code
autoCalcFreightClassbooleanNoWhether to auto-calculate freight class
zeroFreightforOutboundThirdPartybooleanNoZero freight for outbound third-party shipments
zeroFreightforOutboundCollectOrRecipientbooleanNoZero freight for outbound collect/recipient shipments

Error Handling​

All APIs follow a consistent error response format:

{
"success": false,
"errors": [
{
"code": "InvalidRequest",
"message": "Detailed error message",
"type": "ValidationError"
}
]
}

Best Practices​

  1. Use Reference IDs: Always provide meaningful reference IDs for easier identification
  2. Location Groups: Organize locations into logical groups (e.g., by region, type)
  3. Default Settings: Configure appropriate default settings to streamline shipping operations
  4. Keep Active: Use the active flag to disable locations without deleting them
  5. Tags: Use tags for flexible categorization and filtering of locations