Complex Scenarios
Example #1
In this scenario, a cart item is created with an expiring timer. For example, it could be temporary access to a mobile app feature. The customer then wants to upgrade to the PRO version before the temporary timer expires. The PRO version implies unlimited use of the feature. One way to achieve this, is to stop the item timer and register a new cart with an unlimited timer.
- The customer begins the payment process.
-
The merchant sends the
init
request to OmniCart. -
OmniCart returns the response to the
init
request to the merchant. -
OmniCart delivers the payment form using the method set in the
deliveryOption
property of theinit
request. - The customer authenticates against their verification service.
- The verification service informs OmniCart that the payment is authorized.
- The payment is processed.
- The merchant displays the success message to the customer.
init
(set timer)
- request
- response
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"currency": "XAU",
"items": [
{
"bloodlust": {
"amount": 100,
"enableTimer": true,
"timer": {
"triggerEvent": "completed",
"value": 259200
}
}
}
],
"paymentForm": {
"deliveryOption": "redirect",
"value": "https://test.com/payment"
}
}
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(optional)
- request
- response
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"currency": "XAU",
"totalAmounts": {
"initiated": 100,
"captured": 100,
"refunded": 0,
"current": 100
},
"items": [
{
"bloodlust": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 100,
"captured": 100,
"refunded": 0,
"current": 100
},
"paymentSnapshot": {
"amount": 100
},
"timerSnapshot": {
"triggerEvent": "completed",
"timerStatus": "started",
"remainingSecs": 169387
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
- The merchant sends the
modify
request with the updated settings to OmniCart. These settings instruct OmniCart toto stop the item timer. - The timer is stopped by manual action.
-
OmniCart returns the response to the
modify
request to the merchant. - The merchant displays the success message to the customer.
modify
(stop timer)
- request
- response
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"items": [
{
"bloodlust": {
"modifyTimer": {
"manualAction": "stop"
}
}
}
]
}
}
{
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
- The customer confirmed the upgrade.
- The merchant sends the
init
request to OmniCart. The timer value is set to0
meaning that it does not expire. -
OmniCart returns the response to the
init
request to the merchant. -
OmniCart delivers the payment form using the method set in the
deliveryOption
property of theinit
request. - The customer authenticates against their verification service.
- The verification service informs OmniCart that the payment is authorized.
- The payment is processed.
- The merchant displays the success message to the customer.
init
(set new timer)
- request
- response
{
"cartId": "998090f3-e1a3-446b-b503-c41ad9ee546a",
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"currency": "XAU",
"items": [
{
"bloodlust": {
"amount": 10000,
"enableTimer": true,
"timer": {
"triggerEvent": "completed",
"value": 0
}
}
}
],
"paymentForm": {
"deliveryOption": "redirect",
"value": "https://test.com/payment"
}
}
{
"cartId": "998090f3-e1a3-446b-b503-c41ad9ee546a",
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
Example #2
This scenario involves reassigning tags after authorization, capturing selected items, expiration of the capture period, and a partial refund.
- The customer begins the payment process.
-
The merchant sends the
init
request to OmniCart. -
OmniCart returns the response to the
init
request to the merchant. -
OmniCart delivers the payment form using the method set in the
deliveryOption
property of theinit
request. - The customer authenticates against their verification service.
- The verification service informs OmniCart that the payment is authorized.
- The customer's dunds are put on hold on their account.
- The merchant displays the success message to the customer.
init
- request
- response
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"scope": {
"cart": {
"paymentBox": {
"amountMode": "calculated",
"capture": true,
"captureSettings": {
"autoAction": "complete",
"value": 172800
}
}
},
},
"items": [
{
"marksman": {
"tag": "shield",
"amount": 150,
"quantity": 18
}
},
{
"zealot": {
"tag": "shield",
"amount": 450,
"quantity": 6
}
{
"archangel": {
"tag": "shield",
"amount": 5000,
"quantity": 2
}
}
],
"paymentForm": {
"deliveryOption": "redirect",
"value": "https://test.com/payment"
}
}
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(optional)
- request
- response
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 0,
"refunded": 0,
"current": 15400
},
"items": [
{
"marksman": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 6,
}
}
},
{
"archangel": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "shield",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(optional)
- request
- response
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 0,
"refunded": 0,
"current": 15400
},
"items": [
{
"marksman": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "slow",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 6,
}
}
},
{
"archangel": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "shield",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(optional)
- request
- response
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 12700,
"refunded": 0,
"current": 0
},
"items": [
{
"marksman": {
"paymentStatus": "canceled",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 0
},
"tag": "slow",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 6,
}
}
},
{
"archangel": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "shield",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
modify
(partial refund)
- request
- response
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"items": [
{
"archangel": {
"tag": "anti-magic",
}
},
{
"zealot": {
"tag": "armageddon",
"modifyAmount": {
"quantity": 1
}
}
}
]
}
}
{
"data": {
"modifiedAmounts": [
"zealot"
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(optional)
- request
- response
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 12700,
"refunded": 2250,
"current": 10450
},
"items": [
{
"marksman": {
"paymentStatus": "canceled",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 0
},
"tag": "slow",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 2700,
"captured": 2700,
"refunded": 2250,
"current": 450
},
"tag": "armageddon",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 1,
}
}
},
{
"archangel": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "anti-magic",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}