Create Objects
The Create Objects API allows you to create object records directly in Salesforce through Nue's Revenue Lifecycle API. This endpoint provides a generic, metadata-driven interface for creating records.
Required Permission
Your API key must be associated with a role that has Manage Salesforce Orders and/or Manage Quotes permission enabled under the "Nue on Salesforce" category.
Endpoint
POST /api/objects/{objectName}Supported Objects
Object | Endpoint | Description |
|---|---|---|
Customer | POST /api/objects/Customer | Create customer accounts (maps to Salesforce Account) |
Opportunity | POST /cpq/opportunities | Create sales opportunities |
LineAttribute | POST /api/objects/LineAttribute | Create a Line Attribute definition. See Line Attributes. |
Important: Metadata-Driven Fields The fields available are determined by your Salesforce metadata configuration. The fields documented below are common examples and may vary based on your organization's setup. To see the exact fields available for your environment:
- Use the Metadata API to retrieve object definitions
- Check your Salesforce org's field configurations
- Custom fields added to your Salesforce objects will also be available
Configuration objects (for example LineAttribute) are addressed by their Nue object apiName, not the Salesforce __c API name, and their fields use Nue camelCase apiNames. Always confirm the exact object and field names with the Metadata API (GET /api/metadata/objects/{objectName}) before writing a payload.
Authentication
Include your API key in the request header:
curl -X POST 'https://api.nue.io/api/objects/Customer' \
-H 'nue-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json'Request
Create a new customer account in your Salesforce org.
curl -X POST 'https://api.nue.io/api/objects/Customer' \
-H 'nue-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Acme Corporation",
"recordType": "Business"
}'Customer Fields (Examples)
The following fields are commonly available. Your actual fields depend on your metadata configuration.
Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Account name |
recordType | string | No | Account record type (e.g., "Business", "Individual") |
accountNumber | string | No | Account number |
string | No | Primary contact email | |
phone | string | No | Phone number |
industry | string | No | Industry classification |
billingStreet | string | No | Billing street address |
billingCity | string | No | Billing city |
billingState | string | No | Billing state/province |
billingPostalCode | string | No | Billing postal code |
billingCountry | string | No | Billing country |
shippingStreet | string | No | Shipping street address |
shippingCity | string | No | Shipping city |
shippingState | string | No | Shipping state/province |
shippingPostalCode | string | No | Shipping postal code |
shippingCountry | string | No | Shipping country |
billCycleDay | string | No | Day of month for billing cycle |
paymentTerm | string | No | Payment terms (e.g., "NET30") |
paymentMethod | string | No | Default payment method |
description | string | No | Account description |
Response
{
"id": "001D000000IRFmaIAH"
}Create Opportunity
Create a new sales opportunity in Salesforce.
Endpoint
POST /cpq/opportunitiesRequest
curl -X POST 'https://api.nue.io/cpq/opportunities' \
-H 'nue-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"opportunityName": "Enterprise Deal - Q2",
"closeDate": "2025-06-30",
"stage": "Prospecting",
"accountId": "001D000000IRFmaIAH",
"description": "New enterprise opportunity",
"probability": 25
}'Opportunity Fields
Field | Type | Required | Description |
|---|---|---|---|
opportunityName | string | Yes | Name of the opportunity |
closeDate | date | Yes | Expected close date (must be in the future) |
stage | string | Yes | Opportunity stage (e.g., "Prospecting", "Qualification", "Negotiation/Review", "Closed Won") |
accountId | string | Yes | Salesforce account ID |
description | string | No | Detailed description of the opportunity |
nextStep | string | No | Next steps for advancing the opportunity |
probability | number | No | Win probability (0-100) |
Response
{
"id": "006D000000IqhSLIAZ",
"opportunityName": "Enterprise Deal - Q2",
"closeDate": "2025-06-30",
"stage": "Prospecting",
"salesforceUrl": "https://your-org.salesforce.com/lightning/r/Opportunity/006D000000IqhSLIAZ/view"
}Error Handling
Common Error Responses
Status Code | Error | Description |
|---|---|---|
400 | Bad Request | Invalid request format or missing required fields |
401 | Unauthorized | Invalid or missing API key |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Object type not found in metadata |
409 | Conflict | Record already exists or constraint violation |
Example Error Response
{
"code": 400,
"message": "Bad Request",
"details": "Required field 'name' is missing"
}