addAddress
post
/ccagent/v1/organizationAddresses
Add Address. This endpoint is used to add addresses of a Organization/Account in Oracle Commerce Cloud. Takes X-CCAgentContext header which is a JSON object with 'shopperProfileId' as a property. If 'shopperProfileId' is not provided, it is considered as an anonymous profile. 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
Header Parameters
- X-CCAgentContext
-
Type:
stringRequired:trueThe Agent Context is a JSON object with shopperProfileId as a property.- X-CCAsset-Language
Type:stringThe asset language of the request. E.g., en,de,fr_CA.- X-CCOrganization
Type:stringthe organization IdBody ParameterRoot Schema : addAddress_request{ "address":{ "isDefaultBillingAddress":true, "country":"US", "phoneNumber":"973-974-1234", "address2":"Street 2", "city":"Montgomery", "address1":"600 Dexter Avenue", "postalCode":"36130", "companyName":"Oracle", "isDefaultShippingAddress":true, "state":"AL" }, "addressType":"Office Address" }- address
-
Type:
objectaddressRequired:trueAdditional Properties Allowed:Address created for the Organization. - addressType
-
Type:
stringRequired:trueAddress type represents nick name of account if present else repository ID of address item. This is a mandatory field
Nested Schema : addressType:objectAddress created for the Organization.- address1
-
Type:
stringRequired:trueThe address1 of the secondary address. This is a mandatory field. - address2
-
Type:
stringThe address2 of the secondary address - city
-
Type:
stringRequired:trueThe city of the secondary address. This is a mandatory field. - companyName
-
Type:
stringRequired:trueCompany name of the secondary address. This is a mandatory field - country
-
Type:
stringRequired:trueThe country of the address. This is a mandatory field. - isDefaultBillingAddress
-
Type:
booleanMarks an address as default billing address. Default value is false. Accepts true or false - isDefaultShippingAddress
-
Type:
booleanMarks an address as default shipping address. Default value is false. Accepts true or false - phoneNumber
-
Type:
stringRequired:truePhone Number of the address. This is a mandatory field - postalCode
-
Type:
stringRequired:truePostal Code of the address. This is a mandatory field - state
-
Type:
stringRequired:trueThe State of the address. This is a mandatory field
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : addAddress_response
- address
-
Type:
objectaddressAdditional Properties Allowed:Address Object for the Organization. - addressType
-
Type:
stringAddress type represents nick name of account if present else repository ID of address item.
Nested Schema : address
Type:
objectAddress Object for the Organization.
- address1
-
Type:
stringThe address1 of the secondary address - address2
-
Type:
stringThe address2 of the secondary address - city
-
Type:
stringThe city of the secondary address - companyName
-
Type:
stringCompany name of the secondary address - country
-
Type:
stringThe country of the address - phoneNumber
-
Type:
stringPhone Number of the address - postalCode
-
Type:
stringPostal Code of the address - repositoryId
-
Type:
stringrepository Id of the address - state
-
Type:
stringThe State of the address
Example application/json
{
"address":{
"country":"US",
"phoneNumber":"973-974-1234",
"address2":"Street 2",
"city":"Montgomery",
"address1":"600 Dexter Avenue",
"companyName":"National Discount Auto Parts",
"postalCode":"36130",
"repositoryId":"280004",
"state":"AL"
},
"addressType":"Montgomery Office Address",
"links":[
{
"rel":"self",
"href":"/ccagentui/v1/organizationAddresses"
}
]
}
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|
|------------------|------------------|
|100183|If input or nickname given is null/empty|
|100030|Postal Code is required|
|100031|Country is required|
|100053|If the organization invalid default billing address value|
|100032|No State Region is found|
|100054|If the organization invalid default shipping address value|
|100076|Invalid Secondary Addresses|
|82005000|If there is an error while processing the AgentContext header. Possible reasons include invalid profileId, incorrect JSON format or other errors|
|23015|Phone Number is required|
|23005|Phone Number is invalid|
|80018|If an invalid country is provided|
|100067|If an invalid state is provided|
|100189|Duplicate Addresses Type are giving in input|
|100026|Company Name is required|
|89103|If no shopperProfileId is passed in the AgentContext header|
|100027|Address 1 is required|
|89102|If the shopperProfile passed in the AgentContext header or the associated account is inactive|
|100028|City is required|
|89101|If the shopperProfile passed in the AgentContext header is not an administrator for the account|
|100029|State is required|
Body
Root Schema : errorModel
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
Examples
Sample Request:
{
"address": {
"isDefaultBillingAddress": true,
"country": "US",
"phoneNumber": "973-974-1234",
"address2": "Street 2",
"city": "Montgomery",
"address1": "600 Dexter Avenue",
"postalCode": "36130",
"companyName": "Oracle",
"isDefaultShippingAddress": true,
"state": "AL"
},
"addressType": "Office Address"
}
Sample Response Payload returned by endpoint:
{
"address": {
"country": "US",
"phoneNumber": "973-974-1234",
"address2": "Street 2",
"city": "Montgomery",
"address1": "600 Dexter Avenue",
"companyName": "National Discount Auto Parts",
"postalCode": "36130",
"repositoryId": "280004",
"state": "AL"
},
"addressType": "Montgomery Office Address",
"links": [{
"rel": "self",
"href": "/ccagentui/v1/organizationAddresses"
}]
}