Images and attachments
Upload an offer image
Upload image to our servers. You can choose from two upload options:

- provide a link and we will download an image for you
- send an image as binary data
Important! Remember to use dedicated domain for upload, i.e.

- https://upload.allegro.pl for Production
- https://upload.allegro.pl.allegrosandbox.pl for Sandbox
Read more about the rules for photos in an offer's gallery and description: PL / EN.

Authorizations:
bearer-token-for-user (allegro:api:sale:offers:write)
 OAuth2: bearer-token-for-user
Important! Do not require the user of your application to register a new instance of the application and send you Client_ID and Client_Secret. Regardless of the authorization method, the application must run on a single key (Client_ID). For more information PL / EN to read about authorization code flow or PL / EN to read about the device code flow.

Flow type: authorizationCode
Authorization URL: https://allegro.pl/auth/oauth/authorize
Token URL: https://allegro.pl/auth/oauth/token
Flow type: x-deviceCode
Request Body schema: 
image/jpeg
image/jpeg
string <binary>
File in a binary format

Responses
201 Image uploaded correctly
Response Schema: application/vnd.allegro.public.v1+json
expiresAt	
string <date-time>
Date of file expiration (removal from the server). We will remove it unless you use it in your offer.

location	
string
Link to the uploaded image

400 Syntactically incorrect request
401 Invalid or missing bearer token
403 Authorization problem
413 Image is too big
415 Unsupported media type
422 Unprocessable entity (problem with image server)

post
/sale/images
Request samples
Payload
Content type

image/jpeg
image/jpeg
No sample
Response samples
201
Content type
application/vnd.allegro.public.v1+json

Copy
{
"expiresAt": "2019-08-24T14:15:22Z",
"location": "string"
}
Create an offer attachment
You can attach pdf, jpeg or png files to your offers. We will present them under the offer description in the Additional information section. You can attach multiple files to one offer – one per each type from the list:

Guide (MANUAL). Allowed media types: PDF
Special offer terms (SPECIAL_OFFER_RULES). Allowed media types: PDF
Competition terms (COMPETITION_RULES). Allowed media types: PDF
Book excerpt (BOOK_EXCERPT). Allowed media types: PDF
Manual (USER_MANUAL). Allowed media types: PDF
Installation manual (INSTALLATION_INSTRUCTIONS). Allowed media types: PDF
Game manual (GAME_INSTRUCTIONS). Allowed media types: PDF
Energy label (ENERGY_LABEL). Allowed media types: JPEG, JPG, PNG
Product information sheet (PRODUCT_INFORMATION_SHEET). Allowed media types: PDF
Tire label (TIRE_LABEL). Allowed media types: JPEG, JPG, PNG
Data processing sheet - software (SOFTWARE_DATA_PROCESSING). Allowed media types: PDF
Data processing sheet - device (HARDWARE_DATA_PROCESSING). Allowed media types: PDF
You can attach up to 20 files to one product for:

Safety information manual (SAFETY_INFORMATION_MANUAL). Allowed media types: PDF, JPEG, JPG, PNG
Uploading attachments flow:

Create an attachment object to receive an upload URL (POST /sale/offer-attachments),
Use the upload URL to submit the file (PUT /sale/offer-attachments/{attachmentId}),
Add attachments to the offer (PATCH /sale/product-offers/{offerId}).
Read more: PL / EN.

Authorizations:
bearer-token-for-user
Request Body schema: application/vnd.allegro.public.v1+json
offer attachment

type	
string (AttachmentType)
Enum: "MANUAL" "SPECIAL_OFFER_RULES" "COMPETITION_RULES" "BOOK_EXCERPT" "USER_MANUAL" "INSTALLATION_INSTRUCTIONS" "GAME_INSTRUCTIONS" "ENERGY_LABEL" "PRODUCT_INFORMATION_SHEET" "TIRE_LABEL" "SAFETY_INFORMATION_MANUAL" "SOFTWARE_DATA_PROCESSING" "HARDWARE_DATA_PROCESSING"
offer attachment type

file	
object (AttachmentFileRequest)
Responses
201 Attachment created successfully
Response Schema: application/vnd.allegro.public.v1+json
id	
string
type	
string (AttachmentType)
Enum: "MANUAL" "SPECIAL_OFFER_RULES" "COMPETITION_RULES" "BOOK_EXCERPT" "USER_MANUAL" "INSTALLATION_INSTRUCTIONS" "GAME_INSTRUCTIONS" "ENERGY_LABEL" "PRODUCT_INFORMATION_SHEET" "TIRE_LABEL" "SAFETY_INFORMATION_MANUAL" "SOFTWARE_DATA_PROCESSING" "HARDWARE_DATA_PROCESSING"
offer attachment type

file	
object (AttachmentFile)
400 Syntactically incorrect request
401 Invalid or missing bearer token
415 Unsupported media type
422 Unprocessable Entity

post
/sale/offer-attachments
Request samples
Payload
Content type
application/vnd.allegro.public.v1+json

Copy
Expand allCollapse all
{
"type": "MANUAL",
"file": {
"name": "abcde.pdf"
}
}
Response samples
201
Content type
application/vnd.allegro.public.v1+json

Copy
Expand allCollapse all
{
"id": "string",
"type": "MANUAL",
"file": {
"name": "abcde.pdf",
"url": "http://upload.allegro.pl/sale/offer-attachments/e9d1bf7c-804e-4faf-9e24-b2d3aa3eda05"
}
}
Upload an offer attachment
Upload an offer attachment. This operation should be used after creating an offer attachment with POST /sale/offer-attachments Important! You can find the URL address to upload the file to our server in the Location response header of POST /sale/offer-attachments. The URL is unique and one-time. As its format may change in time, you should always use the address from the header. Do not compose the address on your own. Read more: PL / EN.

Authorizations:
bearer-token-for-user
path Parameters
attachmentId
required
string
The ID of the attachment.

Request Body schema: 
application/pdf
application/pdf
string <binary>
File in a binary format

Responses
200 File uploaded correctly
400 Syntactically incorrect request
401 Invalid or missing bearer token
415 Unsupported media type

put
/sale/offer-attachments/{attachmentId}
Response samples
200
Content type
application/vnd.allegro.public.v1+json

Copy
Expand allCollapse all
{
"id": "string",
"type": "MANUAL",
"file": {
"name": "abcde.pdf",
"url": "http://upload.allegro.pl/sale/offer-attachments/e9d1bf7c-804e-4faf-9e24-b2d3aa3eda05"
}
}
Get offer attachment details
Get details of an offer attachments, including download link, by attachment identifier ("attachmentId"). The attachment id can be retrieved by querying a particular offer, for example by using GET /sale/product-offers/{offerId}.

Authorizations:
bearer-token-for-user
path Parameters
attachmentId
required
string
The ID of the attachment.

Responses
200 Offer attachment details
Response Schema: application/vnd.allegro.public.v1+json
id	
string
type	
string (AttachmentType)
Enum: "MANUAL" "SPECIAL_OFFER_RULES" "COMPETITION_RULES" "BOOK_EXCERPT" "USER_MANUAL" "INSTALLATION_INSTRUCTIONS" "GAME_INSTRUCTIONS" "ENERGY_LABEL" "PRODUCT_INFORMATION_SHEET" "TIRE_LABEL" "SAFETY_INFORMATION_MANUAL" "SOFTWARE_DATA_PROCESSING" "HARDWARE_DATA_PROCESSING"
offer attachment type

file	
object (AttachmentFile)
403 User has no access to an attachment
404 Non existing attachment