Sending print orders is done through a REST API. Before being able to make requests to the API, you should first authenticate using the credentials received to obtain an authentication token. The token should be included in the "Authorization" header of every subsequent API request:
Authorization: Bearer <your-authentication-token>
Live API URL https://api.bephoto.be
Authenticate by calling the /user/login endpoint with your credentials:
POST /user/login { "email": "<string>", "password": "<string>" }
Success Response:
{ "status": 1, "token": "<string>" }
Error Response:
{ "error": "Unauthorized" }
Create a new order by calling /orders with optional metadata. After creating an order, you will receive a unique idorder, which should be used in subsequent calls:
POST /orders { "metadata": "<string>" }
Success Response:
{ "status": 1, "order": [{ "idorder": "<integer>", "datestart": "<timestamp>", "totalorder": "<float>", "totalcost": "<float>", "dateconfirmation": "<timestamp>", "dateprocessed": "<timestamp>", "shippingmethod": "<string>", "metadata": "<string>" }] }
Fetch information for an order by calling /orders/{IDORDER}:
GET /orders/{IDORDER}
Success Response:
{ "status": 1, "order": [{ "idorder": "<integer>", "datestart": "<timestamp>", "totalorder": "<float>", "totalcost": "<float>", "dateconfirmation": "<timestamp>", "dateprocessed": "<timestamp>", "shippingmethod": "<string>", "metadata": "<string>" }] }
Get a list of available print products by calling /products:
GET /products
Success Response:
{ "status": 1, "products": [{ "idproduct": "<integer>", "product": "<string>", "dimensions": "<string>", "prices": [{ "price": "<float>", "idpaper": "<integer>" }] }] }
Add products to your order by sending a POST request to /orders/{IDORDER}/products:
POST /orders/{IDORDER}/products { "idproduct": "<integer>", "idpaper": "<integer>", "quantity": "<integer>", "fileurl": "<string>", "filename": "<string>", "filesize": "<integer>" }
Success Response:
{ "status": 1 }
Once all products are added, close the order by calling /orders/{IDORDER}/close:
POST /orders/{IDORDER}/close {}
Success Response:
{ "status": 1 }