Skip to main content
PUT
/
purchases
/
{id}
cURL
curl --request PUT \
  --url https://api.daraa.io/purchases/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "pending"
}
'
{
  "id": "<string>",
  "shopperId": "<string>",
  "orderNumber": "<string>",
  "status": "draft",
  "approvalStatus": "not_required",
  "items": [
    {
      "sku": "<string>",
      "name": "<string>",
      "quantity": 123,
      "unitPrice": 123,
      "totalPrice": 123
    }
  ],
  "total": 123,
  "currency": {
    "id": 123,
    "name": "<string>",
    "rate": "<string>",
    "base": true,
    "active": true,
    "description": "<string>"
  },
  "externalPoNumber": "<string>",
  "approvalChain": {
    "id": "<string>",
    "name": "<string>",
    "steps": [
      {
        "id": "<string>",
        "stepNumber": 123,
        "approverType": "user",
        "approverId": "<string>",
        "approverName": "<string>",
        "isRequired": true,
        "thresholdAmount": 123
      }
    ],
    "isActive": true
  },
  "currentApprover": "<string>",
  "subtotal": 123,
  "tax": 123,
  "shipping": 123,
  "convertedTotal": 123,
  "shippingAddress": {
    "name": "<string>",
    "street1": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zip": "<string>",
    "country": "<string>"
  },
  "billingAddress": {
    "name": "<string>",
    "street1": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zip": "<string>",
    "country": "<string>"
  },
  "paymentMethod": {
    "type": "credit_card",
    "lastFour": "<string>",
    "brand": "<string>",
    "expiryMonth": 123,
    "expiryYear": 123
  },
  "requestedDeliveryDate": "2023-12-25",
  "urgency": "low",
  "notes": "<string>",
  "approvalHistory": [
    {
      "id": "<string>",
      "stepId": "<string>",
      "approverId": "<string>",
      "approverName": "<string>",
      "action": "approved",
      "actionDate": "2023-11-07T05:31:56Z",
      "comments": "<string>"
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "approvedAt": "2023-11-07T05:31:56Z"
}

Path Parameters

id
string
required

Body

application/json
status
enum<string>
Available options:
pending,
confirmed,
processing,
shipped,
delivered,
cancelled,
refunded

Response

200 - application/json

Ok

id
string
required

Unique identifier for the purchase order

shopperId
string
required

ID of the shopper making the purchase

orderNumber
string
required

Human-readable order number

status
enum<string>
required

Current status of the order

Available options:
draft,
pending_approval,
approved,
confirmed,
processing,
shipped,
delivered,
cancelled,
refunded
approvalStatus
enum<string>
required

Approval status of the order

Available options:
not_required,
pending,
approved,
rejected
items
object[]
required

Items in the order

total
number<double>
required

Total amount including taxes and fees

currency
object
required
externalPoNumber
string

External PO number for integration

approvalChain
object
currentApprover
string

ID of current approver

subtotal
number<double>

Subtotal before taxes and fees

tax
number<double>

Tax amount

shipping
number<double>

Shipping cost

convertedTotal
number<double>

Total amount in base currency

shippingAddress
object
billingAddress
object
paymentMethod
object
requestedDeliveryDate
string<date>

Requested delivery date

urgency
enum<string>

Order urgency level

Available options:
low,
normal,
high,
urgent
notes
string

Additional order notes

approvalHistory
object[]

History of approval actions

createdAt
string<date-time>
updatedAt
string<date-time>
approvedAt
string<date-time>

When order was approved