Register a new Expense Management System(EMS)
POST
/dr/v1/expense/register
const url = 'https://sender.sandbox-api.kivra.com/dr/v1/expense/register';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"external_id":"0123456789abcdef0123456789abcdef01234567890","name":"Company Expense","icon_url":"https://www.ems.se/icon","url":"https://api.ems.se/v1"}'};
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://sender.sandbox-api.kivra.com/dr/v1/expense/register \ --header 'Content-Type: application/json' \ --data '{ "external_id": "0123456789abcdef0123456789abcdef01234567890", "name": "Company Expense", "icon_url": "https://www.ems.se/icon", "url": "https://api.ems.se/v1" }'Access scope
- EMS
Request Bodyrequired
Section titled “Request Bodyrequired”Takes in a expense management object with required information to create a new expense management system
Media typeapplication/json
RegisterEMS
object
external_id
External ID of the expense management system that identifies it in foreign system
string
name
The name of the expense management system
string
url
A URL that points to the root URL of the foreign EMS API
string
icon_url
An optional icon URL that represents the full URL to an icon belonging to the EMS
string
Example
{ "external_id": "0123456789abcdef0123456789abcdef01234567890", "name": "Company Expense", "icon_url": "https://www.ems.se/icon", "url": "https://api.ems.se/v1"}Responses
Section titled “Responses”Expense management sucessfully created
Bad request
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Examples
Exampleunauthorized
{ "error_code": "40000", "short_message": "bad request", "long_message": "body s missing required fields or has invalid fields"}Internal server error
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Example
{ "error_code": "50000", "short_message": "internal server error", "long_message": "unknown error ocurred"}