Change what an item sells for
A sale price is what the till charges for a window of time — add the new price with its dates, or edit the standing one; the old windows stay as history.
Pricing & money · a play in 2 steps.
The steps
- Add the new price and the window it applies in. — createSalePrice
- Edit a standing price — the change writes a new revision and the old one stays in history. — updateSalePrice
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
createSalePrice
createSalePrice — mutation · Create a new sale price — a time-boxed promotional price at your organization.
Example request
mutation ExampleCreateSalePrice($input: NewSalePriceInput!) {
createSalePrice(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
startAt
endAt
markdownPlanId
markdownStepIndex
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
"endAt": "2027-01-31T00:00:00.000Z",
"price": {
"currency": "USD",
"amount": "10.00"
}
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createSalePrice": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "SP-EXMP-0000-000F",
"type": "SalePrice",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"startAt": "2027-01-31T00:00:00.000Z",
"endAt": "2027-01-31T00:00:00.000Z",
"markdownPlanId": "01900000-0000-7000-8000-7b0984720000",
"markdownStepIndex": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
updateSalePrice
updateSalePrice — mutation · Edit a sale price — a time-boxed promotional price — change its details.
Example request
mutation ExampleUpdateSalePrice($id: ID!, $revision: ID!, $input: EditSalePriceInput!) {
updateSalePrice(id: $id, revision: $revision, input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
startAt
endAt
markdownPlanId
markdownStepIndex
}
}
Variables:
{
"id": "01900000-0000-7000-8000-37386ae00000",
"revision": "01900000-0000-7000-8000-b7960e180000",
"input": {
"caption": "Blue jeans"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"updateSalePrice": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "SP-EXMP-0000-000F",
"type": "SalePrice",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"startAt": "2027-01-31T00:00:00.000Z",
"endAt": "2027-01-31T00:00:00.000Z",
"markdownPlanId": "01900000-0000-7000-8000-7b0984720000",
"markdownStepIndex": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}