Mutation Reference
Mutation: upsertAndEnrollPublisher
upsertAndEnrollPublisherReturns: UpsertAndEnrollPublisherResponse!
Allows CJ integration partners to enroll a creator into their CJ program. If the creator does not already have a CJ account, one will be automatically created before enrollment.
| Argument | Type | Description |
|---|---|---|
input | UpsertAndEnrollPublisherInput | The data needed to upsert and enroll the publisher. See UpsertAndEnrollPublisherInput below. |
Example: Enrolling a Publisher
Request
mutation UpsertAndEnrollPublisher($input: UpsertAndEnrollPublisherInput) {
upsertAndEnrollPublisher(input: $input) {
emailAddress
company {
id
promotionalProperties {
id
}
}
}
}Variables
{
"input": {
"user": {
"firstName": "John",
"lastName": "Smith",
"phoneNumber": "+123456789",
"emailAddress": "[email protected]"
},
"company": {
"name": "ACME Corporation Company",
"address": {
"addressLineOne": "1234 Main Street",
"addressLineTwo": "Suite 500",
"city": "Cleveland",
"countryCode": "US",
"countrySubdivisionCode": "OH",
"postalCode": "44101"
},
"functionalCurrency": "USD",
"description": "This string a very long string. This string a very long string. This string a very long string. This string a very long string. This string a very long string. This string a very long string. This string a very long string. This string a very long string. This string a very long string. This string a very long string.",
"promotionalProperties": [
{
"socialMedia": {
"handle": "insta_user92",
"platform": "INSTAGRAM"
}
}
]
},
"enrollment": {
"partnershipId": "rgf3ddf2er",
"brandedSignupId": "de2erde2s",
"externalUserId": "dq1w2d4"
}
}
}Response
{
"data": {
"upsertAndEnrollPublisher": {
"emailAddress": "[email protected]",
"company": {
"id": "1234321",
"promotionalProperties": [
{ "id": "321123" }
]
}
}
}
}Example: Failure Response
The description field in UpsertPublisherCompanyInput must be at least 250 characters. Supplying a shorter string results in an InvalidArguments error.
Variables (invalid — description too short)
{
"input": {
"user": {
"firstName": "John",
"lastName": "Smith",
"phoneNumber": "+123456789",
"emailAddress": "[email protected]"
},
"company": {
"name": "ACME Corporation Company",
"address": {
"addressLineOne": "1234 Main Street",
"addressLineTwo": "Suite 500",
"city": "Cleveland",
"countryCode": "US",
"countrySubdivisionCode": "OH",
"postalCode": "44101"
},
"functionalCurrency": "USD",
"description": "This string a short description.",
"promotionalProperties": [
{
"socialMedia": {
"handle": "insta_user92",
"platform": "INSTAGRAM"
}
}
]
},
"enrollment": {
"partnershipId": "rgf3ddf2er",
"brandedSignupId": "de2erde2s",
"externalUserId": "dq1w2d4"
}
}
}Response
{
"errors": [
{
"message": "Invalid Arguments: Description must be at least 250 characters.",
"locations": [{ "column": 3, "line": 2 }],
"path": ["upsertAndEnrollPublisher"],
"extensions": {
"code": "InvalidArguments",
"classification": "DataFetchingException"
}
}
],
"data": null
}Response Objects
UpsertAndEnrollPublisherResponse
Returned when the publisher is successfully enrolled in the partnership.
| Field | Type | Description |
|---|---|---|
company | PublisherCompany! | The publisher company that was created or matched. |
emailAddress | EmailAddress! | The user email address associated with the account. |
PublisherCompany
An organization in the CJ network that publishes content.
| Field | Type | Description |
|---|---|---|
id | ID! | The company identifier (CID) of the publisher. |
promotionalProperties | [PromotionalProperty!]! | The promotional properties that were created for this publisher. |
PromotionalProperty
| Field | Type | Description |
|---|---|---|
id | ID! | The unique identifier for the promotional property. |
Input Objects
UpsertAndEnrollPublisherInput
Top-level input for the upsertAndEnrollPublisher mutation.
| Field | Type | Description |
|---|---|---|
user | UpsertUserInput! | Lookup a user by email, or create a new user if one does not exist. If the user already exists, all fields other than emailAddress will be ignored unless they can be used to fill in missing data. |
company | UpsertPublisherCompanyInput! | If the user is newly created, also create the following publisher company. If the user already exists, this input is ignored except for promotionalProperties (which will always be created) and any fields that can fill in missing data. |
enrollment | EnrollPublisherInput! | Look up the publisher enrollment. If not already enrolled, attempt to enroll the publisher in the partnership. |
UpsertUserInput
Personal details used to upsert a user.
| Field | Type | Description |
|---|---|---|
emailAddress | EmailAddress! | User email address. Used as the lookup key. |
firstName | String! | User's first name. |
lastName | String! | User's last name. |
phoneNumber | PhoneNumber! | User's phone number in E.164 format (e.g. +15555555555). |
UpsertPublisherCompanyInput
Information needed to create a new publisher company and its associated promotional property.
| Field | Type | Description |
|---|---|---|
name | String! | Publisher company name. |
address | AddressInput! | Address of the publisher company. |
functionalCurrency | FunctionalCurrency! | Currency used for reporting. Cannot be changed after the account is created. |
description | String! | Publisher description. Must be at least 250 characters. |
promotionalProperties | [PromotionalPropertyInput!]! | The promotional properties for this publisher. Exactly one is required. |
EnrollPublisherInput
Looks up a publisher enrollment based on partnershipId. If the publisher is not already enrolled, enrolls them in the partnership.
| Field | Type | Description |
|---|---|---|
partnershipId | ID! | Unique ID for the partnership account, assigned by CJ. |
brandedSignupId | ID | Required for phase 2 partnerships. |
externalUserId | String! | The user's identifier from the partner system. |
AddressInput
| Field | Type | Description |
|---|---|---|
addressLineOne | String! | First line of the street address. |
addressLineTwo | String | Second line of the street address (optional). |
city | String! | City. |
countryCode | CountryCode! | Two-letter ISO 3166-1 alpha-2 country code. |
countrySubdivisionCode | String | State or province code. |
postalCode | String | Postal or ZIP code. |
PromotionalPropertyInput
The promotional properties controlled by the publisher.
| Field | Type | Description |
|---|---|---|
socialMedia | SocialMediaPropertyInput! | Social media details for this promotional property. |
SocialMediaPropertyInput
Details for a promotional property on a social media platform.
| Field | Type | Description |
|---|---|---|
handle | String! | The unique handle or username on the specified platform (e.g. influencer_name). |
platform | SocialMediaPlatform! | The social media platform. See SocialMediaPlatform enum. |
Updated 9 days ago
