Skip to main content
PUT
/
payments
/
orders
/
{id}
Update Order
curl --request PUT \
  --url https://api.rootfi.dev/v4/payments/orders/{id} \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "status": "PENDING",
  "line_items": [
    {
      "description": "<string>",
      "quantity": 123,
      "unit_amount": 123,
      "item_id": "<string>",
      "tax_amount": 123,
      "discount_amount": 123
    }
  ]
}
'
{
  "rootfi_id": 157,
  "rootfi_created_at": "2024-01-22T05:07:31.465Z",
  "rootfi_updated_at": "2024-01-22T05:07:31.000Z",
  "rootfi_company_id": 1089,
  "platform_id": "123456",
  "rootfi_deleted_at": "2023-11-07T05:31:56Z",
  "platform_unique_id": "<string>",
  "raw_data": {},
  "data_hash": "<string>",
  "contact_id": "<string>",
  "currency_id": "<string>",
  "status": "PENDING",
  "payment_status": "DRAFT",
  "total_amount": 123,
  "total_discount": 123,
  "total_tax": 123,
  "created_at": "<string>",
  "updated_at": "<string>",
  "invoice_id": "<string>",
  "invoice_ids": [
    "<string>"
  ],
  "line_items": [
    {
      "rootfi_id": 123,
      "item_id": "<string>",
      "description": "<string>",
      "quantity": 123,
      "unit_amount": 123,
      "tax_amount": 123,
      "discount_amount": 123,
      "total_amount": 123
    }
  ],
  "transactions": [
    {
      "rootfi_id": 123,
      "platform_id": "<string>",
      "type": "PAYMENT",
      "amount": 123,
      "currency_id": "<string>",
      "status": "DRAFT",
      "payment_method_type": "CARD",
      "gateway": "<string>",
      "description": "<string>",
      "created_at": "<string>"
    }
  ]
}
Update an existing order. Typically used to update order status or modify line items before payment.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe rootfi_id or platform_id of the order

Request Body

FieldTypeRequiredDescription
statusstringNoOrder status (pending, processing, completed)
line_itemsarrayNoUpdated line items (replaces existing)
Orders with completed payments may have limited editability depending on the platform.
See Order Overview for complete field details.

Authorizations

api_key
string
header
required

Path Parameters

id
string
required

Body

application/json
status
enum<string> | null
Available options:
PENDING,
PROCESSING,
COMPLETED,
CANCELED,
ON_HOLD,
UNKNOWN
line_items
paymentsV4LineItemCreate · object[] | null

Response

Order updated successfully

V4 Order model with embedded transactions.

rootfi_id
number<double>
required

The unique ID we assign for that data's information

Example:

157

rootfi_created_at
string<date-time>
required

The date at which RootFi first synced this data

Example:

"2024-01-22T05:07:31.465Z"

rootfi_updated_at
string<date-time>
required

The latest date at which RootFi updated this data

Example:

"2024-01-22T05:07:31.000Z"

rootfi_company_id
number<double>
required

The ID of the company in the accounting platform

Example:

1089

platform_id
string
required

An unique custom RootFi ID made from platform's unique_id.

Example:

"123456"

rootfi_deleted_at
string<date-time> | null

The date at which the data was deleted in the accounting platform

platform_unique_id
string | null

The ID of the data in the accounting platform.

raw_data
object

A JSON containing fields that you can directly get from the accounting platform.

data_hash
string | null

The hash of the data

contact_id
string | null

Reference to the Contact.

currency_id
string | null

ISO 4217 currency code.

status
enum<string> | null

Current order status (PENDING, PROCESSING, COMPLETED, CANCELED, ON_HOLD, UNKNOWN).

Available options:
PENDING,
PROCESSING,
COMPLETED,
CANCELED,
ON_HOLD,
UNKNOWN
payment_status
enum<string> | null

Payment state of the order (DRAFT, PENDING, PAID, PARTIALLY_PAID, FAILED, REFUNDED, PARTIALLY_REFUNDED, VOIDED, UNKNOWN).

Available options:
DRAFT,
PENDING,
PAID,
PARTIALLY_PAID,
FAILED,
REFUNDED,
PARTIALLY_REFUNDED,
VOIDED,
UNKNOWN
total_amount
number<double> | null

Total order amount.

total_discount
number<double> | null

Total discount amount.

total_tax
number<double> | null

Total tax amount.

created_at
string | null

Original creation timestamp from platform (ISO 8601).

updated_at
string | null

Last update timestamp from platform (ISO 8601).

invoice_id
string | null

Reference to the primary Invoice.

invoice_ids
string[] | null

References to all related invoices.

line_items
paymentsV4LineItem · object[] | null

Items included in this order.

transactions
paymentsV4TransactionEmbedded · object[] | null

All payment transactions for this order.