# 交易

## sessiontoken

生成凭证，用于前端加载webSDK，此接口在服务端发起，结果为sessionToken，用于前端发起请求的合法凭证，30分钟内有效。

{% content-ref url="/pages/4K3qUXrb3z36yq2C7EkX" %}
[Sessiontoken](/api-explorer/api-reference/jiao-yi/sessiontoken.md)
{% endcontent-ref %}

## Payment methods

创建和维护信用卡支付方式，包含创建、修改、查询、删除、与[客户](#customer)绑定等接口操作。

一般用于先存后付模式，商家可以提前收集客户卡号并创建支付ID，后续[进行扣款](#confirm-charge)时，无需再次收集卡号，直接传入支付ID就可以[进行扣款](#confirm-charge)（非PCI商户只能调用webSDK创建customerPaymentMethodId）。

{% content-ref url="/pages/YPeWejYM7FqUVM3XDSUT" %}
[Payment methods](/api-explorer/api-reference/jiao-yi/payment-methods.md)
{% endcontent-ref %}

## Customer

创建与维护客户信息，包含创建、修改、查询、删除客户信息等接口。

客户可以与[支付方式](#payment-methods)进行绑定，后续可以通过接口[查询此客户绑定的支付方式列表](/api-explorer/api-reference/jiao-yi/payment-methods.md#v2022-03-payment_methods-list-customerid)

{% content-ref url="/pages/vJ4vRCx4fZq6NgiBWyH7" %}
[customer](/api-explorer/api-reference/jiao-yi/customer.md)
{% endcontent-ref %}

## Confirm charge

支付扣款接口，可以自己收集卡号或者先[创建支付方式ID](#payment-methods)后，通过此接口进行扣款，同时也支持订阅支付模式。

注：非PCI商户只能调用webSDK创建customerPaymentMethodId后，再发起扣款请求

{% content-ref url="/pages/1dVRtiCwvP8pwK5i3TCy" %}
[Confirm charge](/api-explorer/api-reference/jiao-yi/confirm-charge.md)
{% endcontent-ref %}

## Check out payment

跳转支付接口，接口返回redirectUrl支付页面，商户需要跳转客户到此地址。

支付页面上会展示网关绑定的所有支付通道，客户可以选择不同的支付方式进行付款。

{% content-ref url="/pages/ssApkmEsxKfSAJ3XnLCG" %}
[Checkout payment](/api-explorer/api-reference/jiao-yi/checkout-payment.md)
{% endcontent-ref %}

## Local payment

本地支付直连接口，接口返回本地支付redirectUrl，商户需要跳转客户到此地址。

该接口根据 paymentMethod 字段直接跳转相应的本地支付页面。

{% content-ref url="/pages/H3xdyhfyI66u15QevepZ" %}
[Local payment](/api-explorer/api-reference/jiao-yi/local-payment.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://asiabill.gitbook.io/api-explorer/api-reference/jiao-yi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
