Introduction to Partner APIs

SUBJECT TO CHANGE

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

Vendor Parameters API

The Vendor Parameters API allows authorized vendors to update supply-related parameters for their SKUs within specific client locations.

Endpoint

PUT /api/v1/partner/vendor-parameters

Purpose

Enables vendors to provide batch updates for supply parameters and constraints specific to their products within a GAINS client's system.

Supported Operations

  • Update: Modify existing vendor parameter records
  • Create: Add new vendor parameter records for authorized SKUs???

Note: Delete operations are not currently supported for vendor parameters.

Request Format

Headers

Content-Type: application/json
Authorization: Bearer {partner_token}
X-Partner-Supplier: {supplier_code}

Body

[
  {
    "ItemCode": "ITEM002",
    "LocationCode": "LOC001", 
    "SupplierCode": "VENDOR456",
    "Parameters": [
      {
        "StandardCost": 15.50,
        "CapacityUnits": 100.0,
        "IncOrderQuantity": 25.0,
        "BundleWeightLB": 2.5,
        "AvailableQtyLB": 500.0,
        "Price": 18.75,
        "RollDate1": "2024-08-15",
        "RollDate2": "2024-09-15", 
        "RollDate3": "2024-10-15",
        "ExtendedData": {
          "userfield1": "Custom Value 1",
          "userfield2": "Custom Value 2",
          "userfield3": "Custom Value 3"
        }
      }
    ]
  }
]

Field Specifications

FieldTypeRequiredDescription
ItemCodestringYesSKU/Item identifier
LocationCodestringYesLocation identifier
SupplierCodestringYesMust match authenticated supplier
StandardCostdoubleNoStandard cost per unit
CapacityUnitsdoubleNoCapacity constraint units
IncOrderQuantitydoubleNoIncremental order quantity
BundleWeightLBdoubleNoBundle weight in pounds
AvailableQtyLBdoubleNoAvailable quantity in pounds
PricedoubleNoUnit price
RollDate1stringNoFirst roll date (ISO 8601 format)
RollDate2stringNoSecond roll date (ISO 8601 format)
RollDate3stringNoThird roll date (ISO 8601 format)
ExtendedDataobjectNoCustom fields (userfield1-userfield20)

Response Format

Success Response (200 OK)

{
  "status": "success",
  "message": "Vendor parameters updated successfully",
  "taskId": "12345678-abcd-1234-efgh-123456789012",
  "recordsProcessed": 1,
  "timestamp": "2024-07-03T10:30:00Z"
}

Error Response (400 Bad Request)

{
  "status": "error",
  "message": "Validation failed",
  "errors": [
    {
      "field": "SupplierCode",
      "message": "Supplier code does not match authenticated partner"
    }
  ],
  "timestamp": "2024-07-03T10:30:00Z"
}

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