REST

Fra Shoporama dokumentation
Skift til: Navigation, Søgning

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

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

related

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

in_menu

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

basket_id

shipping_id

voucher_id

del_country_id

order_country_id

status

invoice_id

voucher_code

voucher_discount

voucher_discount_amount

captured

transaction_id

responce_id

card_type

tracking_number

price

shipping_price

vat

total_price

email

phone

ean_number

vat_number

order_company_name

order_name

order_address

order_zipcode

order_city

del_company_name

del_name

del_address

del_zipcode

comments

del_city

extra

note

pickup_address

tracking_called

shop_gateway_need_update

shop_gateway_need_booking

after_purchase_mail

tt_status

tt_data

meta

log

from_subscription

send_to_del

mailed