updateOrganization

put

/ccagent/v1/organizations/{id}

Update Organization. This operation is used to update properties like approval required and order price limit for an organization. Optionally takes X-CCOrganization header which is a JSON field with organization ID as value. If this header is not provided, then the endPoint will consider first active organization as the current organization.

Request

Supported Media Types
  • application/json
Path Parameters
id
Type: string
Required: true
The ID of the Organization to be updated.
Header Parameters
X-CCAgentContext
Type: string
Required: true
The Agent Context is a JSON object with shopperProfileId as a property.
X-CCAsset-Language
Type: string
The asset language of the request
X-CCOrganization
Type: string
The organization Id associated with the shopper profile
X-CCSite
Type: string
The site Id to update the site specific shopper profile properties
Body Parameter
Root Schema : updateOrganization_request

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateOrganization_response
Nested Schema : billingAddress
Type: object
The default billing address for the Organization. This a read only attribute. This will be returned if the property 'isDefaultBillingAddress' is set to 'true' in secondaryAddresses attribute.
Nested Schema : contract
Type: object
Contract
Nested Schema : derivedBillingAddress
Type: object
The default billing address for the Organization. This a read only attribute. This will be returned if the property 'isDefaultBillingAddress' is set to 'true' in secondaryAddresses attribute.
Nested Schema : derivedContract
Type: object
Contract
Nested Schema : members
Type: array
List of contact ids associated with an Organization
Nested Schema : relativeRoles
Type: array
List of roles associated with an Organization
Nested Schema : secondaryAddresses
Type: array
List of all the addresses associated with an Organization, if property like 'isDefaultShippingAddress' or 'isDefaultBillingAddress' is set to 'true', then in response the same address will come as a separate attribute with name 'shippingAddress' or 'billingAddress'.
Nested Schema : shippingAddress
Type: object
The default shipping address for the Organization. This a read only attribute. This will be returned if the property 'isDefaultShippingAddress' is set to 'true' in secondaryAddresses attribute.
Nested Schema : catalog
Type: object
Catalog associated with contract
Nested Schema : priceListGroup
Type: object
Price ListGroup associated with contract
Nested Schema : terms
Type: object
Terms and Conditions
Nested Schema : catalog
Type: object
Catalog associated with contract
Nested Schema : priceListGroup
Type: object
Price ListGroup associated with contract
Nested Schema : terms
Type: object
Terms and Conditions
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : address
Type: object
Address created for the Organization.
Example application/json

{
    "taxReferenceNumber":"REFNUM123",
    "dynamicProperty1":"dynamicProperty1 value",
    "contract":{
        "terms":{
            "terms":"All copyright, trade marks, design rights, patents and other intellectual property rights (registered and unregistered) belong to Us Motor Works Contract",
            "repositoryId":"100002"
        },
        "endDate":"2017-10-10T11:44:26.000Z",
        "catalog":{
            "repositoryId":"cloudCatalog"
        },
        "displayName":"Us Motor Works Contract",
        "repositoryId":"100003",
        "description":"This is a written or spoken agreement, especially one concerning employment, sales, or tenancy, that is intended to be enforceable by law.",
        "priceListGroup":{
            "repositoryId":"defaultPriceGroup"
        },
        "creationDate":"2016-04-01T09:34:50.000Z",
        "startDate":"2016-10-10T11:44:26.000Z",
        "externalContractReference":"UMWCUS001"
    },
    "organizationLogo":"/general/update-hero-image1.jpg",
    "description":null,
    "active":true,
    "secondaryAddresses":[
        {
            "address":{
                "country":"US",
                "phoneNumber":"973-974-1234",
                "address2":"Street 2",
                "city":"Montgomery",
                "address1":"600 Dexter Avenue",
                "postalCode":"36130",
                "companyName":"Oracle",
                "repositoryId":"150002",
                "state":"AL"
            },
            "addressType":"Office Address"
        }
    ],
    "vatReferenceNumber":"Vat123123",
    "type":"none",
    "orderPriceLimit":1000,
    "customerType":"Standard",
    "organizationLogoURL":"/file/general/update-hero-image1.jpg",
    "approvalRequired":true,
    "members":[
        {
            "repositoryId":"110000"
        }
    ],
    "repositoryId":"200003",
    "name":"Oracle",
    "shippingAddress":{
        "country":"US",
        "phoneNumber":"973-974-1234",
        "address2":"Street 2",
        "city":"Montgomery",
        "address1":"600 Dexter Avenue",
        "postalCode":"36130",
        "companyName":"Oracle",
        "repositoryId":"150002",
        "state":"AL"
    },
    "links":[
        {
            "rel":"self",
            "href":"/ccadmin/v1/organizations"
        }
    ],
    "id":"200003",
    "billingAddress":{
        "country":"US",
        "phoneNumber":"973-974-1234",
        "address2":"Street 2",
        "city":"Montgomery",
        "address1":"600 Dexter Avenue",
        "postalCode":"36130",
        "companyName":"Oracle",
        "repositoryId":"150002",
        "state":"AL"
    },
    "dunsNumber":"123456789",
    "relativeRoles":[
        {
            "function":"admin"
        },
        {
            "function":"buyer"
        }
    ],
    "uniqueId":"TestIDNumber"
}
Default Response
The error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |100081|If order price limit is not passed or passed empty or null| |100082|If delegated admin trying to do approval management without the delegaete approval flag set to true| |100083|If there are no approvers present and approval falg is updated to true| |100084|If the last approver is being removed and either the approval flag is set to true or there is atleast one order in pending approval state| |100021|If approval required value is invalid| |89103|If the shopperProfile passed in the AgentContext header or the associated account is inactive| |100080|If order price limit is Invalid| |100000|If input passed is invalid| |100001|If there was no organization found with the given id|
Body
Root Schema : errorModel
Type: object
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

Examples

Sample Request:

{
  "approvalRequired": true,
  "orderPriceLimit": 1000
}

Sample Response Payload returned by endpoint:

{
  "taxReferenceNumber": "REFNUM123",
  "dynamicProperty1": "dynamicProperty1 value",
  "contract": {
    "terms": {
      "terms": "All copyright, trade marks, design rights, patents and other intellectual property rights (registered and unregistered) belong to Us Motor Works Contract",
      "repositoryId": "100002"
    },
    "endDate": "2017-10-10T11:44:26.000Z",
    "catalog": {"repositoryId": "cloudCatalog"},
    "displayName": "Us Motor Works Contract",
    "repositoryId": "100003",
    "description": "This is a written or spoken agreement, especially one concerning employment, sales, or tenancy, that is intended to be enforceable by law.",
    "priceListGroup": {"repositoryId": "defaultPriceGroup"},
    "creationDate": "2016-04-01T09:34:50.000Z",
    "startDate": "2016-10-10T11:44:26.000Z",
    "externalContractReference": "UMWCUS001"
  },
  "organizationLogo": "/general/update-hero-image1.jpg",
  "description": null,
  "active": true,
  "secondaryAddresses": [{
    "address": {
      "country": "US",
      "phoneNumber": "973-974-1234",
      "address2": "Street 2",
      "city": "Montgomery",
      "address1": "600 Dexter Avenue",
      "postalCode": "36130",
      "companyName": "Oracle",
      "repositoryId": "150002",
      "state": "AL"
    },
    "addressType": "Office Address"
  }],
  "vatReferenceNumber": "Vat123123",
  "type": "none",
  "orderPriceLimit": 1000,
  "customerType": "Standard",
  "organizationLogoURL": "/file/general/update-hero-image1.jpg",
  "approvalRequired": true,
  "members": [{"repositoryId": "110000"}],
  "repositoryId": "200003",
  "name": "Oracle",
  "shippingAddress": {
    "country": "US",
    "phoneNumber": "973-974-1234",
    "address2": "Street 2",
    "city": "Montgomery",
    "address1": "600 Dexter Avenue",
    "postalCode": "36130",
    "companyName": "Oracle",
    "repositoryId": "150002",
    "state": "AL"
  },
  "links": [{
    "rel": "self",
    "href": "/ccadmin/v1/organizations"
  }],
  "id": "200003",
  "billingAddress": {
    "country": "US",
    "phoneNumber": "973-974-1234",
    "address2": "Street 2",
    "city": "Montgomery",
    "address1": "600 Dexter Avenue",
    "postalCode": "36130",
    "companyName": "Oracle",
    "repositoryId": "150002",
    "state": "AL"
  },
  "dunsNumber": "123456789",
  "relativeRoles": [
    {"function": "admin"},
    {"function": "buyer"}
  ],
  "uniqueId": "TestIDNumber"
}