Invoices

get
All Invoices

https://yourcompany.sport-keeper.com/api/v1/invoices
Retrieve all invoices
Request
Response
Path Parameters
page
optional
integer
Results are paginated.
Headers
Authorization
required
string
Auth token
200: OK
Returns an array of invoices. Only the first 20 are returned. Passing the page param will paginate the results.
[
{
"id": 1,
"status": "paid",
"member_id": null,
"created_at": "2019-01-24T17:16:35.752-05:00",
"updated_at": "2019-01-24T17:16:35.752-05:00",
"payment_method": "cash",
"facility_coupon_id": null
},
{
"id": 2,
"status": "unpaid",
"member_id": null,
"created_at": "2019-01-25T08:30:15.978-05:00",
"updated_at": "2019-01-25T08:30:15.978-05:00",
"payment_method": "card",
"facility_coupon_id": null
}
]
404: Not Found
Could not find a member matching this query.
null

get
Show Invoice

https://yourcompany.sport-keeper.com/api/v1/invoices/:id
Retrieve a single invoice
Request
Response
Headers
Authorization
required
string
Auth token
200: OK
{
"id": 1,
"status": "paid",
"member_id": null,
"created_at": "2019-01-24T17:16:35.752-05:00",
"updated_at": "2019-01-24T17:16:35.752-05:00",
"payment_method": "cash",
"facility_coupon_id": null
}

post
Create Invoice

https://yourcompany.sport-keeper.com/v1/invoices
Create an invoice with invoice items.
Request
Response
Headers
Authorization
required
string
Auth Token
Form Data Parameters
status
required
integer
0 - unpaid, 1 - paid
member_id
required
integer
ID of the member.
payment_method
required
integer
0 - card, 1 - cash, 2 - bank, 3 - credit, 4 - terminal
invoice_items_attributes
required
array
An array of invoice item attributes
200: OK
{
"id": 1,
"status": "paid",
"member_id": null,
"created_at": "2019-01-24T17:16:35.752-05:00",
"updated_at": "2019-01-24T17:16:35.752-05:00",
"payment_method": "cash",
"facility_coupon_id": null
}

patch
Update Invoice

https://yourcompany.sport-keeper.com/v1/invoices/:id
Update a single invoice. All of the above properties in create invoice are valid.
Request
Response
Headers
Authorization
optional
string
Auth token
200: OK
{
"id": 1,
"status": "paid",
"member_id": null,
"created_at": "2019-01-24T17:16:35.752-05:00",
"updated_at": "2019-01-24T17:16:35.752-05:00",
"payment_method": "cash",
"facility_coupon_id": null
}

delete
Delete a Invoice

https://yourcompany.sport-keeper.com/v1/invoices/:id
Delete a member.
Request
Response
Headers
Authorization
required
string
Auth token.
200: OK
‚Äč