{"openapi":"3.0.0","x-samples-languages":["curl","javascript","node","java","kotlin","python","php","go","swift"],"info":{"description":"The API responsible for setting up and managing your Karhoo Partnership.","version":"v1.0","title":"Partners API  1.0","contact":{"email":"api@karhoo.com"},"x-hugo-values":{"tags":["api"],"public":true}},"servers":[{"url":"https://rest.karhoo.com/v1/partners"}],"paths":{"/{partnerId}/dispatch/discovery/supply-partners/{externalId}":{"get":{"summary":"Discovers supply partners registered within given DMS","tags":["Dispatch Partners"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"partnerId","in":"path","required":true,"description":"Partner organisation ID.","schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"path","required":true,"description":"DMS supplier ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Supply representation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchDiscoveredSupplyPartner"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Imports the DMS-registered supply partner into the Karhoo Platform, only if it hasn't been imported before.","tags":["Dispatch Partners"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"partnerId","in":"path","required":true,"description":"Partner organisation ID.","schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"path","required":true,"description":"DMS supplier ID.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchSupplyPartnerDef"}}}},"responses":{"200":{"description":"No content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchImportedSupplyPartnerRef"}}}}}},"put":{"summary":"Manages supply partner which is already imported into the Karhoo Platform","tags":["Dispatch Partners"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"partnerId","in":"path","required":true,"description":"Partner organisation ID.","schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"path","required":true,"description":"DMS supplier ID.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchSupplyPartnerDef"}}}},"responses":{"200":{"description":"No content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchImportedSupplyPartnerRef"}}}}}},"delete":{"summary":"Disables the DMS-registered supply partner from the Karhoo Platform","tags":["Dispatch Partners"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"partnerId","in":"path","required":true,"description":"Partner organisation ID.","schema":{"type":"string","format":"uuid"}},{"name":"externalId","in":"path","required":true,"description":"DMS supplier ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"No content."}}}}},"components":{"schemas":{"ErrorDetails":{"description":"An error details","type":"object","properties":{"message":{"type":"string","example":"You are not allowed to perform this operation."},"errorCode":{"type":"string","example":"P0001"},"path":{"type":"string","example":"The location of the offending property in the request this error originates from."}}},"ErrorResponse":{"description":"An error response","type":"object","required":["message","statusCode"],"properties":{"message":{"type":"string","example":"The consumer is not authorized."},"statusCode":{"type":"number","example":401},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}}},"DispatchDiscoveredSupplyPartner":{"type":"object","required":["name","externalId","onboarded","userCount","productCount"],"properties":{"name":{"type":"string"},"externalId":{"type":"string"},"onboarded":{"type":"boolean"},"userCount":{"type":"number"},"productCount":{"type":"number"},"companyRegistrationDisplayAddress":{"type":"string"},"companyRegistrationNumber":{"type":"string"}}},"DispatchImportedSupplyPartnerRef":{"type":"object","required":["id","externalId","products"],"properties":{"id":{"type":"string"},"externalId":{"type":"string"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/ImportWarning"}},"products":{"type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"externalId":{"type":"string"}}}}}},"ImportWarning":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"DispatchSupplyPartnerDef":{"type":"object","properties":{"jwe":{"description":"Encrypted and signed dispatch's supply partner representation with JWE.","type":"string"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}