batchGrantPromotions

post

/ccadmin/v1/profiles/batchGrantPromotions

Grant promotions for Email Address(es) and/or Profile(s). You must supply at least one of these properties when using this endpoint.

Request

Supported Media Types
Header Parameters
Body ()
Root Schema : batchGrantPromotions_request
Type: object
Show Source
  • emailAddresses
    An optional array of email addresses that will be granted a promotion, if not supplied then the profileIds property must be supplied. Furthermore both the emailAddresses and profileIds properties can be supplied together in one request and will be treated as separate grants.
  • profileIds
    An optional array of profile ids that will be granted a promotion,if not supplied then emailAddresses property must be supplied.Furthermore both the profileIds and emailAddresses properties can also be supplied together in one request and will be treated as separate grants.
  • promotionIds
    An array of promotion id(s)
  • optional id associated with the source that initiated the batching request
    Example: src10001
Example:
{
    "sourceId":"src10001",
    "emailAddresses":[
        "shopper1@example.com",
        "shopper2@example.com"
    ],
    "profileIds":[
        "profile1",
        "profile2"
    ],
    "promotionIds":[
        "promo1001",
        "promo1002"
    ]
}
Nested Schema : emailAddresses
Type: array
An optional array of email addresses that will be granted a promotion, if not supplied then the profileIds property must be supplied. Furthermore both the emailAddresses and profileIds properties can be supplied together in one request and will be treated as separate grants.
Show Source
Example:
[
    "shopper1@example.com",
    "shopper2@example.com"
]
Nested Schema : profileIds
Type: array
An optional array of profile ids that will be granted a promotion,if not supplied then emailAddresses property must be supplied.Furthermore both the profileIds and emailAddresses properties can also be supplied together in one request and will be treated as separate grants.
Show Source
Example:
[
    "profile1",
    "profile2"
]
Nested Schema : promotionIds
Type: array
An array of promotion id(s)
Show Source
Example:
[
    "promo1001",
    "promo1002"
]
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds in initiating batch grant promotions to an array of given profiles and/or email addresses
Body
Example Response (application/json)
{
    "links":[
        {
            "method":"POST",
            "rel":"/rels/batchGrantPromotions",
            "href":"http://localhost:9080/ccadmin/v1/profiles/batchGrantPromotions"
        }
    ]
}

400 Response

The response has the ability to return single error messages or multi exception error messages. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |21171|If promotion id is invalid.| |13001|If no profileIds or email addresses are supplied|
Body
Example Response (application/json)
{
    "Single error response example":{
        "errorCode":"21171",
        "message":"promo1001 is not a valid promotion id",
        "status":"400"
    },
    "Multiple error response example":[
        {
            "errorCode":"00000000",
            "message":"promo1001 is not a valid promotion id",
            "errors":[
                {
                    "errorCode":"21171",
                    "message":"promo1001 is not a valid promotion id",
                    "status":"400"
                },
                {
                    "errorCode":"21171",
                    "message":"promo1002 is not a valid promotion id",
                    "status":"400"
                }
            ],
            "status":"400"
        }
    ]
}

401 Response

The following response occurs if there is not a valid bearer token present in request authorization header
Body
Example Response (application/json)
{
    "errorCode":"60006000",
    "message":"The user is not authenticated.",
    "status":"401"
}
Back to Top