Skip to main content
POST
/
obligations
Create a obligation
curl --request POST \
  --url https://grosh.muathye.com/api/obligations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "opened_date": "2023-12-25",
  "original_amount": 123,
  "outstanding_amount": 1,
  "contact_id": "<string>",
  "account_id": "<string>",
  "currency_id": "<string>",
  "reference": "<string>",
  "notes": "<string>",
  "due_date": "2023-12-25"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "reference": "<string>",
  "notes": "<string>",
  "opened_date": "2023-12-25",
  "due_date": "2023-12-25",
  "original_amount": 123,
  "outstanding_amount": 123,
  "status": "open",
  "settled_at": "2023-11-07T05:31:56Z",
  "contact": {
    "id": "<string>",
    "name": "<string>"
  },
  "account": {
    "id": "<string>",
    "name": "<string>",
    "code": "<string>"
  },
  "currency": {
    "id": "<string>",
    "name": "<string>",
    "code": "<string>"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "deleted_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required
Maximum string length: 150
opened_date
string<date>
required
original_amount
number
required
outstanding_amount
number
required
Required range: x >= 0
contact_id
string
required
account_id
string
required
currency_id
string
required
reference
string | null
Maximum string length: 100
notes
string | null
due_date
string<date> | null

Response

200 - application/json

Successful response

id
string
name
string
reference
string | null
notes
string | null
opened_date
string<date> | null
due_date
string<date> | null
original_amount
number
outstanding_amount
number
status
enum<string>
Available options:
open,
settled
settled_at
string<date-time> | null
contact
object
account
object
currency
object
created_at
string<date-time> | null
updated_at
string<date-time> | null
deleted_at
string<date-time> | null