Skip to main content

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.

  1. The customer begins the payment process.
  2. The merchant sends the init request to OmniCart.
  3. OmniCart returns the response to the init request to the merchant.
  4. OmniCart delivers the payment form using the method set in the deliveryOption property of the init request.
  5. The customer authenticates against their verification service.
  6. The verification service informs OmniCart that the payment is authorized.
  7. The payment is processed.
  8. The merchant displays the success message to the customer.

init (set timer)

{
"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"
}
}
  1. The customer wants to upgrade to PRO version.
  2. The merchant sends the status request to OmniCart.

    OmniCart supports callbacks for payment and timer status changes. Contact our technical support for more information.

  3. OmniCart returns the response to the status request to the merchant.

status (optional)

curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
  1. The merchant sends the modify request with the updated settings to OmniCart. These settings instruct OmniCart toto stop the item timer.
  2. The timer is stopped by manual action.
  3. OmniCart returns the response to the modify request to the merchant.
  4. The merchant displays the success message to the customer.

modify (stop timer)

{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"items": [
{
"bloodlust": {
"modifyTimer": {
"manualAction": "stop"
}
}
}
]
}
}
  1. The customer confirmed the upgrade.
  2. The merchant sends the init request to OmniCart. The timer value is set to 0 meaning that it does not expire.
  3. OmniCart returns the response to the init request to the merchant.
  4. OmniCart delivers the payment form using the method set in the deliveryOption property of the init request.
  5. The customer authenticates against their verification service.
  6. The verification service informs OmniCart that the payment is authorized.
  7. The payment is processed.
  8. The merchant displays the success message to the customer.

init (set new timer)

{
"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"
}
}

Example #2

This scenario involves reassigning tags after authorization, capturing selected items, expiration of the capture period, and a partial refund.

  1. The customer begins the payment process.
  2. The merchant sends the init request to OmniCart.
  3. OmniCart returns the response to the init request to the merchant.
  4. OmniCart delivers the payment form using the method set in the deliveryOption property of the init request.
  5. The customer authenticates against their verification service.
  6. The verification service informs OmniCart that the payment is authorized.
  7. The customer's dunds are put on hold on their account.
  8. The merchant displays the success message to the customer.

init

{
"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"
}
}
  1. The merchant sends the status request to OmniCart.

    OmniCart supports callbacks for payment and timer status changes. Contact our technical support for more information.

  2. OmniCart returns the response to the status request to the merchant.

status (optional)

curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
  1. The merchant sends the modify request with the updated settings to OmniCart.
  2. OmniCart returns the response to the modify request to the merchant.

modify (reassign tags)

  {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"items": [
{
"marksman": {
"tag": "slow"
}
}
]
}
}
  1. The merchant sends the status request to OmniCart.

    OmniCart supports callbacks for payment and timer status changes. Contact our technical support for more information.

  2. OmniCart returns the response to the status request to the merchant.

status (optional)

curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
  1. The merchant sends the capture request to OmniCart.
  2. The payment is processed.
  3. OmniCart returns the response to the capture request to the merchant.
  4. The customer's funds are released from hold on their account.

capture by tag

  {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"filterBox": {
"tags": [
"shield"
]
}
}
  1. The merchant sends the status request to OmniCart.

    OmniCart supports callbacks for payment and timer status changes. Contact our technical support for more information.

  2. OmniCart returns the response to the status request to the merchant.

status (optional)

curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
  1. The customer wants a partial refund.
  2. The merchant sends the modify request with the updated settings to OmniCart.
  3. The customer's funds are refunded.
  4. OmniCart returns the response to the modify request to the merchant.
  5. The merchant displays the success message to the customer.

modify (partial refund)

{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"items": [
{
"archangel": {
"tag": "anti-magic",
}
},
{
"zealot": {
"tag": "armageddon",
"modifyAmount": {
"quantity": 1
}
}
}
]
}
}
  1. The merchant sends the status request to OmniCart.

    OmniCart supports callbacks for payment and timer status changes. Contact our technical support for more information.

  2. OmniCart returns the response to the status request to the merchant.

status (optional)

curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'