Skip to main content

B2B Mobility Customer Data 3.0.5

This API allows querying customer account details and card groups. It allows the fetching of account details, card delivery addresses, international and national pricelists and cardtypes.

B2B Mobility 客户数据快速入门

简介

B2B Mobility 客户数据 API 是一种 RESTful 服务,使您能够在 Shell Cards Platform 中查询和管理客户账户详情、卡组和相关配置。该 API 提供灵活的搜索功能,支持分页,并允许您检索账户信息、卡片交付地址、价目表和卡片类型。它还支持创建和更新卡片组以及在组之间移动卡片的操作。

卡组操作

灵活搜索

Benefit Description
Comprehensive Account Management Access detailed customer account information including billing, card summaries, and status
Card Group Operations Create, update、
创建、更新和终止卡组,并提供灵活的卡移动功能
价目表访问 检索国内和国际价目表,并提供特定于客户的折扣
使用多种搜索条件和分页支持查询数据

身份验证

此 API 支持基本身份验证和 OAuth 2.0。0.

Migration Note

该 API 现在支持 OAuth 2.0 身份验证。如果您目前使用的是基本身份验证,我们建议您迁移到 OAuth 2.0 以提高安全性。基础 URL 已更新,所有端点现在都在 /v1 路径下进行了版本控制。有关详细迁移指导,请参阅 OAuth 2.0 迁移支持。

授权流程

  1. 请求客户端 ID 和密文

联系 Shell API 团队以请求访问 OAuth 身份验证。

  1. Request Bearer token

获得凭证后,向 Shell Authentication API 的 OAuth 令牌端点

请求示例:

curl --location --request POST 'https://api-test.shell.com/v2/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=**************' \
--data-urlencode 'client_secret=**************'\
--data-urlencode'grant_type=client_credentials'

您将在响应中收到一个 Bearer 令牌:

{
   "access_token""**************",
   "expires_in""899",
   "token_type""不记名"
Authorize API 请求调用 Shell API 时,请在请求头中包含以下内容:Authorization:Bearer access_tokenBase URL



Environment
URL




Test
https://api-test.shell.com/test


Production
https://api.shell.com



Core Integration
1.获取登录用户详细信息
描述:此端点可检索登录用户的用户数据,包括可访问的付款人、账户和角色。
路径: POST /user-management/v1/loggedinuser
Sample Request
curl --location 'https://api-test.shell.com/test/user-management/v1/loggedinuser' (或
--header 'RequestId:2b0cbe11-f109-4c43-9201-49af0370df1c' \
--header 'Authorization:Bearer YOUR_ACCESS_TOKEN'\
--header 'Content-Type: application/json' (内容类型:应用程序/json
--data '{
  "过滤器{
    "IncludePayerGroup": false、
    "IncludeEIDDetails": false、
    "RequestedAPIName":"v1/Card/OrderCard
  }
}'请求参数



 参数
类型
必需
描述




RequestId
string
是
必需用于请求跟踪的 UUID (RFC 4122)


IncludePayerGroup
boolean
No
Include payer group information when true(默认:


IncludeEIDDetails
boolean
No
Include Electronic Invoice Data when true (default: false)



Sample Response
{
  "RequestId""2b0cbe11-f109-4c43-9201-49af0370df1c",
  状态"SUCCESS""数据":[
    {
      "用户名""John123""显示名""John A.""HasAPIAccess": true"付款人": [[
        {
          "IsDefault": true"ColcoId"1,
          "ColcoCode"86,
          "PayerId": true1234,
          "付款人编号""GB000000123""付款人名称""MATTHEW ALGIE & COMPANY LIMITED"
        }
      ]
    }
  ]
}Response 字段



Field
Type
Description




UserName
string
Logged in user identifier


DisplayName
string
Name of the login in user


HasAPIAccess
boolean用户名

HasAPIAccess
布尔值
如果用户有访问请求的 API 的权限,则为 true


PayerId
 整数
PayerId,供后续请求使用


PayerNumber
string
Payer Number,供后续请求使用



2.查询客户账户
描述:该端点允许通过灵活的搜索条件和分页支持从 Shell Cards 平台查询客户账户详细信息。使用从上一步获得的 PayerId。
路径: POST /customer-management/v1/accounts
Sample Request
curl --location 'https://api-test.shell.com/test/customer-management/v1/accounts' \\
--header 'RequestId:2b0cbe11-f109-4c43-9201-49af0370df1c' \
--header 'Authorization:Bearer YOUR_ACCESS_TOKEN'\
--header 'Content-Type: application/json' (内容类型:应用程序/json
--data '{
  "过滤器{
    "ColCoCode":86,
    "PayerNumber":"GB000000123"、
    "状态":"ACTIVE"、
    "IncludeCardSummary": true
  },
  "页面":1,
  "页面大小":50
}'请求参数



 参数
类型
必需
描述




ColCoCode
整数
是
收集公司代码 (Shell Code)


PayerNumber
string
Yes
Payer Number of the customer


Status
string
No
Account status filter (ACTIVE、冻结、取消等。)


包括卡片摘要
布尔
否
包括卡片摘要详细信息(默认值:true)


页码
整数
否
页码(默认值:1)


页面大小
整数
否
每页记录数(默认:50)



响应示例
{
  "RequestId""2b0cbe11-f109-4c43-9201-49af0370df1c",
  状态"SUCCESS""数据":[
    {
      "AccountId"1,
      "AccountNumber""GB000000124""账户全称""Acme Corporation""状态""Active""CurrencyCode""EUR""TotalCards"1000,
      TotalActiveCards": "EUR", "TotalCards": "1000, "TotalActiveCards"500
    }
  ],
  "页面"1,
  "总记录数"100,
  "总页数"22,
  "页面大小50
}Response 字段



Field
Type
Description




AccountId
integer
Account标识符


帐户号码
字符串
帐户号码


帐户全称
字符串
帐户全称账户全名


状态
字符串
当前账户状态


货币代码
字符串
ISO 货币代码


总卡数
整数
账户总卡数


TotalActiveCards
整数
活动卡数



3.查询卡片组
描述:该端点使用灵活的搜索条件和分页方式从 Shell Cards 平台检索卡片组的详细信息。卡组有助于在一个账户中组织卡片。
路径: POST /customer-management/v1/cardgroups
Sample Request
curl --location 'https://api-test.shell.com/test/customer-management/v1/cardgroups' \\
--header 'RequestId:2b0cbe11-f109-4c43-9201-49af0370df1c' \
--header 'Authorization:Bearer YOUR_ACCESS_TOKEN'\
--header 'Content-Type: application/json' (内容类型:应用程序/json
--data '{
  "过滤器{
    "ColCoCode"86,
    "PayerNumber""GB000000123""状态""激活"
  },
  "页码"1,
  "PageSize"50
}'请求参数



 参数
类型
必需
描述




ColCoCode
整数
是
收集公司代码


付款人编号
字符串
是
客户的付款人编号


状态
字符串
是
卡组状态(激活、TERMINATED, ALL)


CardGroupName
string
No
根据卡组名称过滤(最少 2 个字符)



响应示例
{
  "RequestId":"2b0cbe11-f109-4c43-9201-49af0370df1c",
  状态"SUCCESS"、
  "数据":[
    {
      "CardGroupId":40000,
      "CardGroupName":"006240 fire bright solutions"、
      "状态":"ACTIVE"、
      "PrintOnCard": true、
      "CardTypeId":1234,
      "TotalCards": true1234,
      "活动卡":999
    }
  ],
  "页":1,
  "总记录数":100,
  "总页数": 22,
  "页面大小50
}Response 字段



Field
Type
Description




CardGroupId
integer
Card group 标识符


CardGroupName
string
卡片组名称


Status
Status


状态
字符串
卡组的状态


总卡数
整数
组中卡的总数


活动卡数
整数
组中活动卡的数量



4.创建卡组
描述:此端点在 Shell Cards Platform 中创建一个新的卡组,并可选择将最多 500 张卡移动到新创建的组中。移动卡片请求将在验证后排队。
路径: POST /customer-management/v1/createcardgroup
Sample Request
curl --location 'https://api-test.shell.com/test/customer-management/v1/createcardgroup' \\
--header 'RequestId:2b0cbe11-f109-4c43-9201-49af0370df1c' \
--header 'Authorization:Bearer YOUR_ACCESS_TOKEN'\
--header 'Content-Type: application/json' (内容类型:应用程序/json
--data '{
  "ColCoCode":86,
  "PayerNumber":"GB000000123"、
  "AccountNumber":"GB000000124"、
  "CardGroupName":"006240 fire bright solutions"、
  "PrintOnCard": true、
  "卡片": [[
    {
      "AccountNumber":"GB99215176"、
      "PAN":"7002051006629890645"
    }
  ]
}'Request 参数



 参数
类型
必需
描述




ColCoCode
整数
是
收款公司代码


付款人编号
字符串
是
客户的付款人编号


帐户编号
字符串
是
帐户


卡组名称
字符串
是
新卡组名称(1-40 个字符)


PrintOnCard
boolean
Yes
是否在卡片上压印卡片组名称


Cards
array
No
要移动的卡片列表(最多 500 张)



示例响应
{
  "RequestId""2b0cbe11-f109-4c43-9201-49af0370df1c",
  状态"SUCCESS"、
  数据[
    {
      "MainReference"1234,
      "NewCardGroupReference"5672,
      "SuccessfulRequests":[
        {
          "PAN""7002051123456789145",
          "参考"12345
        }
      ],
      "错误卡":[]
    }
  ]
}Response 字段



Field
Type
Description




MainReference
integer
Reference用于跟踪整个请求的参考编号


NewCardGroupReference
整数
用于创建卡组的参考编号


SuccessfulRequests
数组
已成功排队的卡移动请求列表


ErrorCards
数组
验证失败的卡列表



错误处理
API 使用标准 HTTP 状态代码。如果出现错误,将在响应正文中提供更多详细信息。



错误代码
描述
解决方法




E0001
验证错误
检查请求参数是否有缺失或无效值


E0003
未授权
验证凭证并确保用户有访问操作的权限


E0005
未找到资源
确认所请求的资源存在并可访问


9015
重复的卡组名称
为客户使用唯一的卡组名称




关于我们

壳牌开发者门户致力于协助合作伙伴接入壳牌API,并将创意转化为可投入生产的解决方案。

壳牌徽标

联系方式

登录您的账户

向 AI 助手咨询有关 Shell API 和 API 产品的问题