App加Web项目 Opencart Api接口文档,简体版

货运方式

接口描述

URLindex.php?route=checkout/shipping_method/api
功能描述获取货运方式
返回格式Json,UTF8
HTTP请求方式GET

返回参数

参数名参数全称必选参数类型参数描述
codecodetrueString代码
titletitletrueString标题
costcosttrueString费用
tax_class_idtax_class_idtrueInt税 ID
texttexttrueString价格文本

调用示例

index.php?route=checkout/shipping_method/api

响应示例

{
    "shipping_methods":{
        "flat":{
            "title":"一般运费",
            "quote":{
                "flat":{
                    "code":"flat.flat",
                    "title":"一般运费",
                    "cost":"50.00",
                    "tax_class_id":"0",
                    "text":"HK $50.00"
                }
            },
            "sort_order":"1",
            "error":false
        },
        "free":{
            "title":"自提点取货",
            "quote":{
                "free":{
                    "code":"free.free",
                    "title":"自提点取货",
                    "cost":0,
                    "tax_class_id":0,
                    "text":"HK $0.00"
                }
            },
            "sort_order":"2",
            "error":false
        },
        "pickup":{
            "title":"到店自取",
            "quote":{
                "pickup":{
                    "code":"pickup.pickup",
                    "title":"到本商店自取",
                    "cost":0,
                    "tax_class_id":0,
                    "text":"HK $0.00"
                }
            },
            "sort_order":"3",
            "error":false
        }
    },
    "code":"flat.flat"
}


支付方式

接口描述

URLindex.php?route=checkout/payment_method/api
功能描述获取支付方式
返回格式Json,UTF8
HTTP请求方式GET

返回参数

参数名参数全称必选参数类型参数描述
codecodetrueString代码
titletitletrueString标题

调用示例

index.php?route=checkout/payment_method/api

响应示例

{
    "text_agree":"我已经阅读并同意 免责声明 条款",
    "payment_methods":{
        "bank_transfer":{
            "code":"bank_transfer",
            "title":"银行转帐",
            "terms":"",
            "sort_order":""
        },
        "pp_express":{
            "code":"pp_express",
            "title":"PayPal快速结账",
            "terms":"",
            "sort_order":""
        }
    }
}


结账

接口描述

URLindex.php?route=checkout/checkout/api
功能描述结账
返回格式Json,UTF8
HTTP请求方式POST

业务参数

参数名参数全称必选参数类型参数描述
shipping_methodshipping_methodtrueString货运方式    值为:code代码
payment_methodpayment_methodtrueString支付方式    值为:code代码

返回参数

参数名参数全称必选参数类型参数描述
loggedloggedtrueInt是否已登录,登录了为用户ID
accountaccounttrueString帐号类型    guest     register
shipping_requiredshipping_requiredtrueBool是否需要运送

调用示例

index.php?route=checkout/checkout/api

响应示例

{
    "logged":null,
    "account":"guest",
    "shipping_required":true
}


结账登录

接口描述

URLindex.php?route=checkout/login/saveapi
功能描述结账登录
返回格式Json,UTF8
HTTP请求方式POST

业务参数

参数名参数全称必选参数类型参数描述
emailemailtrueString邮箱地址
passwordpasswordtrueString密码

调用示例

index.php?route=checkout/login/saveapi

响应示例

{
    "success": "success"
}


运送资料

接口描述

URLindex.php?route=checkout/guest/api
功能描述订单运送资料
返回格式Json,UTF8
HTTP请求方式POST

业务参数

参数名参数全称必选参数类型参数描述
firstnamefirstnametrueString收货人名称
telephonetelephonetrueString联络电话
emailemailtrueString电邮
address_1address_1trueString收货地址
commentcommentfalseString其他内容

返回参数

参数名参数全称必选参数类型参数描述
firstnamefirstnametrueString收货人名称
telephonetelephonetrueString联络电话
emailemailtrueString电邮
address_1address_1trueString收货地址
commentcommentfalseString其他内容

调用示例

index.php?route=checkout/guest/api

响应示例

{
    "customer_groups":[
        {
            "customer_group_id":"1",
            "approval":"0",
            "sort_order":"1",
            "language_id":"3",
            "name":"Default",
            "description":"test"
        }
    ],
    "customer_group_id":"1",
    "firstname":"收货人名称",
    "lastname":"",
    "email":"电邮",
    "telephone":"联络电话",
    "address_1":"收货地址",
	"comment":"其他内容"
}
{
    "success": "success"
}


结账注册

接口描述

URLindex.php?route=checkout/register/api
功能描述结账注册
返回格式Json,UTF8
HTTP请求方式POST

业务参数

参数名参数全称必选参数类型参数描述
firstnamefirstnametrueString收货人名称
telephonetelephonetrueString联络电话
emailemailtrueString电邮
address_1address_1trueString收货地址
commentcommentfalseString其他内容
passwordpasswordtrueString密码
confirmconfirmtrueString确认密码

返回参数

同上

调用示例

index.php?route=checkout/register/api

响应示例

{
    "customer_groups":[
        {
            "customer_group_id":"1",
            "approval":"0",
            "sort_order":"1",
            "language_id":"3",
            "name":"Default",
            "description":"test"
        }
    ],
    "customer_group_id":"1",
    "firstname":"收货人名称",
    "lastname":"",
    "email":"电邮",
    "telephone":"联络电话",
    "address_1":"收货地址",
	"comment":"其他内容"
}
{
    "success": "success"
}


上一篇:解决firefox总是提示flash插件被拦截,要手动点击允许的问题,

下一篇:App加Web项目 Opencart Api接口文档,繁体版

评论列表
发表评论
称呼
邮箱
网址
验证码(*)
热评文章
相关阅读