Allocate expense payment to expenses
POST
/api/expense-payments/{id}/allocate
const url = 'https://api.getvespy.com/api/expense-payments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/allocate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"allocations":[{"amountCents":1,"expenseId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.getvespy.com/api/expense-payments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/allocate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "allocations": [ { "amountCents": 1, "expenseId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
allocations
required
Array<object>
object
amountCents
required
integer
expenseId
required
string format: uuid
Examplegenerated
{ "allocations": [ { "amountCents": 1, "expenseId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
expensePayment
required
object
allocatedCents
required
integer
allocations
required
Array<object>
object
amountCents
required
integer
expense
required
object
amountCents
required
integer
category
required
string
description
required
string
id
required
string format: uuid
incurredOn
required
string format: date
name
required
string
outstandingCents
required
integer
status
required
string
vendorName
required
string
expenseId
required
string format: uuid
expensePaymentId
required
string format: uuid
id
required
string format: uuid
amountCents
required
integer
createdAt
required
string format: date-time
currency
required
string
id
required
string format: uuid
memo
required
string
organizationId
required
string format: uuid
paidAt
required
string format: date-time
paymentMethod
required
string
referenceNumber
required
string
status
required
string
unallocatedCents
required
integer
vendor
required
object
id
required
string format: uuid
name
required
string
vendorId
required
string format: uuid
Example
{ "expensePayment": { "allocations": [ { "expense": { "category": "maintenance", "status": "active" } } ], "paymentMethod": "ach", "status": "issued" }}Default Response
Media typeapplication/json
object
code
string
errors
Array<object>
object
code
required
string
message
required
string
path
required
string
message
required
string
Examplegenerated
{ "code": "example", "errors": [ { "code": "example", "message": "example", "path": "example" } ], "message": "example"}Default Response
Media typeapplication/json
object
code
string
errors
Array<object>
object
code
required
string
message
required
string
path
required
string
message
required
string
Examplegenerated
{ "code": "example", "errors": [ { "code": "example", "message": "example", "path": "example" } ], "message": "example"}Default Response
Media typeapplication/json
object
code
string
errors
Array<object>
object
code
required
string
message
required
string
path
required
string
message
required
string
Examplegenerated
{ "code": "example", "errors": [ { "code": "example", "message": "example", "path": "example" } ], "message": "example"}Default Response
Media typeapplication/json
object
code
string
errors
Array<object>
object
code
required
string
message
required
string
path
required
string
message
required
string
Examplegenerated
{ "code": "example", "errors": [ { "code": "example", "message": "example", "path": "example" } ], "message": "example"}Default Response
Media typeapplication/json
object
code
string
errors
Array<object>
object
code
required
string
message
required
string
path
required
string
message
required
string
Examplegenerated
{ "code": "example", "errors": [ { "code": "example", "message": "example", "path": "example" } ], "message": "example"}