curl --request POST \
  --url https://api.rampartcorporation.com/developer/v1/spends \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-account-token: <x-account-token>' \
  --data '{
  "vendorName": "Office Supplies Co.",
  "spends": [
    {
      "quantity": 5,
      "unitPrice": 10.99,
      "name": "Paper Clips",
      "itemId": "ITEM-123",
      "purchaseDate": "2023-01-15T14:30:00Z",
      "uom": "box"
    }
  ]
}'
{
  "success": true,
  "data": [
    {
      "name": "Printer Ink Cartridge",
      "normalizedItemId": "INK-123",
      "unitPrice": 45.99,
      "quantity": 2,
      "savingsRealized": 10.5
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <API_KEY>.

Headers

x-account-token
string
required

Account token for authentication

Body

application/json
vendorName
string
required

Name of the vendor

Example:

"Office Supplies Co."

spends
object[]
required

List of spend items

Response

201 - application/json
Spends created successfully
success
boolean
Example:

true

data
object[]