Skip to content

Commit e9c6856

Browse files
Create README.md
Add documentation for CartJS catalog request creation
1 parent 036d425 commit e9c6856

File tree

1 file changed

+29
-0
lines changed
  • Server-Side Components/Server Side/Create Catalog Request Programmatically

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Create Service Catalog Request Programmatically
2+
3+
## Description
4+
This snippet demonstrates how to programmatically create a Service Catalog request using the CartJS API from server-side code. It bypasses the Service Portal interface and directly adds items to a cart, populates variables, and completes the checkout process.
5+
6+
## Use Cases
7+
- Automated hardware provisioning workflows
8+
- Integration endpoints that trigger catalog requests
9+
- Business Rules that create catalog items based on conditions
10+
- Scheduled Jobs that batch-create catalog requests
11+
- UI Actions that automate catalog submissions
12+
- Custom approval processes that generate follow-up requests
13+
14+
## Prerequisites
15+
- Service Catalog Scoped API plugin enabled (com.glideapp.servicecatalog.scoped.api)
16+
- Valid catalog item sys_id
17+
- Variable names must match exactly as defined in the catalog item
18+
19+
## Key Features
20+
- Populates catalog item variables dynamically
21+
- Automatically checks out the cart
22+
- Returns request ID and number for reference
23+
- Can be used in any server-side context (Business Rules, Script Includes, etc.)
24+
25+
## Notes
26+
- Two-step checkout setting affects the return value
27+
- If two-step checkout is enabled, returns cart_id
28+
- If two-step checkout is disabled, returns request_id and request_number
29+
- Replace placeholder sys_ids with actual values from your instance

0 commit comments

Comments
 (0)