Skip to content

Customers Get Organization

Get Organization for Contact — GET /customers/v1/{contactId}/organization

Section titled “Get Organization for Contact — GET /customers/v1/{contactId}/organization”

Uses the same sample dataset as the other customers examples: contacts Ada, Grace, and Alan all buy under Rubber Duck Enterprises.

Situation Response
Contact has an organization, and you’re entitled to it 200 OK — the organization record
Contact has no organization at all 404 Not Found
Contact has an organization, but you aren’t entitled to see it 404 Not Found — same as above
contactId is actually an Organization’s own ID, not a contact 404 Not Found — same as above
contactId is a real Person who isn’t a contact under any organization 404 Not Found — same as above

The response deliberately doesn’t reveal which 404 case you hit.


Request

GET /customers/v1/11111111-1111-1111-1111-111111111111/organization
Authorization: ******
Ocp-Apim-Subscription-Key: <subscription_key>

Response — 200 OK

{
"organization": {
"customerId": "22222222-2222-2222-2222-222222222222",
"name": "Rubber Duck Enterprises AS",
"customerType": "Organization",
"isB2B": true,
"isPublic": false,
"country": "NO",
"organizationNumber": "923609016",
"organizationData": {
"subOrganizationName": "Rubber Duck Enterprises",
"subOrganizationNumber": "923609016-1",
"organizationCountry": "NO",
"organizationIds": {}
}
}
}

Key points:

  • The nested object is the same customer shape returned by GET /customers/v1/{customerId} — it’s the organization’s own record, addressed by its contact’s ID, wrapped under organization rather than customer
  • Grace and Alan resolve to the identical organization record — every contact of Rubber Duck Enterprises returns the same body from this endpoint, just addressed via a different contactId

Returned when contactId is empty, whitespace, or not a valid GUID.

{
"type": "<docs-base-url>/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"detail": "Some fields have validation errors",
"instance": "/customers/v1/not-a-guid/organization",
"code": "ERR_VALIDATION_0001",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"errors": [
{ "fieldName": "ContactId", "message": "ContactId must be a valid GUID." }
]
}

No response body. The request is missing or has an invalid Authorization header.

No response body. The token is valid but does not include the customer:read scope.

Alan’s organization membership was removed; he no longer buys under Rubber Duck Enterprises.

{
"type": "<docs-base-url>/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Contact '44444444-4444-4444-4444-444444444444' has no associated organization.",
"instance": "/customers/v1/44444444-4444-4444-4444-444444444444/organization",
"code": "ERR_NOTFOUND",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

404 — Organization Exists, but Not Entitled

Section titled “404 — Organization Exists, but Not Entitled”

Contact 88888888-8888-8888-8888-888888888888 does buy under an organization, but it’s not one your account can see. The response — including the detail text — is identical to “no organization at all.”

{
"type": "<docs-base-url>/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Contact '88888888-8888-8888-8888-888888888888' has no associated organization.",
"instance": "/customers/v1/88888888-8888-8888-8888-888888888888/organization",
"code": "ERR_NOTFOUND",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

The contactId path parameter isn’t validated against the customer store up front — a nonexistent contact produces the same 404 as a contact with no organization.

{
"type": "<docs-base-url>/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Contact '99999999-9999-9999-9999-999999999999' has no associated organization.",
"instance": "/customers/v1/99999999-9999-9999-9999-999999999999/organization",
"code": "ERR_NOTFOUND",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

contactId doesn’t have to be a contact at all — this endpoint doesn’t check customerType before looking up the relationship. Passing Rubber Duck Enterprises’s own ID, or a standalone Person who isn’t anyone’s contact, produces the identical 404 as a contact with no organization.

Request

GET /customers/v1/22222222-2222-2222-2222-222222222222/organization
Authorization: ******
Ocp-Apim-Subscription-Key: <subscription_key>

Response — 404 Not Found

{
"type": "<docs-base-url>/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Contact '22222222-2222-2222-2222-222222222222' has no associated organization.",
"instance": "/customers/v1/22222222-2222-2222-2222-222222222222/organization",
"code": "ERR_NOTFOUND",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}