Skip to content
StraventaDocs

Split a pending sale into child orders

Splits a pending parent pos_order into N child orders, each with its own tender rows and receipt. All child inserts are atomic. Payment intents are created post-commit, one per tender row (AC-32.1).

POST
/api/pos/v1/sales/{parent_id}/split

Splits a pending parent pos_order into N child orders, each with its own tender rows and receipt. All child inserts are atomic. Payment intents are created post-commit, one per tender row (AC-32.1).

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

parent_id*string

ID of the parent pos_order to split

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/pos/v1/sales/497f6eca-6276-4993-bfeb-53cbbbba6f08/split" \  -H "Content-Type: application/json" \  -d '{    "children": [      {        "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",        "total_idr": 0,        "tenders": [          {            "method": "cash",            "amount_idr": 0          }        ]      }    ]  }'
{
  "parent_order_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6d501",
  "children": [
    {
      "child_order_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6da01",
      "sequence": 1,
      "total_idr": 75000,
      "intent_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6da02",
      "receipt_no": "RCP-0002"
    },
    {
      "child_order_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6da03",
      "sequence": 2,
      "total_idr": 75000,
      "intent_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6da04",
      "receipt_no": "RCP-0003"
    }
  ]
}
Empty
Empty
Empty
Empty

Was this page helpful?