https://api.exowpee.com/v1. Requests and responses are JSON.
Before you start
You need an account that can sign in. A member signs up with Check an email address and then Sign up with a company, and must verify the email address before signing in. The address must be real: its domain is checked, so an address such asname@example.com is refused. See Sign up and sign in.
1. Sign in
Sign in isPOST /v1/auth/{type}/login. The type is one of user, agent, client, client_agent, organization or organization_agent. A member who works in a company signs in as user.
username is the email address for members. It must be an email address, or 3 to 100 letters, digits, _, . or -, and it is lower-cased. An agent account also sends the company_id it belongs to (client_id for client_agent, organization_id for organization_agent); for the other types these fields are refused. The route allows 5 attempts per minute.
The answer carries the token:
expires_in is the life of the token in seconds: 7 days unless your installation sets otherwise. Send the token on every following call:
2. Select a company
A member’s token has no company or profile selected yet. With it, only a few routes answer, such as View my account; the others, including the list below, answer 403 with “Select a profile before using this workspace.” The sign-in answer lists the member’s active profile assignments inuser.user_profiles. Pick the assignment of the company you want to work in (right after sign-up there is only one) and send its id to Switch company profile:
auth.access_token replaces the previous token, which stops working. An agent account skips this step: its token already carries its company and profile.
3. Read a list
List categories needs thecategories.list permission.
meta.next_cursor as cursor to get the next page. The list parameters are per_page, cursor, sort_by and sort_order (asc or desc). per_page is held between 1 and 1000.
On the actions that have been migrated, ?fields=id,title keeps only the listed keys, and ?include= adds related objects. Both go in the query string.
4. Write
Create a category needs thecategories.create permission, a title and a sort_order.
?response=resource to get the created object back, with status 201:
Money
Exowpee stores every amount as an integer in minor units (the smallest unit of the currency), with acurrency_code and a currency_exponent. In the API, the format depends on the action. Sales, prices and purchases send and return amounts in the main unit of the currency, with no more decimals than currency_exponent (for example unit_price on an order). Accounting actions send and return integers in minor units (for example amount on a journal line). Each reference page gives the format of its fields. XOF has an exponent of 0, so 200,000 FCFA is 200000 in both formats.
Errors
Wrong credentials, an expired, missing or replaced token, and a token of another kind of account than the route accepts are also answered with 401, in the standard Laravel body (
message). Other errors, such as a missing resource, follow the framework’s standard answers.
Where next
- Your first API call to run Exowpee locally.
- Open your shop on Exowpee for a complete setup in order.
- The big picture for the model behind the calls.