Postme HTTP API¶
Companies¶
-
POST
/api/company
¶ Push a new company.
Example request:
POST /api/company HTTP/1.1 Host: example.com Content-Type: application/json { "name": "My Organization", "address": { "address_1": "456 Street Name", "address_2": "", "postal_code": "69003", "city": "Lyon", "country_code": "FR" }, "identification": { "siren_id": "654654654", "vat_id": "FR27654654654", "siret_id": "65465465400045" } }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json
Request Headers: - Accept –
application/json
- Authorization –
Bearer [TOKEN]
Response Headers: - Content-Type –
application/json
Status Codes: - 201 Created – Company created
- 400 Bad Request – Invalid params
- 401 Unauthorized – Invalid Authorization Token
- Accept –
Invoices¶
-
POST
/api/invoices
¶ Push a new invoice.
Example request:
POST /api/invoices HTTP/1.1 Host: example.com Content-Type: application/json
Example response:
HTTP/1.1 202 Accepted Vary: Accept Content-Type: application/json
JSON Parameters: - invoice (object-invoice) – the invoice
Request Headers: - Accept –
application/json
- Authorization –
Bearer [TOKEN]
Response Headers: - Content-Type –
application/json
Status Codes: - 202 Accepted – Invoice successfully sent to postme
- 400 Bad Request – Invalid params
- 401 Unauthorized – Invalid Authorization Token
Parties¶
-
POST
/api/parties
¶ Push a new party.
Example request:
POST /api/parties HTTP/1.1 Host: example.com Content-Type: application/json { "app_id": "456456", "app_reference": "CUSTOMER-145", "type": "individual", "person": { "name": "John Doe", "email": "john.doe@gmail.com", "phone": "+33601010101", "address": { } } }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json
Request Headers: - Accept –
application/json
- Authorization –
Bearer [TOKEN]
Response Headers: - Content-Type –
application/json
Status Codes: - 201 Created – Party created
- 400 Bad Request – Invalid params
- 401 Unauthorized – Invalid Authorization Token
- 409 Conflict – Another party with ID
app_id
already exists
- Accept –
-
GET
/api/parties
¶ Get all parties
Example request:
GET /api/parties HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": "00b1c348-260b-11e7-80e3-c6514258f3b9", "app_id": "456456", "app_reference": "CUSTOMER-145", "type": "individual", "person": { "name": "John Doe", "email": "john.doe@gmail.com", "phone": "+33601010101", "address": { } } }, { "id": "ffb057b4-260a-11e7-80e3-c6514258f3b9", "app_id": "456456", "app_reference": "CUSTOMER-145", "type": "individual", "person": { "name": "John Doe", "email": "john.doe@gmail.com", "phone": "+33601010101", "address": { } } } ]
Request Headers: - Authorization –
Bearer [TOKEN]
Response Headers: - Content-Type –
application/json
Status Codes: - 200 OK – A list of parties
- 400 Bad Request – Invalid params
- 401 Unauthorized – Invalid Authorization Token
- Authorization –
-
GET
/api/parties/{app_id}
¶ Get the party with the ID
app_id
.Example request:
GET /api/parties/456456 HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": "fde7cc83-260a-11e7-80e3-c6514258f3b9", "app_id": "456456", "app_reference": "CUSTOMER-145", "type": "individual", "person": { "name": "John Doe", "email": "john.doe@gmail.com", "phone": "+33601010101", "address": { } } }
Request Headers: - Authorization –
Bearer [TOKEN]
Response Headers: - Content-Type –
application/json
Status Codes: - 200 OK – A Party with that ID was found
- 400 Bad Request – Invalid params
- 401 Unauthorized – Invalid Authorization Token
- Authorization –