Homerr API Documentation

OVERVIEW

Welcome to Homerr!

The Homerr API allows developers to integrate Homerr services to offer their customers in their online store, application, or e-commerce platform.

WHO IS THIS API FOR

This API is mainly for online retailers who would like to offer Homerr service to their customers. Use our powerful and easy to use RESTful APIs to integrate your e-commerce store’s checkout process with Homerr.

Generate Token for Third Party Integration

URL:

POST api/2.0/third_party_generate_token

Headers:

Content-Type:application/json

Body:

{
  "token_key":""
}

Response On Success

{
  "TOKEN":"",
  "success": true
}

Response On Error

If token not present:

{
  "error_code":"TOKEN_KEY_NOT_PRESENT",
  "message":"Token key not present",
  "success":false
}
If token is invalid:

{
  "error_code": "INVALID_TOKEN_KEY",
  "message": "Invalid token key",
  "success": false
}

Search for Homers by Address

URL:

POST api/2.0/search_homers_by_address

Headers:

Content-Type:application/json

Body

{
  "token":"",
  "street":"Van Diementstraat",
  "zipCode":"1013 CR",
  "city":"Amsterdam",
  "houseNo":"306",
  "package_size": 0,
  "date_from":"2015-08-12 00:00:00",
  "date_to":"2025-08-12 00:00:00",
  "order_type": "PICKUP",
  "max_results":""
}

Response On Success

Array of available homers
If token not present:

{
  "error_code": "TOKEN_NOT_PRESENT",
  "message": "Token not present",
  "success": false
}

Response On Error

If token invalid:

{
  "error_code": "INVALID_TOKEN",
  "message": "Token is not valid",
  "success": false
}
If token invalid:

{
  "error_code": "INVALID_TOKEN",
  "message": "Token is not valid",
  "success": false
}

Make a Pickup Order for Third Party Integration

URL:

POST api/2.0/third_party_integration

Headers:

Content-Type:application/json

Body

{
  "email":"testuser12@homerr.com",
  "token":"",
  "homer_id":number,
  "name":"3rd party user",
  "address":"",
  "zip_code":"",
  "phone_number":"",
  "place":""
}

Required parameters:

email, token, homer_id.

If newly created user needs to log in via mobile app, then address, valid zip code and place is required.

Response On Success

{
  "USER_CREATED": true,
  "PICKUP_CREATED": true,
  "success": true
}
If user with the provided email already exists:

{
  "USER_CREATED": false,
  "PICKUP_CREATED": true,
  "success": true
}

Response On Error

If token not present:

{
  "error_code": "TOKEN_NOT_PRESENT",
  "message": "Token not present",
  "success": false
}
If token invalid:

{
  "error_code": "INVALID_TOKEN",
  "message": "Token is not valid",
  "success": false
}

Password Change

URL

POST api/2.0/password-update

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "old_password":"testen1",
  "new_password":"testen",
  "password_confirmation":"testen"
}

Response On Success

{
  "PASSWORD_UPDATED": true,
  "success": true
}

Response On Error

{
  "error_code": "OLD_PASSWORD_INCORRECT",
  "message": "Old password not correct",
  "success": false
}

{
  "error_code": "REPEATED_PASSWORD_INCORRECT",
  "message": "Repeated password differs from the new password",
  "success": false
}

{
  "error_code": "ALL_FIELDS_REQUIRED",
  "message": "All fields are required",
  "success": false
}

Update Homer Point Available Hours

URL

PUT api/2.0/homer-available-hours

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "mon_from": "11:45",
  "mon_to": "12:45",
  "tue_from": "11:45",
  "tue_to": "12:45",
  "wed_from": "11:45",
  "wed_to": "12:45",
  "thu_from": "11:45",
  "thu_to": "12:45",
  "fri_from": "11:45",
  "fri_to": "12:45",
  "sat_from": "11:45",
  "sat_to": "12:45",
  "sun_from": "11:45",
  "sun_to": "12:45",
}

Response On Success

{
  "success": true
}

Response On Error

If current user is not a homer:

{
  "error_code": "ERROR_UPDATING_AVAILABLE_HOURS",
  "success": false
}

Get Homer Point Available Hours

URL

GET api/2.0/homer-available-hours

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "success": true,

  {
          "mon_from": "11:45",
          "mon_to": "12:45",
          "tue_from": "11:45",
          "tue_to": "12:45",
          "wed_from": "11:45",
          "wed_to": "12:45",
          "thu_from": "11:45",
          "thu_to": "12:45",
          "fri_from": "11:45",
          "fri_to": "12:45",
          "sat_from": "11:45",
          "sat_to": "12:45",
          "sun_from": "11:45",
          "sun_to": "12:45"
    }
}

Response On Error

{
  "error_code": "ERROR_GETTING_AVAILABLE_HOURS",
  "Error getting available hours":,
  "success": false
}
If user not found:

{
  "error": "user_not_found"
}

Customer Login

URL

POST api/1.0/customer/login

Headers

Content-Type:application/json

Body

{
  "email":"email ",
  "password":"pass"
}

Response On Success

{
  "token":"token_value",
  "success":true,
  "is_homer":true/false
}

Response On Error

INVALID_CREDENTIALS
VALIDATION_ERROR
UNEXPECTED_LOGIN_ERROR

Customer Get Share Promotion Code

URL

POST api/1.0/customer/promotion

Headers

Content-Type:application/json
Authorization: Bearer 12324534

Body


Response On Success

{
  "code":123FADSF
}

Customer Delete

URL

DELETE api/1.0/customer/me

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "success":true
}

Response On Error

NOT_LOGGED_IN

Customer Logout

URL

GET api/1.0/customer/logout

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "success":true
}

Response On Error

INVALID_TOKEN

Customer Profile

URL

GET api/1.0/customer/profile

Headers

Authorization: Bearer <<token>>

Body


Response On Success

User profile from Bearer token

Customer Facebook Login

URL

POST api/1.0/customer/login

Headers

Content-Type:application/json

Body

{
  "token":access token obtained from fb login
}

Response On Success

{
  "token":"token_value",
  "success":true,
  "is_homer":true/false
}

Response On Error

FB_LOGIN_ERROR

Customer Registration

URL

POST api/1.0/customer

Headers

Content-Type:application/json

Body

{
  "name":"FirstName LastName",
  "email":"email ",
   "password":"pass",
   "address":"addr",
   "zip_code":"zip",
   "place":"place",
   "phone_number":"+....",
   "profile_picture_file_id":"fileId"
 }

Response On Success

{
  "token":"token_value",
  "success":true
}
If zip code not supported

{
  "token":"token_value",
  "success":true,
  "warning":ZIP_CODE_NOT_COVERED
}

Response On Error

USER_ALREADY_REGISTERED
VALIDATION_ERROR
UNEXPECTED_ERROR

Customer Update

URL

PUT api/1.0/customer

Headers

Content-Type:application/json

Body

{
  "name":"FirstName LastName",
  "email":"email ",
  "password":"pass",
  "address":"addr",
  "zip_code":"zip",
  "place":"place",
  "phone_number":"+....",
  "profile_picture_file_id":"fileId",
  "notification_order_received": 1/0,
  "notification_accepted_suggestion": 1/0,;
  "notification_rejected_received": 1/0,
  "notification_packed_picked_up_delivered": 1/0,
  "notification_order_closed": 1/0,
  "notification_email_enabled": 1/0
}

Response On Success

{
  "token":"token_value",
  "success":true
}

Response On Error

VALIDATION_ERROR
UNEXPECTED_ERROR

Password Reset

URL

POST api/1.0/password-reset

Headers

Content-Type:application/json

Body

{
  "email": "email "
}

Response On Success

{
  "message":"success message",
  "success":true
}

Response On Error

INVALID_USER

Email is not sending currently(until server is setup) but functionality is there for the app. To integrate.

Password Change

URL

POST api/2.0/password-update

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "old_password":"testen1",
  "new_password":"testen",
  "password_confirmation":"testen"
}

Response On Success

{
  "PASSWORD_UPDATED": true,
  "success": true
}

Response On Error

{
  "error_code": "OLD_PASSWORD_INCORRECT",
  "message": "Old password not correct",
  "success": false
}

{
  "error_code": "REPEATED_PASSWORD_INCORRECT",
  "message": "Repeated password differs from the new password",
  "success": false
}

{
  "error_code": "ALL_FIELDS_REQUIRED",
  "message": "All fields are required",
  "success": false
}

Insert Retour

URL

POST api/1.0/retour

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "homer_id":"3",
  "package_size":0/1/2,
  "expected_delivery_date_from":"yyyy-mm-dd",
  "expected_delivery_date_to":"yyyy-mm-dd",
  "receipt_id": <file id>,
  "status": ,'in_tranzit'/'received'/'closed',
  "track_code": "the code"
}

Response On Success

{
  "message":"Retour successfully saved.",
  "success":true,
  "id": new order id
}

Response On Error

Validation errors
HOMER_DOES_NOT_EXIST
NOT_SUPPORTED_BY_SUBSCRIPTION

Confirm Retour

URL

PUT api/1.0/retour/confirm/{id}

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "promotion_code":"optional promo code"
}

Response On Success

{
  "id":order id,
  "success":true
}

Response On Error

INVALID_RETOUR_ID
USER_HAS_SUBSCRIPTION -in case that promo code is sent and user has subscription
INVALID_PROMOTION_CODE - in case of invalid promotion code

Homer Accept Retour

URL

GET api/1.0/retour/accept/{id}

Headers


Body


Response On Success

Message - Return request has been accepted by homer
Body - order_id, order_type

Homer Decline Retour

URL

GET api/1.0/retour/decline/{id}

Headers


Body


Response On Success

Message - Return request has been declined by homer
Body - order_id, order_type

Get Retour

URL

GET api/1.0/retour/<id>

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "order":retour details,
  "success":true
}

Update Retour

URL

PUT api/1.0/retour/{id}

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "homer_id":"3",
  "package_size":0/1/2,
  "expected_delivery_date_from":"yyyy-mm-dd",
  "expected_delivery_date_to":"yyyy-mm-dd",
  "receipt_id": <file id>,
  "rating": 1..5,
  "status": ,'in_tranzit'/'received'/'closed',
  "track_code": "the code"
}

Response On Success

{
  "success":true
}

Response On Error

Validation errors
INVALID_ENTITY_ID
If retour for passed id is not found

Insert Pickup

URL

POST api/1.0/pickup

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "homer_id":"3",
  "package_size":0/112,
  "expected_delivery_date_from":"yyyy-mm-dd",
  "expected_delivery_date_to":"yyyy-mm-dd",
  "receipt_id": <file id>,
  "status": ,'in_tranzit'/'received'/'closed',
  "delivery_suggestion_id": <id of suggestion>,
  "track_code": "the code",
  "promotion_code":12354
}

Response On Success

{
  "message":"Pickup successfully saved.",
  "success":true,
  "id": new order id
}

Response On Error

Validation errors
HOMER_DOES_NOT_EXIST
NOT_SUPPORTED_BY_SUBSCRIPTION
If pickup for passed id is not found

Get Pickup

URL

GET api/1.0/pickup/<id>

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "order":retour details,
  "success":true
}

Update Pickup

URL

PUT api/1.0/pickup/{id}

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "homer_id":"3",
  "package_size":0/1/2,
  "expected_delivery_date_from":"yyyy-mm-dd",
  "expected_delivery_date_to":"yyyy-mm-dd",
  "receipt_id": <file id>,
  "rating": 1..5,
  "status": ,'in_tranzit'/'received'/'closed',
  "last_suggested_by": ‘homer’/’customer’,
  "track_code": "the code"
}

Response On Success

{
  "success":true
}

Response On Error

Validation errors
INVALID_ENTITY_ID
If pickup for passed id is not found

Insert Delivery

URL

POST api/1.0/delivery

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "homer_id":"3",
  "package_size":0/1/2,
  "expected_delivery_date_from":"yyyy-mm-dd",
  "expected_delivery_date_to":"yyyy-mm-dd",
  "receipt_id": <file id>,
  "status": ,'in_tranzit'/'received'/'closed',
  "delivery_suggestion_id": <id of suggestion>,
  "track_code": "the code",
  "promotion_code":12354
}

Response On Success

{
  "message":"Delivery successfully saved.",
   "success":true, "id": new order id
}

Response On Error

Validation errors
HOMER_DOES_NOT_EXIST
NOT_SUPPORTED_BY_SUBSCRIPTION

Get Delivery

URL

GET api/1.0/delivery/<id>

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "order":retour details,
  "success":true
}

Update Delivery

URL

PUT api/1.0/delivery/{id}

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "homer_id":"3",
  "package_size":0/1/2,
  "expected_delivery_date_from":"yyyy-mm-dd",
  "expected_delivery_date_to":"yyyy-mm-dd",
  "receipt_id": <file id>,
  "rating": 1..5,
  "status": ,'in_tranzit'/'received'/'closed',
  "last_suggested_by": ‘homer’/’customer’,
  "track_code": "the code"
}

Response On Success

{
  "message":"Delivery successfully saved.",
  "success":true
}

Response On Error

Validation errors
INVALID_ENTITY_ID
If delivery for passed id is not found

Get All Orders by Status

(retours, pickups, deliveries)

URL

GET api/1.0/order-history/{type}/{status}?page=1,2….
type = homer/customer
Status = in_tranzit, closed

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

Array of orders with "type" field set to retour/delivery/pickup and status closed

Get All Orders

(retours, pickups, deliveries)

URL

GET api/1.0/order-history/{type}?status={status array}&page=1,2….
Status array(optional)- statuses delimited with comma(,)
Exm. in_tranzit,closed,rejected
Default returns all statuses
type = homer/customer

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

Array of orders with "type" field set to retour/delivery/pickup and status closed

Get Specific Order Type for Customer by Status

(retours, pickups, deliveries)

URL

GET api/1.0/order/{type}/{status}?page=1,2….
type = retours/deliveries/pickups
status= in_tranzit, closed

Headers

Content-Type:application/json
Authorization: Bearer <<token>>tto

Body


Response On Success

Array of orders with requested type or empty array

Get Specific Order Type for Customer

(retours, pickups, deliveries)

URL

GET api/1.0/order/{type}?status={status array}&page=1,2….
Status array(optional)- statuses delimited with comma(,)
Exm. in_tranzit,closed,rejected
Default returns all statuses

Type - retours/deliveries/pickups

Headers

Content-Type:application/json
Authorization: Bearer <<token>>tto

Body


Response On Success

Array of orders with requested type or empty array

Get specific order type for homer by status

(retours, pickups, deliveries)

URL

GET api/1.0/homer-order/{type}/{status}?page=1,2….  -
type = retours/deliveries/pickups
Status = in_tranzit, closed

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

Array of orders with requested type or empty array

Get Specific Order Type for Homer

(retours, pickups, deliveries)

URL

GET api/1.0/homer-order/{type}?status={status array}&page=1,2….
Status array(optional)- statuses delimited with comma(,)
Exm. in_tranzit,closed,rejected
Default returns all statuses
type = retours/deliveries/pickups

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

Array of orders with requested type or empty array

Upload Image

URL

POST api/1.0/file

Headers

Content-Type: multipart/form-data

Body

"file" is variable name for image

Response On Success

{
  "file_id": <inserted file id>,
  "success": true
}

Get Image

URL

GET api/1.0/file/{id}

Headers

Authorization: Bearer <code>
(needed when logged in user tries to access his files)

Body


Response On Success

Image file for displaying.

Response On Error

If user token has expired etc.

401
{
  "error_code": "INVALID_TOKEN",
  "message": "Cannot parse token",
  "success": false
}
If user cannot access resource:

401
{
  "error_code": "ACCESS_DENIED",
  "message": "Forbidden access to resource",
   "success": false
}

Save Homer Details

URL

PUT api/1.0/homer/{homerId}

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "is_premium": 1/0,
  "scan_id": <file id>/null,
  "proof_of_address": <file id>/null,
}

This is Homer model that has to be passed for update.

Response On Success

{
  "success": true
}

Response On Error

If current user is not a homer

{
  "error_code": "HOMER_DOES_NOT_EXIST",
  "message": "Homer with id {id} does not exist",
  "success": false
}

Become Homer

URL

POST api/1.0/homer

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "success" : true
}

Response On Error

{
  "error_code": "HOMER_ALREADY_REGISTERED",
  "message": "Homer with id {id} already registered",
  "success": false
}

Get Homer

URL

GET api/1.0/homer/<id>

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "homer": {
    "customer_id": ,
    "is_premium": ,
    "scan_id": "",
    "proof_of_address":,
    "name": "",
    "address": "",
    "zip_code": "",
    "place": "",
    "phone_number": ""
  },
  "success": true
}

Response On Error

{
  "error_code": "HOMER_DOES_NOT_EXIST,
  "success": false
}

Get Homer Availability

URL

GET api/1.0/homer-availability?size=10&page=N

Size is default value is 10, it is optional parameter.

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "homer_availabilities": {
    "total": 3,
    "per_page": "2",
    "current_page": 1,
    "last_page": 2,
    "next_page_url": "http://localhost:8000/api/1.0/homer-availability?page=2",
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "id": 7,
        "customer_id": 1,
        "date_from": "2016-03-11 11:11:00",
        "date_to": "2016-03-11 12:11:00",
        "availability": 1,
        "created_at": "2016-08-28 19:19:45",
        "updated_at": "2016-08-28 19:19:45",
        "Is_date_range": 1/0
      },
      {
        "id": 8,
        "customer_id": 1,
        "date_from": "2016-03-11 11:11:00",
        "date_to": "2016-03-11 12:11:00",
        "availability": 1,
        "created_at": "2016-08-28 19:19:47",
        "updated_at": "2016-08-28 19:19:47",
        "Is_date_range": 1/0
      }
    ]
  },
  "success": true
}

Add Homer Availability - Bulk

URL

POST api/1.0/homer-availability/date-range

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "until_date": 1473897600, - utc timestamp for until date
  "days": [1, 2, 3, 4, 5,6 ,7], - monday(1), sunday(7)
  "availability": 0/1
}

Response On Success

{
  "success": true
}

Response On Error

Validation - data errors

{
  "error_code": "VALIDATION_ERRORS",
  "message": all validation errors,
  "success": false
}

INVALID_UNTIL_DATE_PARAMETER -  if until date is before current date

Add Homer Availability

URL

POST api/1.0/homer-availability

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "date_from": "Y-m-d H:i" - 2016-01-01 11:45,
  "date_to": "Y-m-d H:i" - 2016-01-01 11:45,
  "availability": true/false
}

Response On Success

{
  "success": true
}

Response On Error

Validation - data errors

DUPLICATE_AVAILABILITY - when you try to insert date which already exists

{
  "error_code": "VALIDATION_ERRORS",
  "message": all avlidation errors,
  "success": false
}

Get Homer Point Available Hours

URL

GET api/2.0/homer-available-hours

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

[
  "success": true,
  {
    "mon_from": "H:i" - 11:45,
    "mon_to": "H:i" - 12:45,
    "tue_from": "H:i" - 11:45,
    "tue_to": "H:i" - 12:45,
    "wed_from": "H:i" - 11:45,
    "wed_to": "H:i" - 12:45,
    "thu_from": "H:i" - 11:45,
    "thu_to": "H:i" - 12:45,
    "fri_from": "H:i" - 11:45,
    "fri_to": "H:i" - 12:45,
    "sat_from": "H:i" - 11:45,
    "sat_to": "H:i" - 12:45,
    "sun_from": "H:i" - 11:45,
    "sun_to": "H:i" - 12:45

  }
]

Response On Error

{
  "error_code": "ERROR_GETTING_AVAILABLE_HOURS",
  "Error getting available hours":,
  "success": false
}

Add Homer Availability Array

URL

POST api/1.0/homer-availability/bulk

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "availability":[
    {
      "date_from": "Y-m-d H:i" - 2016-01-01 11:45,
      "date_to": "Y-m-d H:i" - 2016-01-01 11:45,
      "availability": true/false
    },
    {
       "date_from": "Y-m-d H:i" - 2016-01-01 11:45,
       "date_to": "Y-m-d H:i" - 2016-01-01 11:45,
       "availability": true/false
    }....
  ]
}

Response On Success

{
  "success": true
}

Response On Error

Validation - data errors

DUPLICATE_AVAILABILITY - when you try to insert date which already exists
{
  "error_code": "VALIDATION_ERRORS",
  "message": all avlidation errors,
  "success": false
}

Delete Homer Availability

URL

DELETE api/1.0/homer-availability/<id>

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "success": true
}

Response On Error

Validation - data errors

{
  "error_code": "INVALID_HOMER_AVAILABILITY,
  "success": false
}

Update Homer Availability

URL

PUT api/1.0/homer-availability

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "date_from": "Y-m-d H:i" - 2016-01-01 11:45,
  "date_to": "Y-m-d H:i" - 2016-01-01 11:45,
  "availability": true/false
}

Response On Success

{
  "success": true
}

Response On Error

If current user is not a homer

{
  "error_code": "INVALID_HOMER_AVAILABILITY",
  "success": false
}
Validation - data errors

{
  "error_code": "VALIDATION_ERRORS",
  "message": all validation errors,
  "success": false
}

Update Homer Point Available Hours

URL

PUT api/2.0/homer-available-hours

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "mon_from": "H:i" - 11:45,
  "mon_to": "H:i" - 12:45,
  "tue_from": "H:i" - 11:45,
  "tue_to": "H:i" - 12:45,
  "wed_from": "H:i" - 11:45,
  "wed_to": "H:i" - 12:45,
  "thu_from": "H:i" - 11:45,
  "thu_to": "H:i" - 12:45,
  "fri_from": "H:i" - 11:45,
  "fri_to": "H:i" - 12:45,
  "sat_from": "H:i" - 11:45,
  "sat_to": "H:i" - 12:45,
  "sun_from": "H:i" - 11:45,
  "sun_to": "H:i" - 12:45,
}

Response On Success

{
  "success": true
}

Response On Error

If current user is not a homer

{
  "error_code": "ERROR_UPDATING_AVAILABLE_HOURS",
  "success": false
}

Find Homers by Distance

URL

POST api/1.0/homer/search

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "package_size": 0/1/2,
  "date_from":"Y-m-d H:i",
  "date_to":"Y-m-d H:i",
  "order_type": "DELIVERY" - /RETOUR/PICKUP
}

Response On Success

Returns top 50 of homers that are in radius 10km (check if radius is OK)

Show Homer Settings

URL

GET api/1.0/homer-settings/id

NOTE: id is ignored, we must use it because of the REST protocol, you can send whatever.

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "customer_id": 3,
  "price_pickup": "0.00",
  "price_delivery": "0.00",
  "pickup_enabled": 0,
  "delivery_enabled": 0,
  "retour_enabled": 0,
  "notification_new_order": 0,
  "notification_pickup_suggestion": 0,
  "notification_retour_request": 0,
  "notification_delivery_suggestion": 0,
  "notification_set_availability": 0,
  "created_at":"2016-08-14 12:25:12",
  "updated_at": "2016-08-14 12:25:12"
}
If user is not a homer
HOMER_DOES_NOT_EXIST

Update Homer Settings

URL

PUT api/1.0/homer-settings/id

NOTE: id is ignored, we must use it because of the REST protocol, any value can be sent.

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Send this as JSON equivalent

'price_pickup' => 'required|numeric|between:0,1.0',
'price_delivery' => 'required|numeric|between:0,1.5',
'price_retour' => 'required|numeric|between:0,3.5',
'pickup_enabled' => 'required|numeric|between:0,1',
'delivery_enabled' => 'required|numeric|between:0,1',
'retour_enabled' => 'required|numeric|between:0,1',
'package_size' => 'required|numeric|between:0,2',
'notification_new_order' => 'required|numeric|between:0,1',
'notification_pickup_suggestion' => 'required|numeric|between:0,1',
'notification_retour_request' => 'required|numeric|between:0,1',
'notification_delivery_suggestion' => 'required|numeric|between:0,1',
'notification_set_availability' => 'required|numeric|between:0,1',
'email_notification' => 'required',

Response On Success

{
  "success": true
}

If user is not a homer, returns error code:

'error_code' => 'INVALID_HOMER',
'message' => 'Currently logged in user is not a homer.',
'success' => false
Validation errors:
'error_code' => 'VALIDATION_ERROR',
'message' => array of valdiation errors,
'success' => false

Get Subscription Plans

URL

GET api/1.0/subscription-plans

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

Array of subscription plans or empty array

Get Payment Options

URL

GET api/1.0/payment-options/id

NOTE: id is ignored, we must use it because of the REST protocol, any value can be sent.

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "customer_id": 2,
  "current_balance": "0.00",
  "bank": "",
  "name_on_bank_account": "",
  "account_number": "",
  "created_at": "2016-08-23 11:08:18",
  "updated_at": "2016-08-23 11:08:18",
  "success": true
}

Update Payment Options

URL

PUT api/1.0/payment-options/id

NOTE: id is ignored, we must use it because of the REST protocol, you can send whatever.

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "bank": "",
  "name_on_bank_account": "",
  "account_number": ""
}

Response On Success

{
  "success": true
}

Add an Issue Report

URL

POST api/1.0/issue-reports

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "issue_description":"Lorem ipsum"
}

Response On Success

{
  "success": true
}

Add a Feedback

URL

POST api/1.0/feedback

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "feedback_text":"Lorem ipsum"
}

Response On Success

{
  "success": true
}

Request Withdraw

URL

POST api/1.0/withdraw

Headers

Content-type: application/json
Authorization: Bearer <code>

Body


Response On Success

{
  "success": true
}

Response On Error

NOTHING_TO_WITHDRAW and
INVALID_HOMER
WITHDRAW_TIME_LIMIT

Request Payment Redirect

URL

POST api/1.0/payment/redirect

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "payment_country_code": "NL",
  "payment_locale": "nl_NL",
  "payment_order_id": <id>, newly created order id
  "payment_order_type": "DELIVERY", - /RETOUR/PICKUP,
  "payment_type_subscription_id": 2 - subscription id,
  "payment_option_type": ideal/creditcard/paypal
}

Example:

Ideal
{
  "payment_country_code": "NL",
  "payment_locale": "en_US",
  "payment_order_id": 15,
  "payment_order_type": "DELIVERY",
  "payment_type_subscription_id": 4,
  "payment_option_type": "ideal", //ideal/creditcard/paypal
}

Response On Success

{
  "success": true,
  redirect: url
}

Response On Error

INVALID_ORDER
VALIDATION_FAILED

Credit Cards for Testing

Success

MasterCard
Credit
5399 9999 9999 9999
MasterCard
Debit
5101 1695 7311 2521
Failed card number  4111116666666666

Exp date in future and cvs 111

https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/split-credit-debit-cards/testing

After payment is processed callback is fired api/1.0/payment/callback and callback returns:
{
  "success": true,
  message: COMPLETED
}

Response On Error

TRANSACTION_REJECTED
FAILED_TRANSACTION
TRANSACTION_ALREADY_PROCESSED
ORDER_ALREADY_PROCESSED
INVALID_TRANSACTION
INVALID_CALLBACK_PARAMETERS

Save Device Details

URL

PUT api/1.0/device-details

Headers

Content-type: application/json
Authorization: Bearer <code>

Body

{
  "Device_id":"Device Id",
  "type_of_device":"ios/android"
}

Response On Success

{
  "success": true
}

Get Delivery Suggestion

URL

GET api/1.0/delivery-suggestion/id

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "delivery_suggestion": {
    "id": id of suggestion,
     "suggested_by": customer id,
    "suggested_date_from": "2016-08-07 00:00:00",
    "suggested_date_to": "2016-08-09 00:00:00",
    "is_accepted": 0/1,
    "comment": "a comment",
    "created_at": "2016-09-10 18:48:51",
    "updated_at": "2016-09-10 18:48:51"
  },
  "success": true
}

Insert Delivery Suggestion

URL

POST api/1.0/delivery-suggestion/{orderType}/{orderId}

orderType: DELIVERY/PICKUP

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "suggested_date_from":"2016-08-07 00:00:00",
  "suggested_date_to":"2016-08-09 00:00:00",
  "is_accepted": 0/1,
  "comment":"a comment"
}

Response On Success

{
  "success":true, "id": new suggestion id
}

Response On Error

VALIDATION_ERROR
PUSH_NOTIFICATION_ERROR

Update Delivery Suggestion

URL

PUT api/1.0/delivery-suggestion/{orderType}/{orderId}

orderType: DELIVERY/PICKUP
orderId: the id of the order

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "suggested_date_from":"2016-08-07 00:00:00",
  "suggested_date_to":"2016-08-09 00:00:00",
  "is_accepted": 0/1,
  "comment":"a comment"
}

Response On Success

{
  "success":true
}

Response On Error

VALIDATION_ERROR
PUSH_NOTIFICATION_ERROR

Get Order Price

URL

GET api/1.0/system/settings/{type}
type: pickup/retour/delivery

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "success": true,
  price: 1
}

Response On Error

INVALID_TYPE

Get Marker Image

URL

GET api/1.0/map-marker/{homerId}

Headers


Body


Response On Success

Marker image of homer

Response On Error

Plain marker image

Subscribe to Newsletter (WP site)

URL

POST api/1.0/newsletter-subscription

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

{
  "email": email,
  "name": name,
  "zip_code": zipcode
}

Response On Success

{
  "success": true,
  user:user details
}

Response On Error

VALIDATION_ERRORS

DELETE Newsletter Subscription (WP site)

URL

DELETE api/1.0/newsletter-subscription/{id}

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "success": true,
  user:user details
}

Response On Error

VALIDATION_ERRORS

GET Newsletter Subscription (WP site)

URL

GET api/1.0/newsletter-subscription/{id}

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  subscription object
}

GET Newsletter Subscriptions (WP site)

URL

GET api/1.0/newsletter-subscription

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

Pagination object for subscriptions, ordered by date descending

GET Pricing

URL

GET api/1.0/system/settings/pricing

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  prices:
    {
      delivery: 1,
      pickup: 2,
      return: 3
     }
}

GET Pricing by Type

URL

GET api/1.0/system/settings/{type} - delivery/pickup/retour

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body

Response On Success

{
  price: 123
}

Create User Promotion for Share

URL

POST api/1.0/customer/promotion

Headers

Content-Type:application/json
Authorization: Bearer <<token>>

Body


Response On Success

{
  "success": true,
  code: random code
}