Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dintero.com/llms.txt

Use this file to discover all available pages before exploring further.

Update an order where existing items are reversed and new items are added.
1

Create the original order

Create a draft order with line items.POST /accounts/{aid}/shopping/draft_ordersExample request body:
{
  "options": {
    "generate_order_id": "ALPHANUMERIC_9"
  },
  "order": {
    "currency": "NOK",
    "items": [
      {
        "id": "175938",
        "line_id": 1,
        "quantity": 2,
        "gross_amount": 39800,
        "tax_lines": [{ "amount": 7960, "percentage": 25 }],
        "description": "Stablestol for utendørsbruk",
        "description_alias": "Stablestol"
      }
    ]
  }
}
Then complete it to make it active.PUT /accounts/{aid}/shopping/draft_orders/{id}/complete
2

Authorize and capture the original order

Record the authorization and capture on the order to mark funds as reserved and collected.POST /accounts/{aid}/shopping/orders/{order_id}/authorizationsPOST /accounts/{aid}/shopping/orders/{order_id}/captures
{
  "items": [{ "amount": 39800, "line_id": 1 }],
  "payment_details": { "payment_id": "PID_123" },
  "success": true
}
3

Reverse the existing item and add a new one

Create a new draft linked to the original order_id. Include a reversal of the existing item (negative amounts) and a new replacement item. Use related_item to link the item being reversed.POST /accounts/{aid}/shopping/draft_orders
{
  "options": {
    "order_id": "{order_id}"
  },
  "order": {
    "currency": "NOK",
    "items": [
      {
        "id": "175938",
        "line_id": 2,
        "quantity": 2,
        "gross_amount": -39800,
        "tax_lines": [{ "amount": -7960, "percentage": 25 }],
        "description": "Stablestol for utendørsbruk",
        "description_alias": "Stablestol",
        "reversed_reason": "Replace item",
        "related_item": { "line_id": 1, "type": "reversed" }
      },
      {
        "id": "003929",
        "line_id": 3,
        "quantity": 1,
        "gross_amount": 39800,
        "tax_lines": [{ "amount": 7960, "percentage": 25 }],
        "description": "Stablestol for innendørsbruk",
        "description_alias": "Stablestol Lux"
      }
    ]
  }
}
Then complete the draft to apply the update to the order.PUT /accounts/{aid}/shopping/draft_orders/{id}/complete
4

Authorize and capture the reversed and new items

Record the authorization and capture for both the reversed item (negative) and the new item.POST /accounts/{aid}/shopping/orders/{order_id}/authorizationsPOST /accounts/{aid}/shopping/orders/{order_id}/capturesReversed item:
{
  "items": [{ "amount": -39800, "line_id": 2 }],
  "payment_details": { "payment_id": "PID_123" },
  "success": true
}
New item:
{
  "items": [{ "amount": 39800, "line_id": 3 }],
  "payment_details": { "payment_id": "PID_123" },
  "success": true
}
5

Refund remaining amount (if applicable)

If the original authorization is higher than the new items, include a refund line item in the draft update. Then authorize, capture, and refund that line.POST /accounts/{aid}/shopping/orders/{order_id}/authorizationsPOST /accounts/{aid}/shopping/orders/{order_id}/capturesAuthorize and capture the new item with the refund line:
{
  "items": [
    { "amount": 39800, "line_id": 3 },
    { "amount": 1000, "line_id": 4 }
  ],
  "payment_details": { "payment_id": "PID_123" },
  "success": true
}
POST /accounts/{aid}/shopping/orders/{order_id}/refundsRefund the remaining amount:
{
  "items": [{ "amount": 1000, "line_id": 4 }],
  "payment_details": { "payment_id": "PID_123" },
  "success": true
}
6

Additional captures for partial authorization (if applicable)

If the original authorization is lower than the new item amount, add additional authorization and capture calls for the new item.POST /accounts/{aid}/shopping/orders/{order_id}/authorizationsPOST /accounts/{aid}/shopping/orders/{order_id}/captures
{
  "items": [{ "amount": 1000, "line_id": 3 }],
  "payment_details": { "payment_id": "PID_321" },
  "success": true
}
Last modified on May 12, 2026