REST
Vores REST-interface ligger på https://www.shoporama.dk/REST, og du kan oprette dine API-nøgler via dette link.
Vi understøtter metoderne POST, PATCH og DELETE. Hvor POST bruges til at oprette resourcer, PATCH bruges til at ændre dem, og DELETE bruges til at slette dem.
Alt data der sendes frem og tilbage mellem Shoporama sendes som JSON. Content-Type skal derfor sættes til application/json. Derudover bør du have en meningsfuld User-Agent der beskriver din app.
Login fungerer via Authorization headeren, og har følgende format:
Authorization: Shoporama ade0fe8617b0825996baa9c8a9324ddb
Hvor sidste del er din API-nøgle.
Indholdsfortegnelse
- 1 Generelt om kaldene
- 2 Endpoints
- 2.1 product
- 2.1.1 POST
- 2.1.2 PATCH
- 2.1.2.1 supplier_id
- 2.1.2.2 brand_id
- 2.1.2.3 name
- 2.1.2.4 description
- 2.1.2.5 list_description
- 2.1.2.6 main_category_id
- 2.1.2.7 vat
- 2.1.2.8 price
- 2.1.2.9 sale_price
- 2.1.2.10 shipping
- 2.1.2.11 shipping_weight
- 2.1.2.12 never_free_shipping
- 2.1.2.13 delivery_time
- 2.1.2.14 delivery_time_not_in_stock
- 2.1.2.15 auto_offline
- 2.1.2.16 no_index
- 2.1.2.17 meta
- 2.1.2.18 meta_title
- 2.1.2.19 meta_description
- 2.1.2.20 canonical_id
- 2.1.2.21 allow_negative_stock
- 2.1.2.22 search
- 2.1.2.23 is_online
- 2.1.2.24 mailing_list_ids
- 2.1.2.25 own_id
- 2.1.2.26 sec_own_id
- 2.1.2.27 images
- 2.1.2.28 file
- 2.1.2.29 stock_settings
- 2.1.2.30 attributes
- 2.1.2.31 bundle
- 2.1.2.32 categories
- 2.1.2.33 related
- 2.1.2.34 html_fields
- 2.1.2.35 discount
- 2.1.2.36 bulk_discount
- 2.1.2.37 rewrite_url
- 2.2 profile
- 2.3 supplier
- 2.4 profile-attribute
- 2.5 profile-attribute-value
- 2.6 category
- 2.7 stock
- 2.8 order
- 2.8.1 POST
- 2.8.2 PATCH
- 2.8.2.1 products
- 2.8.2.2 basket_id
- 2.8.2.3 shipping_id
- 2.8.2.4 voucher_id
- 2.8.2.5 del_country_id
- 2.8.2.6 order_country_id
- 2.8.2.7 status
- 2.8.2.8 invoice_id
- 2.8.2.9 voucher_code
- 2.8.2.10 voucher_discount
- 2.8.2.11 voucher_discount_amount
- 2.8.2.12 paid
- 2.8.2.13 captured
- 2.8.2.14 transaction_id
- 2.8.2.15 responce_id
- 2.8.2.16 card_type
- 2.8.2.17 tracking_number
- 2.8.2.18 price
- 2.8.2.19 shipping_price
- 2.8.2.20 vat
- 2.8.2.21 total_price
- 2.8.2.22 email
- 2.8.2.23 phone
- 2.8.2.24 ean_number
- 2.8.2.25 vat_number
- 2.8.2.26 order_company_name
- 2.8.2.27 order_name
- 2.8.2.28 order_address
- 2.8.2.29 order_zipcode
- 2.8.2.30 order_city
- 2.8.2.31 del_company_name
- 2.8.2.32 del_name
- 2.8.2.33 del_address
- 2.8.2.34 del_zipcode
- 2.8.2.35 comments
- 2.8.2.36 del_city
- 2.8.2.37 extra
- 2.8.2.38 note
- 2.8.2.39 pickup_address
- 2.8.2.40 tracking_called
- 2.8.2.41 shop_gateway_need_update
- 2.8.2.42 shop_gateway_need_booking
- 2.8.2.43 after_purchase_mail
- 2.8.2.44 tt_status
- 2.8.2.45 tt_data
- 2.8.2.46 meta
- 2.8.2.47 log
- 2.8.2.48 from_subscription
- 2.8.2.49 send_to_del
- 2.8.2.50 mailed
- 2.1 product
Generelt om kaldene
Et typisk POST-kald vil se sådan ud:
POST /REST/product HTTP/1.1 Host: www.shoporama.dk Authorization: Shoporama ade0fe8617b0825996baa9c8a9324ddb User-Agent: Min Shoporama integration Content-Type: application/json Content-Length: 29 { "name": "Produktnavn" }
Hvor til Shoporama vil svare noget lignende:
HTTP/1.1 201 Created Location: https://www.shoporama.dk/REST/product/123 Content-Type: application/json
Samt en body der indeholder en JSON-repræsentation af resourcen.
Bemærk at der er en Location header der peger på den nyoprettede resource.
Skal man efterfølgende redigere resourcen kan man PATCH'e det JSON-svar man fik med sine ændringer. PATCH vil kun ændre de felter man sender med, så hvis man kun sender en headline med, så vil description ikke blive nulstillet.
Hvis man vil slette en resource skal man sende en DELETE til resourcens URL.
Endpoints
product
POST
profile_id
name
PATCH
supplier_id
brand_id
name
description
list_description
main_category_id
vat
price
sale_price
shipping
shipping_weight
never_free_shipping
delivery_time
delivery_time_not_in_stock
auto_offline
no_index
meta
meta_title
meta_description
canonical_id
allow_negative_stock
search
is_online
mailing_list_ids
own_id
sec_own_id
images
file
stock_settings
attributes
bundle
categories
html_fields
discount
bulk_discount
rewrite_url
profile
POST
name
PATCH
name
DELETE
supplier
POST
name
dropshipping_mail
PATCH
name
dropshipping_mail
DELETE
profile-attribute
POST
profile_id
type
name
is_variant
has_price
weight
PATCH
profile_id
type
name
is_variant
has_price
weight
DELETE
profile-attribute-value
POST
attribute_id
val
weight
tag
PATCH
val
weight
tag
DELETE
category
POST
parent_id
name
PATCH
name
sort_order
no_index
tag
empty_redir
description_a
description_b
meta_title
meta_description
canonical_id
meta
images
weight, description, remove, data
rewrite_url
DELETE
stock
POST
SKU
stock
order
POST
xxx
PATCH
products
product_id, order_product_id, amount, own_id, attributes, attribute_id, stock, unit_price, unit_vat