divido/divido-php

v1.15-stable 2018-01-21 15:38 UTC

README

这是 Divido API 的文档。

注册账户以获得对沙盒环境的即时访问。

当前版本:v1.15

入门

与 Divido API 完成集成有多个不同的部分

  • 交易计算器
  • 财务
  • 信用申请
  • 完成信用申请
  • 激活
  • 取消
  • 退款
  • 列出所有申请
  • 检索一个申请
  • 报告/列出所有付款批次
  • 报告/从付款批次检索记录

交易计算器

计算年利率、月还款额、期限等

财务

列出针对特定商家的费率卡和所有可用金融产品。

信用申请

创建新的信用提案并返回申请表URL

完成信用申请

完成已接受的信用申请,将更新贷款协议并返回合同签署URL。

激活

激活整个或部分申请

取消

取消已取消的申请

退款

退还已激活申请的部分或全部

列出所有申请

返回您的申请列表。申请按创建日期排序,最近创建的申请排在前面。

检索一个申请

检索现有申请的详细信息。提供申请ID,API将返回相应的申请。

报告/列出所有付款批次

检索所有付款批次。

报告/从付款批次检索记录

检索付款批次的内容。提供批次ID,API将返回所有记录。

变更日志

2018-14-03

  • 在 webhook 部分添加了 IP 地址列表(适用于生产环境和沙盒)

2017-11-03

  • 更新了 Applications 端点的示例响应,包括 urllenderLoanReference

2017-04-21

  • 添加了文本元素到地址对象,用于合并地址行到平面、街道、建筑号、建筑名。

2017-03-25

  • 添加了金额、产品和参考到取消请求。这允许部分取消当前未激活的金额

2017-03-13

  • 添加了送货地址到信用请求

2016-12-20

  • 添加了交易计算器
  • 添加了直接签署到信用请求
  • 添加了完成信用请求
  • 添加了激活状态

2016-11-28

  • 在激活和退款中添加了引用
  • 安全增强:添加了对使用共享密钥对所有 API 调用进行签名的支持,有关更多信息请联系 Divido 支持。

2016-11-16

  • 在“列出所有应用”中对提案添加了筛选器
  • 更新了 webhook 响应
  • 在信用请求中添加了引用

2016-11-07

  • 为退款和激活添加了产品金额

2016-11-02

  • 为退款和激活添加了产品行

2016-11-01

  • 将履行更改为激活
  • 添加了报告

2016-10-30

  • 在响应中添加了退款、履行和履行状态

2016-10-18

  • 删除了交易计算器
  • 添加了新的状态
  • 更改了产品数据集
  • 更新了 API 的响应

2016-09-27

  • 添加了部分履行
  • 添加了退款
  • 添加了列出所有应用
  • 添加了检索一个申请
  • 添加了新的状态
  • 错误修复

2016-06-28

  • 添加了取消方法
  • 结账 URL
  • 错误修复
  • 添加了更多社区库

2016-01-28

  • 添加了履行方法

2015-06-21

  • 添加了产品到信用请求
  • 活动改为财务

官方库

我们强烈建议使用我们的官方库来访问 Divido API。以下列出了我们的官方库以及社区支持的库。

PHP

从源安装

git clone https://github.com/DividoFinancialServices/divido-api-php.git

社区库

请向此页面提交拉取请求以添加应在此处展示的任何缺失库。请注意,Divido 不提供对社区库的支持。

Magento 1.*

Magento 2

WooCommerce

OpenCart

使用API

API端点

要使用Divido API查询数据,您需要向正确的端点发送请求。请求端点应取决于您是否希望查询生产环境或沙盒环境。

  • 沙盒: https://secure.sandbox.divido.com/v1/
  • 生产: https://secure.divido.com/v1/

HTTP响应代码

您可能会遇到以下响应代码。任何不成功的响应代码都将包含更多信息,以帮助您识别问题的原因。

  • 200 请求已成功。

  • 201 请求已满足并导致创建了新资源。新创建的资源可以通过响应实体的URI(s)进行引用,资源的最具体URI由Location头字段给出。

  • 404 未找到。请求的资源未找到。响应体将解释哪个资源未找到。

  • 500 内部服务器错误。服务器在处理您的请求时遇到错误并失败。请向Divido支持团队报告此问题。

Webhooks

为了提醒您资源状态的变化,Divido提供了webhooks。这些是在资源状态改变时发送到您的服务器的POST请求。请求体包含变化的详细信息。

IP地址列表

52.211.249.159 生产

54.72.119.96 生产

52.211.116.109 生产

52.212.234.209 生产

34.249.63.178 沙盒

请求

API服务器将向与应用程序相关联的response_url或Divido支持团队设置的webhook_url发送POST请求。

参数

application 应用程序ID

proposal 提案ID

reference 第三方参考(如果作为应用程序的一部分提供)

status 新状态

metadata 元数据(如果作为应用程序的一部分提供)

示例请求

JSON示例

{
    "application": "C84047A6D-89B2-FECF-D2B4-168444F5178C",
    "event": "application-status-update",
    "metadata": {
        "Invoice Number": "844001",
        "Order Number": "100019"
    },
    "name": "John Doe",
    "proposal": "PAA717844-EE9D-78AF-D11C-EDCC1D180F87",
    "reference": "100019",
    "status": "ACCEPTED"
}

可能的状态

  • PROPOSAL - 提案已发送给承保人,等待决定

  • ACCEPTED - 承保人已接受应用程序

  • DECLINED - 承保人拒绝应用程序

  • REFERRED - 承保人已推荐应用程序,等待新状态

  • INFO-NEEDED - 决定前需要更多信息

  • ACTION-CUSTOMER - 等待客户更多信息

  • ACTION-RETAILER - 等待商家更多信息

  • ACTION-LENDER - 等待承保人更多信息

  • DEPOSIT-PAID - 客户已支付定金

  • SIGNED - 客户已签署所有合同

  • READY - 订单准备发货

  • AWAITING-ACTIVATION - 等待承保人确认

  • AWAITING-CANCELLATION - 等待承保人确认取消

  • PARTIALLY-ACTIVATED - 应用程序部分由商家激活

  • ACTIVATED - 应用程序已激活并由承保人确认

  • CANCELLED - 应用程序已取消

  • REFUNDED - 整个应用程序全额退款

  • COMPLETED - 应用程序完成(冷却期后)

资源

财务

返回一个数组,包含商家可用的所有金融选项

示例请求

GET https://secure.divido.com/v1/finances?merchant={MERCHANT}&country={COUNTRY} HTTP/1.1

示例响应

JSON示例

{
    "finances": [
        {
            "agreement_duration": 6,
            "country": "GB",
            "deferral_period": 0,
            "id": "F06895E17-EE96-926E-7137-37BCABB9DCF7",
            "instalment_fee": 0,
            "interest_rate": 0,
            "max_deposit": 50,
            "min_amount": 150,
            "min_deposit": 0,
            "setup_fee": 0,
            "text": "6 Month 0% Interest Free"
        },
        {
            "agreement_duration": 12,
            "country": "GB",
            "deferral_period": 0,
            "id": "F284D5F1D-E8AF-D4B7-E1AF-A352F6087352",
            "instalment_fee": 0,
            "interest_rate": 0,
            "max_deposit": 50,
            "min_amount": 150,
            "min_deposit": 0,
            "setup_fee": 0,
            "text": "12 Month 0% Interest Free"
        }
    ],
    "status": "ok"
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

country - 国家代码(可选,字符串

Example `GB`

交易计算器

交易计算器计算各种条款和押金的付款条件。

示例请求

GET https://secure.divido.com/v1/dealcalculator?merchant={MERCHANT}&amount={AMOUNT}&deposit={deposit}&country={country}&finance={FINANCE} HTTP/1.1

示例响应

JSON示例

{
    "status": 'ok',
    "purchase_price": 2000,
    "deposit_amount": 200,
    "credit_amount": 1800,
    "monthly_payment_amount": 150,
    "total_repayable_amount": 1800,
    "agreement_duration": 12,
    "interest_rate": 0.0,
    "interest_type": "APR"
 }

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

amount

  • 订单总价值(必需,浮点数
Example `2000.00`

deposit - 押金金额。(必需,浮点数)

Example `200`

country - 国家代码(必需,字符串

Example `GB`

finance - 财务代码(必需,字符串

Example `FA48EC74D-D95D-73A9-EC99-004FBE14A027`

信用申请

信用请求创建一个新的提案并返回到Divido应用程序表单的URL。

示例请求

POST https://secure.divido.com/v1/creditrequest HTTP/1.1

curl https://secure.divido.com/v1/creditrequest \
-d merchant=live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102 \
-d deposit=100 \
-d finance=F06895E17-EE96-926E-7137-37BCABB9DCF7 \
-d directSign=true \
-d country=GB \
-d language=EN \
-d currency=GBP \
-d amount=1197.5 \
-d reference=100019 \
-d "customer[firstName]=John" \
-d "customer[middleNames]=L" \
-d "customer[lastName]=Doe" \
-d "customer[country]=GB" \
-d "customer[address][text]=115 High Street EC2A 4BX" \
-d "customer[address][postcode]=EC2A 4BX" \
-d "customer[address][street]=High street" \
-d "customer[address][flat]=B" \
-d "customer[address][buildingNumber]=115" \
-d "customer[address][buildingName]=Amanda apartments" \
-d "customer[address][town]=London" \
-d "customer[address][monthsAtAddress]=60" \
-d "customer[gender]=male" \
-d "customer[shippingAddress][postcode]=EC2A 4BX" \
-d "customer[shippingAddress][street]=High street" \
-d "customer[shippingAddress][flat]=B" \
-d "customer[shippingAddress][buildingNumber]=115" \
-d "customer[shippingAddress][buildingName]=Amanda apartments" \
-d "customer[shippingAddress][town]=London" \
-d "customer[email]=john.doe@domain.com" \
-d "customer[phoneNumber]=+44201234567" \
-d "customer[dateOfBirthYear]=1967" \
-d "customer[dateOfBirthMonth]=07" \
-d "customer[dateOfBirthDay]=01" \
-d "customer[bank][sortCode]=123456" \
-d "customer[bank][accountNumber]=12345678" \
-d "metadata[Invoice Number]=844001" \
-d "metadata[Order Number]=100019" \
-d "products[1][sku]=GIB100" \
-d "products[1][name]=Gibson Les Paul Studio Raw Guitar" \
-d "products[1][quantity]=1" \
-d "products[1][price]=1153.00" \
-d "products[1][vat]=20" \
-d "products[1][unit]=pcs" \
-d "products[1][image]=http://www.webshop.com/images/GIB100.png" \
-d "products[2][sku]=H10" \
-d "products[2][name]=Restring Upgrade" \
-d "products[2][quantity]=0.5" \
-d "products[2][price]=89" \
-d "products[2][vat]=20" \
-d "products[2][unit]=hour" \
-d "products[2][attributes]=1" \
-d "responseUrl=http://www.webshop.com/response.php" \
-d "checkoutUrl=http://www.webshop.com/checkout" \
-d "redirectUrl=http://www.webshop.com/success.html"

示例响应

JSON示例

{
    "id": "PD66DF728-5646-22E3-EF6F-CD3D2D094170",
    "status": "ok",
    "token": "bcaa33546495965c4c8b3dc41d8582a1",
    "url": "https://secure.divido.com/token/bcaa33546495965c4c8b3dc41d8582a1"
}

参数

merchant - 您唯一的账户标识符(必需,字符串)-

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

deposit - 押金金额。(必需,浮点数)

Example `100`

finance - 财务代码(必需,字符串

Example `F23B150D4-9D00-724A-6DFA-A1E726F6761A`

directSign - 是否在批准后立即进行签名(可选,布尔值,默认为 true

Example `true`

country - 国家代码(必需,字符串

Example `GB`

language - 国家代码(必需,字符串

Example `EN`

currency - 货币代码(必需,字符串

Example `GBP`

amount - 与提案相同的货币的订单总额。用于验证产品行项目中的总额。(可选,浮点数

Example `1197.5`

reference - 您的内部参考,将在webhooks中返回。(可选,浮点数

Example `100019`

customer['firstName'] - 客户姓名(可选,字符串

Example `Jane`

customer['middleNames'] - 客户中间名(可选,字符串

Example `L`

customer['lastName'] - 客户姓(可选,字符串

Example `Doe`

customer['country'] - 客户国家(可选,字符串

Example `GB`

customer['address']['text'] - 客户地址(一行)。我们将尝试匹配地址并将其拆分为街道、公寓、建筑号、建筑名称。(可选,字符串

Example `115 High street EC2A 4BX`

customer['address']['postcode'] - 客户邮政编码(可选,字符串

Example `EC2A 4BX`

customer['address']['street'] - 客户街道(可选,字符串

Example `High street`

customer['address']['flat'] - 客户公寓(可选,字符串

Example `B`

customer['address']['buildingNumber'] - 客户建筑号(可选,字符串

Example `115`

customer['address']['buildingName'] - 客户建筑名称(可选,字符串

Example `Amanda apartments`

customer['address']['town'] - 客户城镇(可选,字符串

Example `London`

customer['address']['monthsAtAddress'] - 客户居住地址的月份(可选,字符串

Example `60`

customer['shippingAddress']['postcode'] - 客户邮政编码(可选,字符串

Example `EC2A 4BX`

customer['shippingAddress']['street'] - 客户街道(可选,字符串

Example `High street`

customer['shippingAddress']['flat'] - 客户公寓(可选,字符串

Example `B`

customer['shippingAddress']['buildingNumber'] - 客户建筑号(可选,字符串

Example `115`

customer['shippingAddress']['buildingName'] - 客户建筑名称(可选,字符串

Example `Amanda apartments`

customer['shippingAddress']['town'] - 客户城镇(可选,字符串

Example `London`

customer['gender'] - 客户性别(可选,字符串

Example `male`

customer['email'] - 客户电子邮件(可选,字符串

Example `jane.doe@email.com`

customer['phoneNumber'] - 客户电话号码(可选,字符串

Example `0201234567`

customer['dateOfBirthYear'] - 客户出生年份(可选,字符串

Example `1967`

customer['dateOfBirthMonth'] - 客户出生月份(可选,字符串

Example `07`

customer['dateOfBirthDay'] - 客户出生日期(可选,字符串

Example `01`

customer['bank']['sortCode'] - 客户银行排序码(可选,字符串

Example `123456`

customer['bank']['accountNumber'] - 客户银行账户号码(可选,字符串

Example `12345678`

metadata['key'] - 元数据键(可选,字符串

Example `Invoice Number`

metadata['value'] - 元数据值(可选,字符串

Example `844001`

products['1']['sku'] - 产品SKU(可选,字符串

Example `GIB100`

products['1']['name'] - 产品名称/描述(可选,字符串

Example `Gibson Les Paul Studio Raw Guitar`

products['1']['quantity'] - 产品数量(可选,字符串

Example `1`

products['1']['price'] - 与提案相同的货币的产品价格(可选,字符串

Example `1153.00`

products['1']['vat'] - 产品增值税百分比 (可选,字符串)

Example `20`

products['1']['unit'] - 产品单位 (可选,字符串)

Example `pcs`

products['1']['image'] - 产品图片 (可选,字符串)

Example `http://www.webshop.com/images/GIB100.png`

products['1']['attributes'] - 产品属性(1=服务费,2=运费,3=支付费,6=折扣,10=价格不含增值税,20=行项目含订单增值税总额)(可选,字符串)

Example `1,2`

responseUrl - 我们发送有关付款通知的URL (可选,字符串)

Example `http://www.webshop.com/response.php`

checkoutUrl - 如果客户被拒绝或希望取消其申请,Divido将客户重定向到的URL (可选,字符串)

Example `http://www.webshop.com/checkout`

redirectUrl - 成功申请后客户将被重定向到的URL (可选,字符串)

Example `http://www.webshop.com/success.html`

完成信用申请

完成已接受的信用申请,将更新贷款协议并返回合同签署的URL。这仅适用于创建directSign = false的信用申请。

示例请求

POST https://secure.divido.com/v1/creditrequest/finalize HTTP/1.1

curl https://secure.divido.com/v1/creditrequest \
-d merchant=live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102 \
-d application=CAAC243AC-499A-84AF-DBBA-F58B9F7E798C \
-d deposit=100 \
-d finance=F06895E17-EE96-926E-7137-37BCABB9DCF7 \
-d amount=1197.5 \
-d "products[1][sku]=GIB100" \
-d "products[1][name]=Gibson Les Paul Studio Raw Guitar" \
-d "products[1][quantity]=1" \
-d "products[1][price]=1153.00" \
-d "products[1][vat]=20" \
-d "products[1][unit]=pcs" \
-d "products[1][image]=http://www.webshop.com/images/GIB100.png" \
-d "products[2][sku]=H10" \
-d "products[2][name]=Restring Upgrade" \
-d "products[2][quantity]=0.5" \
-d "products[2][price]=89" \
-d "products[2][vat]=20" \
-d "products[2][unit]=hour" \
-d "products[2][attributes]=1" \
-d "redirectUrl=http://www.webshop.com/success.html"

示例响应

JSON示例

{
    "id": "CAAC243AC-499A-84AF-DBBA-F58B9F7E798C",
    "status": "ok",
    "token": "bcaa33546495965c4c8b3dc41d8582a1",
    "url": "https://secure.divido.com/token/bcaa33546495965c4c8b3dc41d8582a1"
}

激活

激活整个或部分申请并从承保人那里启动支付。通过指定应激活的产品来激活申请的一部分。如果没有提交产品数据,则整个申请将被激活。

示例请求

POST https://secure.divido.com/v1/activation HTTP/1.1

curl https://secure.divido.com/v1/activation \
-d merchant="live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102" \
-d application="CAAC243AC-499A-84AF-DBBA-F58B9F7E798C" \
-d "products[1][sku]=GIB100" \
-d "products[1][name]=Gibson Les Paul Studio Raw Guitar" \
-d "products[1][quantity]=1" \
-d "products[1][price]=1153.00" \
-d "products[1][vat]=20" \
-d "products[2][sku]=H10" \
-d "products[2][name]=Restring Upgrade" \
-d "products[2][quantity]=0.5" \
-d "products[2][price]=89" \
-d "products[2][vat]=20" \
-d "products[2][attributes]=1" \
-d amount=1197.5 \
-d deliveryMethod="delivery" \
-d trackingNumber="DHL291824419F" \
-d reference="9482471" \
-d comment="Order was delivered to the customer by DHL" \

示例响应

JSON示例

{
    "result": {
        "creditAmount": 1097.5,
        "depositAmount": 100,
        "depositStatus": "PAID-BY-CARD",
        "activatedAmount": 1197.5,
        "activationStatus": "AWAITING-ACTIVATION",
        "activations": [
            {
                "amount": 1197.5,
                "comment": "Order was delivered to the customer by DHL",
                "date": "2016-10-26 04:11",
                "deliveryMethod": "delivery",
                "reference": "9482471",
                "status": "AWAITING-ACTIVATION",
                "trackingNumber": "DHL291824419F"
            }
        ],
        "cancellations": [],
        "cancelledAmount": 0,
        "id": "C8A05742F-3040-44EC-C252-050FD8869F79",
        "lender": {
            "app": "Demo",
            "id": "L10F2BE8F-EF89-E403-E38F-8589ED2E51F5",
            "name": "Demo"
        },
        "purchasePrice": 1197.5,
        "refundedAmount": 0,
        "refunds": [],
        "status": "AWAITING-ACTIVATION"
    },
    "status": "ok"
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102 `

application - 申请或提案标识符。(必需,字符串)

Example `CAAC243AC-499A-84AF-DBBA-F58B9F7E798C`

products['1']['sku'] - 产品SKU(可选,字符串

Example `GIB100`

products['1']['name'] - 产品名称/描述(可选,字符串

Example `Gibson Les Paul Studio Raw Guitar`

products['1']['quantity'] - 产品数量(可选,字符串

Example `1`

products['1']['price'] - 与提案相同的货币的产品价格(可选,字符串

Example `1153.00`

products['1']['vat'] - 产品增值税百分比 (可选,字符串)

Example `20`

amount - 激活产品的总和 (可选,字符串)

Example `1197.5`

deliveryMethod - 商品交付方式,可以是“store”或“delivery” (必需,字符串)

Example `delivery`

trackingNumber - 如果交付方式是“delivery”并且你有跟踪号 (可选,字符串)

Example `DHL291824419F`

reference - 用于识别激活的您的参考 (可选,字符串)

Example `9482471 `

comment - 对承保人的评论,可以是订单号或其他信息 (可选,字符串)

Example `Order was delivered to the customer by DHL`

取消

将申请标记为已取消并通知承保人,只有当申请是DRAFT、REFERRED、INFO-NEEDED、ACTION-CUSTOMER、ACTION-RETAILER、ACTION-LENDER、ACCEPTED、DEPOSIT-PAID、PARTIALLY-ACTIVATED、SIGNED、READY时才可行。

示例请求

POST https://secure.divido.com/v1/cancellation HTTP/1.1

curl https://secure.divido.com/v1/cancellation \
-d merchant="live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102" \
-d application="CAAC243AC-499A-84AF-DBBA-F58B9F7E798C" \
-d "products[1][sku]=H10" \
-d "products[1][name]=Restring Upgrade" \
-d "products[1][quantity]=0.5" \
-d "products[1][price]=89" \
-d "products[1][vat]=20" \
-d "products[1][attributes]=1" \
-d amount=44.5 \
-d reference="7321834" \
-d comment="Customer requested to cancelled the order"

示例响应

JSON示例

{
    "result": {
        "creditAmount": 1097.5,
        "depositAmount": 100,
        "depositStatus": "UNPAID",
        "activatedAmount": 0,
        "activationStatus": "AWAITING-ACTIVATION",
        "activations": [],
        "id": "CAAC243AC-499A-84AF-DBBA-F58B9F7E798C",
        "lender": {
            "app": "Demo",
            "id": "L10F2BE8F-EF89-E403-E38F-8589ED2E51F5",
            "name": "Demo"
        },
        "purchasePrice": 1197.5,
        "refundedAmount": 0,
        "refunds": [],
        "cancelledAmount": 44.5,
        "cancellations": [
            {
                "date": "2017-03-27 02:46",
                "amount": 44.5,
                "status": "PENDING",
                "reference": "ref: 1490582812",
                "comment": ""
            }
        ],
        "status": "AWAITING-CANCELLATION"
    },
    "status": "ok"
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102 `

application - 申请或提案标识符。(必需,字符串)

Example `CAAC243AC-499A-84AF-DBBA-F58B9F7E798C `

products['1']['sku'] - 产品SKU(可选,字符串

Example `H10`

products['1']['name'] - 产品名称/描述(可选,字符串

Example `Restring Upgrade`

products['1']['quantity'] - 产品数量(可选,字符串

Example `1`

products['1']['price'] - 与提案相同的货币的产品价格(可选,字符串

Example `89`

products['1']['vat'] - 产品增值税百分比 (可选,字符串)

Example `20`

products['1']['attributes'] - 产品属性(1=服务,2=运费,3=支付费,10=价格不含增值税)(可选,字符串)

Example `1,2`

amount - 退款项目的总和 (可选,字符串)

Example `89`

reference - 用于识别退款的您的参考 (可选,字符串)

Example `7321834`

comment - 对承保人的评论,可以是订单号或其他信息 (可选,字符串)

Example `Customer requested to cancelled the order`

退款

部分或全部退款申请,如果申请是AWAITING-ACTIVATION、PARTIALLY-ACTIVATED、ACTIVATED或COMPLETED。对于部分退款,指定已退款的商品。如果没有提交产品数据,则整个申请将被退款。

示例请求

POST https://secure.divido.com/v1/refund HTTP/1.1

curl https://secure.divido.com/v1/refund \
-d merchant="live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102" \
-d application="CAAC243AC-499A-84AF-DBBA-F58B9F7E798C" \
-d "products[1][sku]=H10" \
-d "products[1][name]=Restring Upgrade" \
-d "products[1][quantity]=0.5" \
-d "products[1][price]=89" \
-d "products[1][vat]=20" \
-d "products[1][attributes]=1" \
-d amount=44.5 \
-d reference="7321834" \
-d comment="Customer returned part of order"

示例响应

JSON示例

{
    "result": {
        "creditAmount": 1097.5,
        "depositAmount": 100,
        "depositStatus": "PAID-BY-CARD",
        "activatedAmount": 1197.5,
        "activationStatus": "AWAITING-ACTIVATION",
        "activations": [
            {
                "amount": 1197.5,
                "comment": "Order was delivered to the customer by DHL",
                "date": "2016-10-26 04:11",
                "deliveryMethod": "delivery",
                "reference": "9482471",
                "status": "AWAITING-ACTIVATION",
                "trackingNumber": "DHL291824419F"
            }
        ],
        "cancellations": [],
        "cancelledAmount": 0,
        "id": "C8A05742F-3040-44EC-C252-050FD8869F79",
        "lender": {
            "app": "Demo",
            "id": "L10F2BE8F-EF89-E403-E38F-8589ED2E51F5",
            "name": "Demo"
        },
        "purchasePrice": 1197.5,
        "refundedAmount": 44.5,
        "refunds": [
            {
                "amount": 44.5,
                "comment": "Customer returned part of order",
                "date": "2016-10-26 04:14",
                "reference": "7321834",
                "status": "PENDING"
            }
        ],
        "status": "AWAITING-ACTIVATION"
    },
    "status": "ok"
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102 `

application - 申请或提案标识符。(必需,字符串)

Example `CAAC243AC-499A-84AF-DBBA-F58B9F7E798C`

products['1']['sku'] - 产品SKU(可选,字符串

Example `H10`

products['1']['name'] - 产品名称/描述(可选,字符串

Example `Restring Upgrade`

products['1']['quantity'] - 产品数量(可选,字符串

Example `0.5`

products['1']['price'] - 与提案相同的货币的产品价格(可选,字符串

Example `89`

products['1']['vat'] - 产品增值税百分比 (可选,字符串)

Example `20`

products['1']['attributes'] - 产品属性(1=服务,2=运费,3=支付费,10=价格不含增值税)(可选,字符串)

Example `1,2`

amount - 退款项目的总和 (可选,字符串)

Example `44.5`

reference - 用于识别退款的您的参考 (可选,字符串)

Example `7321834 `

comment - 对承保人的评论,可以是订单号或其他信息 (可选,字符串)

Example `Customer returned part of order`

列出所有申请

返回您的申请列表。申请按创建日期排序,最近创建的申请排在前面。

示例请求

GET https://secure.divido.com/v1/applications?merchant={MERCHANT}&proposal={PROPOSAL}&status={STATUS}&page={PAGE} HTTP/1.1

示例响应

JSON示例

{
    "itemsPerPage": 30,
    "page": 1,
    "records": [
        {
        	  "_activatableAmount": "£ 0",
            "_activatedAmount": "£ 1197.50",
            "_cancelableAmount": "£ 0",
            "_cancelledAmount": "£ 0",
            "_creditAmount": "£ 1197.50",
            "_currentCreditAmount": "£ 1197.50",
            "_depositAmount": "£ 0",
            "_monthlyPaymentAmount": "£ 199.58",
            "_purchasePrice": "£ 1197.50",
            "_refundableAmount": "£ 1197.50",
            "_refundedAmount": "£ 0",
            "_totalRepayableAmount": "£ 1197.48",
            "activatableAmount": 740,
            "activatedAmount": 1197.5,
            "activations": [
                {
                    "_amount": "£ 1197.50",
                    "amount": 1197.5,
                    "comment": "",
                    "date": "2016-10-26 04:20",
                    "deliveryMethod": "delivery",
                    "reference": "9482471",
                    "trackingNumber": ""
                }
            ],
            "agreementDuration": 6,
            "cancelableAmount": 0,
            "cancellations": [],
            "cancelledAmount": 0,
            "channel": {
                "id": "CDDB70595-BFE6-0B7D-EE5B-B09FFC89F98C",
                "name": "Webshop.com",
                "type": "webshop"
            },
            "country": "GB",
            "createdDate": "2016-10-26 04:18",
            "creditAmount": 1197.5,
            "currentCreditAmount": 1197.5,
            "currency": "GBP",
            "deferralPeriod": 0,
            "depositAmount": 0,
            "depositReference": "",
            "depositStatus": "NO-DEPOSIT",
            "directSign": true,
            "email": "john.doe@domain.com",
            "finance": {
                "id": "F06895E17-EE96-926E-7137-37BCABB9DCF7",
                "maxDeposit": 50,
                "minAmount": 150,
                "minDeposit": 0,
                "text": "6 Month 0% Interest Free"
            },
            "firstName": "John",
            "history": [
                {
                    "date": "2016-10-26 04:20",
                    "status": "AWAITING-ACTIVATION",
                    "text": "",
                    "type": "status",
                    "user": "James Weston"
                },
                {
                    "date": "2016-10-26 04:18",
                    "status": "SIGNED",
                    "text": "",
                    "type": "status",
                    "user": ""
                },
                {
                    "date": "2016-10-26 04:18",
                    "status": "ACCEPTED",
                    "text": "",
                    "type": "status",
                    "user": ""
                },
                {
                    "date": "2016-10-26 04:18",
                    "status": "",
                    "text": "Customer entered gateway from 10.11.12.1",
                    "type": "",
                    "user": ""
                }
            ],
            "id": "C92F7C65B-5C2D-6544-BB13-3E54243B9875",
            "identityVerified": false,
            "interestRate": 0,
            "interestType": "simple",
            "lastName": "Doe",
            "lender": "Demo",
            "lenderLoanReference": "XY111111",
            "lenderReference": "x22acc2e-2dc4-2ec2-3a7f-x4c5f02a0c3a",
            "metadata": {
                "Invoice Number": "844001",
                "Order Number": "100019"
            },
            "modifiedDate": "2016-10-26 04:20",
            "monthlyPaymentAmount": 199.58,
            "products": [
                {
                    "_price": "£ 1153",
                    "_sum": "£ 1153",
                    "image": "http://www.webshop.com/images/GIB100.png",
                    "name": "Gibson Les Paul Studio Raw Guitar",
                    "price": "1153.00",
                    "quantity": 1,
                    "sku": "GIB100",
                    "sum": "1153.00",
                    "unit": "pcs"
                },
                {
                    "_price": "£ 89",
                    "_sum": "£ 44.50",
                    "image": "",
                    "name": "Restring Upgrade",
                    "price": "89.00",
                    "quantity": 0.5,
                    "sku": "H10",
                    "sum": "44.50",
                    "unit": "hour"
                }
            ],
            "proposal": "PD56030F0-845C-ECF1-6118-0B26EFDCB273",
            "proposalCreator": null,
            "purchasePrice": 1197.5,
            "reference": "test reference",
            "refundableAmount": 1197.50,
            "refundedAmount": 0,
            "refunds": [],
            "status": "AWAITING-ACTIVATION",
            "totalRepayableAmount": 1197.5,
            "url": "https:\/\/secure.divido.com\/token\/0685cx87225604f0b75f53c6b6afe71x"
        },
        {
        	...
        },
        {
        	...
        },
        {
        	...
        }
    ],
    "status": "ok",
    "totalItems": 4
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

country - 通过国家代码进行筛选 (可选,字符串)

Example `GB`

status - 通过状态进行筛选 (可选,字符串)

Example `SIGNED`

proposal - 通过提案进行筛选 (可选,字符串)

Example `PAA717844-EE9D-78AF-D11C-EDCC1D180F87`

page - 显示页面,默认1 (可选,字符串)

Example `2`

检索一个申请

检索现有申请的详细信息。提供申请ID,API将返回相应的申请。

示例请求

GET https://secure.divido.com/v1/applications?merchant={MERCHANT}&id={id} HTTP/1.1

示例响应

JSON示例

{
    "record": {
    	  "_activatableAmount": "£ 0",
        "_activatedAmount": "£ 1197.50",
        "_cancelableAmount": "£ 0",
        "_cancelledAmount": "£ 0",
        "_creditAmount": "£ 1197.50",
        "_currentCreditAmount": "£ 1197.50",
        "_depositAmount": "£ 0",
        "_monthlyPaymentAmount": "£ 199.58",
        "_purchasePrice": "£ 1197.50",
        "_refundableAmount": "£ 1197.50",
        "_refundedAmount": "£ 0",
        "_totalRepayableAmount": "£ 1197.48",
        "activatableAmount": 740,
        "activatedAmount": 1197.5,
        "activations": [
            {
                "_amount": "£ 1197.50",
                "amount": 1197.5,
                "comment": "",
                "date": "2016-10-26 04:20",
                "deliveryMethod": "delivery",
                "reference": "9482471",
                "trackingNumber": ""
            }
        ],
        "agreementDuration": 6,
        "cancelableAmount": 0,
        "cancellations": [],
        "cancelledAmount": 0,
        "channel": {
            "id": "CDDB70595-BFE6-0B7D-EE5B-B09FFC89F98C",
            "name": "Webshop.com",
            "type": "webshop"
        },
        "country": "GB",
        "createdDate": "2016-10-26 04:18",
        "creditAmount": 1197.5,
        "currentCreditAmount": 1197.5,
        "currency": "GBP",
        "deferralPeriod": 0,
        "depositAmount": 0,
        "depositReference": "",
        "depositStatus": "NO-DEPOSIT",
        "directSign": true,
        "email": "john.doe@domain.com",
        "finance": {
            "id": "F06895E17-EE96-926E-7137-37BCABB9DCF7",
            "maxDeposit": 50,
            "minAmount": 150,
            "minDeposit": 0,
            "text": "6 Month 0% Interest Free"
        },
        "firstName": "John",
        "history": [
            {
                "date": "2016-10-26 04:20",
                "status": "AWAITING-ACTIVATION",
                "text": "",
                "type": "status",
                "user": "James Weston"
            },
            {
                "date": "2016-10-26 04:18",
                "status": "SIGNED",
                "text": "",
                "type": "status",
                "user": ""
            },
            {
                "date": "2016-10-26 04:18",
                "status": "ACCEPTED",
                "text": "",
                "type": "status",
                "user": ""
            },
            {
                "date": "2016-10-26 04:18",
                "status": "",
                "text": "Customer entered gateway from 10.11.12.1",
                "type": "",
                "user": ""
            }
        ],
        "id": "C92F7C65B-5C2D-6544-BB13-3E54243B9875",
        "identityVerified": false,
        "interestRate": 0,
        "interestType": "simple",
        "lastName": "Doe",
        "lender": "Demo",
        "lenderLoanReference": "XY111111",
        "lenderReference": "",
        "metadata": {
            "Invoice Number": "844001",
            "Order Number": "100019"
        },
        "modifiedDate": "2016-10-26 04:20",
        "monthlyPaymentAmount": 199.58,
        "products": [
            {
                "_price": "£ 1153",
                "_sum": "£ 1153",
                "image": "http://www.webshop.com/images/GIB100.png",
                "name": "Gibson Les Paul Studio Raw Guitar",
                "price": "1153.00",
                "quantity": 1,
                "sku": "GIB100",
                "sum": "1153.00",
                "unit": "pcs"
            },
            {
                "_price": "£ 89",
                "_sum": "£ 44.50",
                "image": "",
                "name": "Restring Upgrade",
                "price": "89.00",
                "quantity": 0.5,
                "sku": "H10",
                "sum": "44.50",
                "unit": "hour"
            }
        ],
        "proposal": "PD56030F0-845C-ECF1-6118-0B26EFDCB273",
        "proposalCreator": null,
        "purchasePrice": 1197.5,
        "reference": "test reference",
        "refundableAmount": 1197.50,
        "refundedAmount": 0,
        "refunds": [],
        "status": "AWAITING-ACTIVATION",
        "totalRepayableAmount": 1197.5,
        "url": "https:\/\/secure.divido.com\/token\/0685cx87225604f0b75f53c6b6afe71x"
    },
    "status": "ok"
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

id - 申请id (必需,字符串)

Example `C84047A6D-89B2-FECF-D2B4-168444F5178C`

报告/列出所有付款批次

检索所有付款批次。

示例请求

GET https://secure.divido.com/v1/payments?merchant={MERCHANT}&currency={CURRENCY}&lender={LENDER}&page={PAGE} HTTP/1.1

示例响应

JSON示例

{
    "itemsPerPage": 30,
    "page": 1,
    "records": [
        {
            "currency": "GBP",
            "date": "2016-04-14",
            "id": "PB0506EBA-870B-FFC2-FCAB-250D1B1291BD",
            "lender": {
                "id": "L07F46CDF-5296-D190-1F2D-A1B5FD869B72",
                "name": "Demo"
            },
            "merchant": {
                "id": "M7470B82C-B1EE-158F-D965-CFFD3158992A",
                "name": "Sofa & Table"
            },
            "records": 1,
            "totalCreditAmount": 989,
            "totalNetPayment": 1074.165,
            "totalSubsidyAmount": 4.945
        },
        ...,
        ...
    ],
    "status": "ok",
    "totalItems": 3
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

currency - 按货币代码过滤(可选,字符串

Example `GBP`

lender - 按贷款人ID过滤(可选,字符串

Example `L07F46CDF-5296-D190-1F2D-A1B5FD869B72 `

page - 显示页面,默认1 (可选,字符串)

Example `2`

报告/从付款批次检索记录

检索付款批次的内容。提供批次ID,API将返回所有记录。

示例请求

GET https://secure.divido.com/v1/payments?merchant={MERCHANT}&id={id} HTTP/1.1

示例响应

JSON示例

{
    "record": {
        "currency": "GBP",
        "date": "2016-04-14",
        "id": "PB0506EBA-870B-FFC2-FCAB-250D1B1291BD",
        "lender": {
            "id": "L07F46CDF-5296-D190-1F2D-A1B5FD869B72",
            "name": "Demo"
        },
        "totalCreditAmount": 989,
        "totalNetPayment": 1074.165,
        "totalSubsidyAmount": 4.945,
        "transactions": [
            {
                "application": "CDD6CCE0C-8DC5-6EB4-9A08-45520484EB19",
                "creditAmount": 989,
                "customer": "HESELDEN, ANN",
                "depositAmount": 100,
                "finance": {
                    "id": "F927FA596-6C9C-8376-A99B-70AE9A020F6B",
                    "text": "0% 12 month - Demo Bank"
                },
                "netPaymentAmount": 1074.165,
                "purchasePrice": 1089,
                "reference": "267381",
                "subsidyAmount": 4.945
            }
        ]
    },
    "status": "ok"
}

参数

merchant - 您唯一的账户标识符(必需,字符串

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

id - 批次ID(必需,字符串

Example `PB0506EBA-870B-FFC2-FCAB-250D1B1291BD `