Introduction to Partner APIs
Overview
GAINS Connect Partner APIs enable authorized vendor partners to directly update inventory parameters for their products within client systems. This self-service approach streamlines data management and reduces integration overhead for both partners and GAINS clients.
Partner APIs
Authentication
GAINS Connect uses OAuth 2.0 with JWT tokens for partner authentication. Partners must obtain and include valid bearer tokens in all API requests.
Authentication Flow
- Partner Registration: Partners must be registered and approved by a GAINS client
- Token Generation: Approved partners receive authentication credentials
- Token Usage: Include bearer token in Authorization header for all API calls as well as unique partner identifier
- Token Validation: Each request validates partner authorization for specific client data
Vendor Parameters
The Vendor Parameters API allows authorized vendors to update supply-related parameters for their SKUs within specific client locations.
Endpoint
POST /api/v1/partner/vendor-parameters
Purpose
Enables vendors to provide batch updates for supply parameters and constraints specific to their products within a GAINS instance.
Supported Operations
- Create: Add new vendor parameter records for authorized SKUs. When a SKU has no prior records provided by a partner, a new entry will be created
- Update: Modify existing vendor parameter records (where SKU already has a prior record created)
Note: Delete operations are not currently supported for vendor parameters.
Request Format
Headers
Authorization: Bearer {partner_token}
X-Partner-Supplier: {partner_id}
Both of the above will be provided by GAINS directly to the partner.
Body
[
{
"ItemCode": "A",
"SupplierCode": "AC",
"Locations": [
{
"LocationCode": "1",
"StandardCost": 1.0,
"CapacityUnits": 1.0,
"Weight": 1,
"PriceBreaks": [
{
"Break": 1,
"UnitCost": 0,
"MinOrderQty": 0
}
],
"ExtendedData": {
"field1": 1
// ...
}
}
]
}
]Extended Data
The ExtendedData object can contain data that is configured specific to a GAINS instance. Please reach out to your GAINS representative to configure these if applicable.
Response Format
Ingress records are handled as tasks. Please review task stages and possible responses.
Authorization Rules
Partners can only update parameters for SKUs that:
- Belong to clients who have authorized the partner
- Are specifically associated with the partner as a vendor
- Match the supplier code provided in authentication headers
Updated about 19 hours ago
