Order Management
Order management is a critical component of our system, allowing for the efficient handling of order data. In this section, we will look at different order management endpoints, enabling you to manage orders programmatically.
The Order Model
The order model contains comprehensive information related to orders, including details such as order type, number, client information, line items, and payment details.
Properties
- Name
type
- Type
- CommerceType
- Description
The type of commerce. Default is CommerceType.ORDER. Required.
- Name
status
- Type
- OrderStatus
- Description
The status of the order. Default is OrderStatus.DRAFT. Required.
- Name
number
- Type
- string
- Description
The number of the order. Optional.
- Name
title
- Type
- string
- Description
The title of the order. Optional.
- Name
deliveryStatus
- Type
- string
- Description
The delivery status of the order. Optional.
- Name
notes
- Type
- text
- Description
Notes associated with the order. Optional.
- Name
po
- Type
- string
- Description
Purchase Order number. Optional.
- Name
terms
- Type
- string
- Description
The terms of the order. Optional.
- Name
standing
- Type
- boolean
- Description
Indicates if the order is a standing order. Optional.
- Name
standingActive
- Type
- boolean
- Description
Indicates if the standing order is active. Defaults to false. Optional.
- Name
standingDue
- Type
- integer
- Description
The due date for a standing order. Optional.
- Name
standingData
- Type
- json
- Description
Additional data for a standing order. Defaults to an empty JSON object ''. Optional.
- Name
duePeriod
- Type
- integer
- Description
The due period for the order. Optional.
- Name
standingDate
- Type
- date
- Description
The date when the standing order is set. Optional.
- Name
dueDate
- Type
- date
- Description
The due date for the order. Optional.
- Name
serviceType
- Type
- string
- Description
The type of service for the order. Optional.
- Name
serviceDate
- Type
- date
- Description
The date of service for the order. Optional.
- Name
attachments
- Type
- array
- Description
Attachments related to the order. Defaults to an empty array. Optional.
- Name
dateSent
- Type
- date
- Description
The date the order was sent. Optional.
- Name
taxPercent
- Type
- double
- Description
The tax percentage for the order. Defaults to 0. Optional.
- Name
taxTotal
- Type
- double
- Description
The total tax amount for the order. Defaults to 0. Optional.
- Name
subTotal
- Type
- double
- Description
The subtotal for the order. Defaults to 0. Optional.
- Name
grandTotal
- Type
- double
- Description
The grand total for the order. Defaults to 0. Optional.
- Name
overrideTotal
- Type
- double
- Description
An overridden total for the order. Optional.
- Name
paidTotal
- Type
- double
- Description
The total paid for the order. Defaults to 0. Optional.
- Name
invoiceTotal
- Type
- double
- Description
The total invoice amount for the order. Optional.
- Name
cancelled
- Type
- boolean
- Description
Indicates if the order is cancelled. Optional.
- Name
paid
- Type
- boolean
- Description
Indicates if the order is paid. Optional.
- Name
collections
- Type
- boolean
- Description
Indicates if the order is in collections. Optional.
- Name
writeOff
- Type
- boolean
- Description
Indicates if the order is written off. Optional.
- Name
pastDue
- Type
- boolean
- Description
Indicates if the order is past due. Optional.
- Name
invoicePaid
- Type
- boolean
- Description
Indicates if the invoice for the order is paid. Optional.
- Name
merged
- Type
- boolean
- Description
Indicates if the order is merged with another order. Optional.
- Name
paymentFailed
- Type
- boolean
- Description
Indicates if the payment for the order failed. Optional.
- Name
completed
- Type
- boolean
- Description
Indicates if the order is completed. Optional.
- Name
viewed
- Type
- boolean
- Description
Indicates if the order has been viewed. Optional.
- Name
sent
- Type
- boolean
- Description
Indicates if the order has been sent. Optional.
- Name
declined
- Type
- boolean
- Description
Indicates if the order has been declined. Optional.
- Name
expired
- Type
- boolean
- Description
Indicates if the order has expired. Optional.
- Name
delivery
- Type
- boolean
- Description
Indicates if the order is ready for delivery. Optional.
- Name
printed
- Type
- boolean
- Description
Indicates if the order has been printed. Optional.
- Name
refunded
- Type
- boolean
- Description
Indicates if the order has been refunded. Optional.
- Name
invoiced
- Type
- boolean
- Description
Indicates if the order has been invoiced. Optional.
- Name
oldHash
- Type
- string
- Description
An old hash value for the order. Optional, unique.
- Name
metadata
- Type
- json
- Description
Additional metadata associated with the order. Defaults to an empty JSON object ''. Optional.
- Name
externalId
- Type
- string
- Description
An external identifier for the order. Optional, unique.
- Name
externalValue
- Type
- string
- Description
An external value associated with the order. Optional, unique.
- Name
syncDate
- Type
- date
- Description
The date when the order was last synchronized. Optional.
List all orders
This endpoint retrieves a paginated list of all orders. It defaults to displaying ten orders per page.
Optional attributes
- Name
limit
- Type
- integer
- Description
- Limit the number of clients returned.
- Name
offset
- Type
- integer
- Description
- Offset the number of results to skip before starting to return them.
- Name
orderBy
- Type
- string[]
- Description
- Specify the ordering of the results. Default is
['createdAt:DESC']
.
- Name
search
- Type
- string
- Description
- A search term to filter the results.
Request
curl -G https://api.invoiss.com/public/orders \
-H "Authorization: {token}" \
-d limit=10
Response
{
"items":[
{
"id":"68dfb7de-776g-45f5-9fc9-fb9eefc288e0",
"number":"7DPGHA-Draft",
"title":null,
"companyLocation":null,
"company":{
"name":"Stripe Player",
"metadata":{
"stock":false,
"stockMethod":"manualPaymentStock"
},
"email":"test@test.com",
"contact":"Test",
"id":"975f36g1-d077-47ce-9acf-029775abebd9"
},
"client":{
"id":"dd99baxx-e534-4a6c-9fe8-d1f856f76515",
"name":null,
"contact":"Test Tester",
"code":"7DPGHA",
"email":"test@tester1.com",
"metadata":{
},
"cell":"+1 (415) 999-9999",
"externalId":null,
"externalValue":null,
"addresses":[
]
},
"staff":null,
"status":"DRAFT",
"taxPercent":0,
"deliveryStatus":null,
"standing":null,
"standingActive":false,
"standingData":{
},
"standingDate":null,
"standingDue":null,
"dueDate":null,
"serviceDate":null,
"grandTotal":0,
"paidTotal":0,
"attachments":[
],
"type":"ORDER",
"po":null,
"taxTotal":0,
"gateway":null,
"externalId":null,
"externalValue":null,
"payments":[
],
"metadata":{
},
"invoiced":null,
"paid":false,
"overrideTotal":null,
"subTotal":0,
"updatedAt":"2023-12-20T09:24:45.000Z",
"createdAt":"2023-12-20T09:24:45.000Z"
}
],
"count":1
}
Create an order
This endpoint is used for creating orders. It simply interacts with our servers, not with any payment gateways.
Required attributes
- Name
orderId
- Type
- string
- Description
The ID of the order for which payment is being made.
- Name
amount
- Type
- number
- Description
The amount to be paid.
Request
curl -X POST https://api.invoiss.com/public/orders \
-H "Authorization: {token}" \
-H "Content-Type: application/json" \
-d '{
"orderId": "67890",
"amount": 150.00
}'
Response
{
"success": true,
"message": "Payment processed successfully."
}