天天看点

SAP电商云CCV2 Restful API enablement

SAP电商云CCV2 Restful API enablement
{
    "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\": \"[email protected]\",\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": {}
}
      

继续阅读