Skip to content

Price

A price represents a sale value of the product. Contains basic and essential information, including SKU, value, currency, normalizer and publishing channel.

Create a new price

Creates a new price for the sale of this product in a publishing channel.

Alert

To update, simply create a new price for it to be updated.

Required scope

Value Description
open:portfolio:write Allows manage prices

Request parameters

Field Type Description Required
type string Identifies the type of the price for the specified SKU. Allowed values list and sell Yes
sku string The unique SKU of the item Yes
value int SKU value, denormalized against currency code Yes
currency string Currency code, according to the ISO-4217 Yes
normalizer int Normalizing value of value for unit of currency. Default value 100. For more information see Yes
extras object Additional information about the price. When there is no value you can send {}. Yes
channel object Channel for price publication Yes
channel.id uuid Channel identification, to view the list of channels, see here Yes
channel.extras object Additional information about the channel. When there is no value you can send {}. Yes

Request:

curl -X 'POST' \
  'https://api.magalu.com/v0/portfolios/prices' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "list",
  "value": 5990,
  "currency": "BRL",
  "normalizer": 100,
  "sku": "abc",
  "extras": {},
  "channel": {
    "id": "1aba5746-1d52-48a1-a7a7-c1307db5e262",
    "extras": {}
  }
}'

Response:

{
  "id": "f00ffabc-5af5-47a8-9626-31d0359c87e2",
  "type": "list",
  "value": 5990,
  "currency": "BRL",
  "normalizer": 100,
  "sku": "abc",
  "extras": {},
  "channel": {
    "id": "1aba5746-1d52-48a1-a7a7-c1307db5e262",
    "extras": {}
  },
  "created_at": "2022-06-15T14:25:37Z"
}

Return code

Note

For more information about status code see Return code

Code Description
201 Created
401 Unauthorized
409 Conflict
403 Forbidden
422 Unprocessable Entity
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout

Retrieve a price list

Returns all available price records.

Note

This endpoint implements pagination, sorting and filters. To learn more, refer to Make paginated requests and query parameters.

Required scope

Value Description
open:portfolio:read Allows list to prices

Query parameters

Field Type Description Required
sku string Returns prices for the specified SKU No
type string Returns the type of the prices for the specified SKU. Allowed values list and sell No
channel.id__in array Returns prices for the specified channels No

Sort parameters

Field Description Required
created_at Sort prices by creation date. No

Request:

curl -X 'GET' \
  'https://api.magalu.com/v0/portfolios/prices' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Response:

{
  "meta": {
    ...
  },
  "results": [
    {
      "id": "f00ffabc-5af5-47a8-9626-31d0359c87e2",
      "type": "list",
      "value": 5990,
      "currency": "BRL",
      "normalizer": 100,
      "sku": "abc",
      "extras": {},
      "channel": {
        "id": "1aba5746-1d52-48a1-a7a7-c1307db5e262",
        "extras": {}
      },
      "created_at": "2022-06-15T14:25:37Z"
    }
  ]
}

Return code

Note

For more information about status code see Return code

Code Description
200 Ok
400 Bad Request
401 Unauthorized
403 Forbidden
422 Unprocessable Entity
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout

Retrieve a price

Return a specific price

Required scope

Value Description
open:portfolio:read Allows access to a price

URL parameters

Field Type Description Required
id uuid price identifier Yes

Request:

curl -X 'GET' \
  'https://api.magalu.com/v0/portfolios/prices/{id}' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Response:

{
  "type": "list",
  "value": 5990,
  "currency": "BRL",
  "normalizer": 100,
  "sku": "abc",
  "extras": {},
  "channel": {
    "id": "1aba5746-1d52-48a1-a7a7-c1307db5e262",
    "extras": {}
  },
  "id": "f00ffabc-5af5-47a8-9626-31d0359c87e2",
  "created_at": "2022-06-15T14:25:37Z"
}

Return code

Note

For more information about status code see Return code

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout