Listings

All listings endpoints.

GET/listings/:id

Listing

Get single listing.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

GET
/listings/:id
curl https://api.olx.ba/listings/:id \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"id": 40,
	"type": "single",
	"title": "audi a3",
	"slug": "audi-a3",
	"short_description": "Audi a3",
	"additional": {
		"description": "opis oglasa"
	},
	"user": {
		"id": 1,
		...
	},
	"price": 11990,
	"display_price": "11.990 KM",
	"regular_price": 0,
	"listing_type": "sell",
	"price_by_agreement": false,
	"visible": false,
	"quantity": 1,
	"location": {
		"lat": 43.1973791,
		"lon": 17.5461833
	},
	"status": "active",
	"available": false,
	"state": "used",
	"shipping": "no_shipping"
	...
}

POST/listings

Create new listing

Create new listing.

Note: Your new listing will have the status DRAFT when you save it. You must publish the listing to make it active.

Publish listing

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Required attributes

  • Name
    title
    Type
    string
    Description

    Listing title.

Optional attributes

  • Name
    short_description
    Type
    string
    Description

    Short description.

  • Name
    description
    Type
    string
    Description

    Description.

  • Name
    country_id
    Type
    string
    Description

    Country ID ( check Location resources ).

  • Name
    city_id
    Type
    string
    Description

    City ID ( check Location resources ).

  • Name
    price
    Type
    numeric
    Description

    Price

  • Name
    available
    Type
    boolean
    Description

    Available

  • Name
    listing_type
    Type
    string
    Description

    Listing type:

    • sell
    • buy
    • rent
  • Name
    state
    Type
    string
    Description
    • new
    • used
  • Name
    brand_id
    Type
    string
    Description

    Brand id ( check Categories resource for brand references )

  • Name
    model_id
    Type
    string
    Description

    Brand id ( check Categories resource for model references )

  • Name
    sku_number
    Type
    string
    Description

    Internal sku number

  • Name
    attributes
    Type
    array
    Description

    To get attributes for category check Categories references. Example of attributes:

    Attributes

      "attributes" : [
    	{
    		"id": 2,
    		"value": "2022" // Year
    	},
    	{
    		"id": 7,
    		"value": "Dizel" // Fuel type
    	},
    	{
    		"id": 901,
    		"value": "2/3" // Door
    	},
    	{
    		"id": 3,
    		"value": "50000" // Mileage
    	},
    	{
    		"id": 1144,
    		"value": "1.5" // Power
    	},
    	{
    		"id": 5,
    		"value": "55" // Cubic Capacity
    	}
    ]
    

Request

POST
/listings
curl -X POST https://api.olx.ba/listings \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"id": 40,
	"type": "single",
	"title": "audi a3",
	"slug": "audi-a3",
	"short_description": "Audi a3",
	"additional": {
		"description": "opis oglasa"
	},
	"user": {
		"id": 1,
		...
	},
	"price": 11990,
	"display_price": "11.990 KM",
	"regular_price": 0,
	"listing_type": "sell",
	"price_by_agreement": false,
	"visible": false,
	"quantity": 1,
	"location": {
		"lat": 43.1973791,
		"lon": 17.5461833
	},
	"status": "active",
	"available": false,
	"state": "used",
	"shipping": "no_shipping"
	...
}

PUT/listings/:id

Update listing

Update single listing.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Update request

{
	"title": "audi a3",
	"description" : "listing description",
	"price": 11990
}

Request

PUT
/listings/:id
curl -X PUT https://api.olx.ba/listings/:id \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"id": 40,
	"type": "single",
	"title": "audi a3",
	"slug": "audi-a3",
	"short_description": "Audi a3",
	"additional": {
		"description": "opis oglasa"
	},
	"user": {
		"id": 1,
		...
	},
	"price": 11990,
	"display_price": "11.990 KM",
	"regular_price": 0,
	"listing_type": "sell",
	"price_by_agreement": false,
	"visible": false,
	"quantity": 1,
	"location": {
		"lat": 43.1973791,
		"lon": 17.5461833
	},
	"status": "active",
	"available": false,
	"state": "used",
	"shipping": "no_shipping"
	...
}

POST/listings/:id/publish

Publish listing

When you save a new listing, it will have the status "DRAFT." In DRAFT status listing is saved but not visible on search. Use this endpoint in order to activate listing.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

POST
/listings/:id/publish
curl -X POST https://api.olx.ba/listings/:id/publish \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"message": "Oglas je uspjesno objavljen",
	"status": "active"
}

DELETE/listings/:id

Delete listing

Delete single listing.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

DELETE
/listings/:id
curl -X DELETE https://api.olx.ba/listings/:id \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"message": "Uspješno ste izbrisali oglas"
}

GET/listing/refresh/limits

Listing refresh limits

Listing refresh limits.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

GET
/listing/refresh/limits
curl -X GET https://api.olx.ba/listing/refresh/limits \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"free_limit": 750,
	"free_count": 0,
	"paid_count": 0,
	"listing_count": 3
}

GET/listing-limits

Listing limits

Listing limits.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

GET
/listing-limits
curl -X GET https://api.olx.ba/listing-limits \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
"data": {
	"cars": {
		"limit": 0,
		"listings": 0
	},
	"real-estate": {
		"limit": 0,
		"listings": 1
	},
	"other": {
		"limit": 0,
		"listings": 8
	}
}
}

PUT/listings/:id/refresh

Listing refresh

Refesh listing date. It will boost listing on search rank.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

PUT
/listings/:id/refresh
curl -X PUT https://api.olx.ba/listings/:id/refresh \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

{
	"message": "Artikal je uspjesno obnovljen."
}

POST/listings/:id/image-upload

Image upload

Headers

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Required attributes

  • Name
    images
    Type
    array<image>
    Description

    Image files

Attributes

  • Name
    image_url
    Type
    string
    Description

    Image url

Request

POST
/listings/:id/image-upload
curl -X POST https://api.olx.ba/listings/:id/image-upload \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

Response

[
	{
		"id": 44,
		"name": "img-1679924109-fd89f8c193d2.jpeg",
		"main": false,
		"order": 0,
		"sizes": {
			"sm": "listings\/40\/sm\/img-1679924109-fd89f8c193d2.jpeg",
			"lg": "listings\/40\/lg\/img-1679924109-fd89f8c193d2.jpeg"
		},
		"created_at": "2023-03-27T13:35:11.000000Z"
	},
	{
	"id": 45,
	"name": "img-1679924111-6249d3519888.jpg",
	"main": false,
	"order": 0,
	"sizes": {
		"sm": "listings\/40\/sm\/img-1679924111-6249d3519888.jpg",
		"lg": "listings\/40\/lg\/img-1679924111-6249d3519888.jpg"
	},
	"created_at": "2023-03-27T13:35:12.000000Z"
	}
]

POST/listings/:id/image-delete

Image delete

Delete image from listing. In URL is Listing id and in request you need to send imageId.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Required attributes

  • Name
    imageId
    Type
    integer
    Description

    Image ID.

Request

POST
/listings/:id/image-delete
curl -X POST https://api.olx.ba/listings/:id/image-delete \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \
	-d '{"imageId":"1"}'

Response

{
	"success" : true
}

POST/listings/:id/image-main

Image set main

Set main image. In URL is listing ID and in request you need to send imageId.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Required attributes

  • Name
    imageId
    Type
    integer
    Description

    Image ID.

Request

POST
/listings/:id/image-main
curl -X PUT https://api.olx.ba/listings/:id/image-main \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \
	-d '{"imageId":"1"}'

Response

{
	"success" : true
}	

POST/listings/:id/finish

Finish listing

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

POST
/listings/:id/finish
curl -X POST https://api.olx.ba/listings/:id/finish \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

POST/listings/:id/hide

Hide listing

Listings that are hidden won't show up in searches. It will appear on your profile in the "hidden" list.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

POST
/listings/:id/hide
curl -X POST https://api.olx.ba/listings/:id/hide \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \

POST/listings/:id/unhide

Unhide listing

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    Authorization
    Type
    string
    Description

    Beare <token>

Request

POST
/listings/:id/unhide
curl -X POST https://api.olx.ba/listings/:id/unhide \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer {token}" \