日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

SAP电商云CCV2 Restful API enablement

發布時間:2023/12/19 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SAP电商云CCV2 Restful API enablement 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

感謝我的同事Zheng Kate的大力幫助。

Attachment 是注冊用戶的下單流程:

里面用了幾個環境變量,你需要設置下, 只是紅色部分

使用這個json的前提;

(1) 在hac里面有mobile_android的client, kevin說你知道怎么導入
(2) 在頁面上先去注冊一個用戶 A
(3) 在postman的環境變量里把A的user和password和host的值先設置上

導入json后使用:

(1) 第一步獲取token,拷貝下,在postman的環境變量里把client_customer的值設置下
(2) Create cart, 生成的cartID,拷貝下,在postman的環境變量里把cartguid的值設置下
(3) 然后按著順序運行,運行到第7步下單后會生成一個orderid
(4) 運行第8步需要改下url里面的orderid就可以了

{"info": {"_postman_id": "6b7f9822-6ca0-4c24-a14f-d00a7e8b73b0","name": "Reg-PlaceOrder","schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item": [{"name": "1. auth - client_customer","request": {"method": "POST","header": [],"url": {"raw": "https://{{host}}:9002/authorizationserver/oauth/token?client_id=mobile_android&client_secret=secret&grant_type=password&username={{user}}&password={{password}}","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["authorizationserver","oauth","token"],"query": [{"key": "client_id","value": "mobile_android"},{"key": "client_secret","value": "secret"},{"key": "grant_type","value": "password"},{"key": "username","value": "{{user}}"},{"key": "password","value": "{{password}}"}]}},"response": []},{"name": "2. CreateCart","request": {"method": "POST","header": [{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true},{"key": "","value": "","type": "text","disabled": true}],"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/carts","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","carts"]}},"response": []},{"name": "3. addProduct","request": {"method": "POST","header": [{"key": "Content-Type","name": "Content-Type","value": "application/json","type": "text"},{"key": "Content-Type","name": "Content-Type","value": "application/json","type": "text","disabled": true},{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true}],"body": {"mode": "raw","raw": "{\n\t\"product\": {\n\t\t\"code\": \"779866\",\n\t\t\"quantity\": 1\n\t}\n}"},"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/carts/{{cartguid}}/entries","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","carts","{{cartguid}}","entries"]}},"response": []},{"name": "4. CreateAddress","request": {"method": "POST","header": [{"key": "Content-Type","name": "Content-Type","value": "application/json","type": "text"},{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true},{"key": "","value": "","type": "text","disabled": true}],"body": {"mode": "raw","raw": "{\n \"country\": {\n \"isocode\": \"AD\"\n },\n \"defaultAddress\": true,\n \"firstName\": \"terry\",\n \"id\": \"8796552134679\",\n \"lastName\": \"tan\",\n \"line1\": \"tianfu\",\n \"line2\": \"sdas\",\n \"postalCode\": \"610000\",\n \"titleCode\": \"mr\",\n \"town\": \"city\"\n}\n\n\n"},"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/carts/{{cartguid}}/addresses/delivery","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","carts","{{cartguid}}","addresses","delivery"]}},"response": []},{"name": "5. deliveryMode","request": {"method": "PUT","header": [{"key": "Content-Type","name": "Content-Type","value": "application/json","type": "text","disabled": true},{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true}],"body": {"mode": "raw","raw": ""},"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/carts/{{cartguid}}/deliverymode?deliveryModeId=standard-gross","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","carts","{{cartguid}}","deliverymode"],"query": [{"key": "deliveryModeId","value": "standard-gross"}]}},"response": []},{"name": "6. accPaymentDetail","request": {"method": "POST","header": [{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true},{"key": "Content-Type","name": "Content-Type","value": "application/json","type": "text"}],"body": {"mode": "raw","raw": "{\n \"accountHolderName\": \"kate\",\n \"billingAddress\": {\n \"cellphone\": \"13444444444\",\n \"companyName\": \"company\",\n \"country\": {\n \"isocode\": \"CN\",\n \"name\": \"string\"\n },\n \"defaultAddress\": true,\n \"district\": \"CN-12-1-1\",\n \"email\": \"k.zheng@sap.com\",\n \"firstName\": \"string\",\n \"formattedAddress\": \"string\",\n \"lastName\": \"string\",\n \"line1\": \"string\",\n \"line2\": \"string\",\n \"phone\": \"12333333333\",\n \"postalCode\": \"string\",\n \"region\": {\n \"countryIso\": \"CN\",\n \"isocode\": \"CN-12\",\n \"isocodeShort\": \"string\",\n \"name\": \"string\"\n },\n \"shippingAddress\": true,\n \"title\": \"string\",\n \"titleCode\": \"mrs\",\n \"town\": \"CN-12-1\",\n \"visibleInAddressBook\": true\n },\n \"cardNumber\": \"1234567890987654\",\n \"cardType\": {\n \"code\": \"visa\",\n \"name\": \"string\"\n },\n \"defaultPayment\": true,\n \"expiryMonth\": \"12\",\n \"expiryYear\": \"2022\"\n}"},"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/carts/{{cartguid}}/paymentdetails","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","carts","{{cartguid}}","paymentdetails"]}},"response": []},{"name": "7. accPlaceOrder","request": {"method": "POST","header": [{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true}],"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/orders?cartId={{cartguid}}&lang=en","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","orders"],"query": [{"key": "cartId","value": "{{cartguid}}"},{"key": "lang","value": "en"}]}},"response": []},{"name": "8. getOrder","request": {"method": "GET","header": [{"key": "Content-Type","name": "Content-Type","value": "application/json","type": "text","disabled": true},{"key": "Authorization","value": "{{trust_credential}}","description": "trust_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_credential}}","description": "client_credential","type": "text","disabled": true},{"key": "Authorization","value": "{{client_customer}}","description": "client_customer","type": "text"},{"key": "Authorization","value": "{{client_manager}}","description": "client_manager","type": "text","disabled": true}],"url": {"raw": "https://{{host}}:9002/rest/v2/electronics/users/{{user}}/orders/00001003","protocol": "https","host": ["{{host}}"],"port": "9002","path": ["rest","v2","electronics","users","{{user}}","orders","00001003"]}},"response": []}],"protocolProfileBehavior": {} }

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":

總結

以上是生活随笔為你收集整理的SAP电商云CCV2 Restful API enablement的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。