One stop checkout - create commerce case, checkout and order with one request

In order to reduce the API calls with the Commerce Platform, there is an easy and more traditional way of integration for most shop systems today. The Commerce Case, Checkout and Order will be created with one request.

Process Flow

High-Level summary:

  • Commerce Case and Checkout will be created once the customer has completed the order.
  • The payment will be directly executed (autoExecuteOrder has to be set to true).
  • In total there is only one request required to create checkout and payment. 

Create Commerce case and Checkout with order

In this process flow, there is only one request required to create a Commerce Case with a Checkout and to automatically trigger the Order.

Note: for card payments, the retokenization has to be performed before creating the request.

POST Commerce Case
Request
POST/v1/{merchantId}/commerce-cases
{
    "merchantReference": "Sample-Commerce-Case",
    "checkout": {
        "amountOfMoney": {
            "amount": 8000,
            "currencyCode": "EUR"
        },
        "references": {
            "merchantReference": "Checkout-12345"
        },
        "shoppingCart": {
            "items": [
                {
                    "invoiceData": {
                        "description": "T-Shirt (weiß)"
                    },
                    "orderLineDetails": {
                        "productCode": "NKE-235",
                        "productPrice": 3000,
                        "productType": "GOODS",
                        "quantity": 1,
                        "taxAmount": 19
                    }
                },
                {
                    "invoiceData": {
                        "description": "Chino-Hose"
                    },
                    "orderLineDetails": {
                        "productCode": "LVIS-286",
                        "productPrice": 5000,
                        "productType": "GOODS",
                        "quantity": 1,
                        "taxAmount": 19
                    }
                }
            ]
        },
            "orderRequest": {
            "orderType": "FULL",
            "orderReferences": {
                "descriptor": "Descriptor-for-test",
                "merchantReference": "AutoVisa"
            },
            "paymentMethodSpecificInput": {
                "cardPaymentMethodSpecificInput": {
                    "card": {
                        "cardholderName": "Jurg Juergensen"
                    },
                    "paymentProcessingToken": "9410000000000003162",
                    "authorizationMode": "PRE_AUTHORIZATION",
                    "paymentProductId": 1,
                    "transactionChannel": "ECOMMERCE",
                    "returnUrl": "your-return-url-after-payment"
                }
            }
        },
        "autoExecuteOrder": true
    }
}
Important remark: The Commerce Platform does not handle clear PANs, credit card payment will be done only with a token (paymentProcessingToken). In order to create the paymentProcessingToken, a separate integration is required: Client API Hosted iFrames

Response
{
  "commerceCaseId": "fb8a4f3d-d521-41c8-8b91-df7773ededa2",
  "merchantReference": "Sample-Commerce-Case",
  "checkout": {
    "checkoutId": "71a3862c-485e-4009-bff0-85605d018a34",
    "shoppingCart": {
      "items": [
        {
          "invoiceData": {
            "description": "T-Shirt (weiß)"
          },
          "orderLineDetails": {
            "id": "e5ac3a5e-c859-4570-b638-73cb347946d2",
            "productCode": "NKE-235",
            "productPrice": 3000,
            "productType": "GOODS",
            "quantity": 1,
            "taxAmount": 19,
            "status": [
              {
                "lineItemStatus": "WAITING_FOR_PAYMENT",
                "quantity": 1
              }
            ]
          }
        },
        {
          "invoiceData": {
            "description": "Chino-Hose"
          },
          "orderLineDetails": {
            "id": "85af6b1e-58bf-4ef9-9744-c3df8d2b92aa",
            "productCode": "LVIS-286",
            "productPrice": 5000,
            "productType": "GOODS",
            "quantity": 1,
            "taxAmount": 19,
            "status": [
              {
                "lineItemStatus": "WAITING_FOR_PAYMENT",
                "quantity": 1
              }
            ]
          }
        }
      ]
    },
    "paymentResponse": {
      "merchantAction": {
        "actionType": "REDIRECT",
        "redirectData": {
          "redirectURL": "your-redirect-url"
        }
      },
      "payment": {
        "paymentOutput": {
          "amountOfMoney": {
            "amount": 8000,
            "currencyCode": "EUR"
          },
          "references": {
            "merchantReference": "AutoVisa"
          },
          "cardPaymentMethodSpecificOutput": {
            "paymentProductId": 1
          },
          "paymentMethod": "card"
        },
        "status": "REDIRECTED",
        "statusOutput": {
          "isCancellable": false,
          "statusCategory": "PENDING_PAYMENT",
          "isAuthorized": false,
          "isRefundable": false
        },
        "id": "PP2AADC85ZUFKFST"
      },
      "paymentExecutionId": "87634253-9dbc-43f3-b7d8-6ea372093c55"
    },
    "amountOfMoney": {
      "amount": 8000,
      "currencyCode": "EUR"
    },
    "references": {
      "merchantReference": "Checkout-12345"
    },
    "paymentExecution": {
      "paymentExecutionId": "87634253-9dbc-43f3-b7d8-6ea372093c55",
      "paymentId": "PP2AADC85ZUFKFST",
      "cardPaymentMethodSpecificInput": {
        "authorizationMode": "PRE_AUTHORIZATION",
        "recurring": {},
        "paymentProcessingToken": "9410000000000003162",
        "transactionChannel": "ECOMMERCE",
        "paymentProductId": 1,
        "card": {
          "cardholderName": "Jurg Juergensen"
        },
        "returnUrl": "your-return-url-after-payment"
      },
      "paymentChannel": "ECOMMERCE",
      "references": {
        "descriptor": "Descriptor-for-test",
        "merchantReference": "AutoVisa"
      },
      "events": [
        {
          "type": "RESERVATION",
          "amountOfMoney": {
            "amount": 8000,
            "currencyCode": "EUR"
          },
          "paymentStatus": "REDIRECTED"
        }
      ]
    },
    "checkoutStatus": "PENDING_COMPLETION",
    "statusOutput": {
      "paymentStatus": "PAYMENT_NOT_COMPLETED",
      "isModifiable": false,
      "openAmount": 0,
      "collectedAmount": 0,
      "cancelledAmount": 0,
      "refundedAmount": 0,
      "chargebackAmount": 0
    },
    "creationDateTime": "2024-02-09T15:15:35.341932564Z",
    "allowedPaymentActions": [
      "ORDER_MANAGEMENT",
      "PAYMENT_EXECUTION"
    ]
  },
  "creationDateTime": "2024-02-09T15:15:35.341932564Z"
}

Note: Redirect / authentication not shown here

Get Commerce Case with Checkout after successful order

After completing the Order (resulting in a successful payment) all the details for the Commerce Case and Checkout can be retrieved.

GET Commerce Case
Request
GET/v1/{merchantId}/commerce-cases/{commerceCaseId}

Response
{
  "merchantReference": "Sample-Commerce-Case",
  "commerceCaseId": "fb8a4f3d-d521-41c8-8b91-df7773ededa2",
  "checkouts": [
    {
      "commerceCaseId": "fb8a4f3d-d521-41c8-8b91-df7773ededa2",
      "checkoutId": "71a3862c-485e-4009-bff0-85605d018a34",
      "amountOfMoney": {
        "amount": 8000,
        "currencyCode": "EUR"
      },
      "references": {
        "merchantReference": "Checkout-12345"
      },
      "shoppingCart": {
        "items": [
          {
            "invoiceData": {
              "description": "T-Shirt (weiß)"
            },
            "orderLineDetails": {
              "id": "e5ac3a5e-c859-4570-b638-73cb347946d2",
              "productCode": "NKE-235",
              "productPrice": 3000,
              "productType": "GOODS",
              "quantity": 1,
              "taxAmount": 19,
              "status": [
                {
                  "lineItemStatus": "ORDERED",
                  "quantity": 1
                }
              ]
            }
          },
          {
            "invoiceData": {
              "description": "Chino-Hose"
            },
            "orderLineDetails": {
              "id": "85af6b1e-58bf-4ef9-9744-c3df8d2b92aa",
              "productCode": "LVIS-286",
              "productPrice": 5000,
              "productType": "GOODS",
              "quantity": 1,
              "taxAmount": 19,
              "status": [
                {
                  "lineItemStatus": "ORDERED",
                  "quantity": 1
                }
              ]
            }
          }
        ]
      },
      "paymentExecutions": [
        {
          "paymentExecutionId": "87634253-9dbc-43f3-b7d8-6ea372093c55",
          "paymentId": "PP2AADC85ZUFKFST",
          "cardPaymentMethodSpecificInput": {
            "authorizationMode": "PRE_AUTHORIZATION",
            "recurring": {},
            "paymentProcessingToken": "9410000000000003162",
            "transactionChannel": "ECOMMERCE",
            "paymentProductId": 1,
            "card": {
              "cardholderName": "Jurg Juergensen"
            },
            "returnUrl": "your-return-url-after-payment"
          },
          "paymentChannel": "ECOMMERCE",
          "references": {
            "descriptor": "Descriptor-for-test",
            "merchantReference": "AutoVisa"
          },
          "events": [
            {
              "type": "RESERVATION",
              "amountOfMoney": {
                "amount": 8000,
                "currencyCode": "EUR"
              },
              "paymentStatus": "PENDING_CAPTURE"
            }
          ]
        }
      ],
      "checkoutStatus": "COMPLETED",
      "statusOutput": {
        "paymentStatus": "PAYMENT_NOT_COMPLETED",
        "isModifiable": false,
        "openAmount": 8000,
        "collectedAmount": 0,
        "cancelledAmount": 0,
        "refundedAmount": 0,
        "chargebackAmount": 0
      },
      "creationDateTime": "2024-02-09T15:15:35.341932564Z",
      "allowedPaymentActions": [
        "ORDER_MANAGEMENT",
        "PAYMENT_EXECUTION"
      ]
    }
  ],
  "creationDateTime": "2024-02-09T15:15:35.341932564Z"
}
Deliver

Once the items are ready for shipment, the Deliver can be performed to capture the money from the reservation and to mark the items as DELIVERED.

POST Deliver
Request
POST(v1/{merchantId}/commerce-cases/{CommerceCaseId}/checkout/{CheckoutId}/deliver
{
  "deliverType": "FULL",
  "isFinal": true
}
Response
{
    "capturePaymentResponse": {
        "captureOutput": {
            "amountOfMoney": {
                "amount": 27000,
                "currencyCode": "EUR"
            },
            "references": {
                "merchantReference": "AutoVisa"
            },
            "paymentMethod": "card"
        },
        "status": "CAPTURED",
        "id": "PP2AADC8J6KKXK1U"
    },
    "shoppingCart": {
        "items": [
            {
                "invoiceData": {
                    "description": "T-Shirt (weiß)"
                },
                "orderLineDetails": {
                    "id": "7de11eab-1928-4afc-8f1a-39eb8d07942a",
                    "productCode": "NKE-235",
                    "productPrice": 3000,
                    "productType": "GOODS",
                    "quantity": 2,
                    "taxAmount": 19,
                    "status": [
                        {
                            "lineItemStatus": "DELIVERED",
                            "quantity": 2
                        }
                    ]
                }
            },
            {
                "invoiceData": {
                    "description": "Chino-Hose"
                },
                "orderLineDetails": {
                    "id": "6ef65d98-44e0-4f3c-abfe-d37e0f398425",
                    "productCode": "LVIS-286",
                    "productPrice": 5000,
                    "productType": "GOODS",
                    "quantity": 1,
                    "taxAmount": 19,
                    "status": [
                        {
                            "lineItemStatus": "DELIVERED",
                            "quantity": 1
                        }
                    ]
                }
            },
            {
                "invoiceData": {
                    "description": "Sneaker"
                },
                "orderLineDetails": {
                    "id": "bbc182fa-05e3-427f-9ceb-3d51daa34dcd",
                    "productCode": "ADI-132",
                    "productPrice": 8000,
                    "productType": "GOODS",
                    "quantity": 1,
                    "taxAmount": 19,
                    "status": [
                        {
                            "lineItemStatus": "DELIVERED",
                            "quantity": 1
                        }
                    ]
                }
            },
            {
                "invoiceData": {
                    "description": "Strickjacke"
                },
                "orderLineDetails": {
                    "id": "0588b30d-b6f0-4081-8c74-28671f4048fc",
                    "productCode": "POLO-2345",
                    "productPrice": 4000,
                    "productType": "GOODS",
                    "quantity": 2,
                    "taxAmount": 19,
                    "status": [
                        {
                            "lineItemStatus": "DELIVERED",
                            "quantity": 2
                        }
                    ]
                }
            }
        ]
    }
}