---
title: "创建支付单"

doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/payment/create-payment-slip'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/payment/create-payment-slip.md'
---
# 创建支付单

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_orders`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /orders/transactions.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_orders`

## Request

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

### Request Body

* `order_payment_list`

  array<object>

  orderPaymentList

  * `payment_details`

    object

    交易额外字段

    * `pay_channel_deal_id`

      string

      外部渠道支付流水号

    * `store_payment_id`

      string

      商家付款方式ID

    * `store_payment_name`

      string

      商家付款方式名称

  * `processed_at`

    string

    支付实际发生时间,,格式：2023-04-12T22:59:52+08:00

  * `status`

    string

    支付状态unpaid（未支付）,paid（支付成功）、paid_failed（支付失败)

  * `amount`

    double

    付款金额

  * `create_at`

    long

    创建时间(时间戳例如：1632638624)

  * `currency`

    string

    币种

  * `gateway`

    string

    付款方式，仅支持线下支付的customPay

  * `order_id`

    string

    订单号

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `transaction_list`

  array<object>

  java.util.Random@7cfadf47

  * `order_id`

    string

    订单号

  * `pay_channel_deal_id`

    string

    外部渠道支付流水号

  * `status`

    string

    支付单状态

  * `amount`

    double

    付款金额

  * `create_at`

    string

    创建时间

  * `id`

    string

    支付单号


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "externalDocs": {
    "description": "接口使用的权限点: `write_orders` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "xAV3BmRs",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。请参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "order_payment_list": {
              "name": "order_payment_list",
              "description": "orderPaymentList",
              "type": "array",
              "items": {
                "name": "order_payment_list",
                "description": "orderPaymentList",
                "type": "object",
                "properties": {
                  "payment_details": {
                    "name": "payment_details",
                    "description": "交易额外字段",
                    "type": "object",
                    "properties": {
                      "pay_channel_deal_id": {
                        "name": "pay_channel_deal_id",
                        "description": "外部渠道支付流水号",
                        "type": "string",
                        "example": "1C40278814835131L"
                      },
                      "store_payment_id": {
                        "name": "store_payment_id",
                        "description": "商家付款方式ID",
                        "type": "string",
                        "example": "146462515"
                      },
                      "store_payment_name": {
                        "name": "store_payment_name",
                        "description": "商家付款方式名称",
                        "type": "string",
                        "example": "付款名称"
                      }
                    },
                    "required": [
                      "store_payment_id",
                      "store_payment_name"
                    ],
                    "example": {
                      "pay_channel_deal_id": "1C40278814835131L",
                      "store_payment_id": "146462515",
                      "store_payment_name": "付款名称"
                    }
                  },
                  "processed_at": {
                    "name": "processed_at",
                    "description": "支付实际发生时间,,格式：2023-04-12T22:59:52+08:00",
                    "type": "string",
                    "example": "2023-04-12T22:59:52+08:00"
                  },
                  "status": {
                    "name": "status",
                    "description": "支付状态unpaid（未支付）,paid（支付成功）、paid_failed（支付失败)",
                    "type": "string",
                    "example": "paid"
                  },
                  "amount": {
                    "name": "amount",
                    "description": "付款金额",
                    "type": "double",
                    "example": 2
                  },
                  "create_at": {
                    "name": "create_at",
                    "description": "创建时间(时间戳例如：1632638624)",
                    "type": "long",
                    "example": 1632638624
                  },
                  "currency": {
                    "name": "currency",
                    "description": "币种",
                    "type": "string",
                    "example": "USD"
                  },
                  "gateway": {
                    "name": "gateway",
                    "description": "付款方式，仅支持线下支付的customPay",
                    "type": "string",
                    "example": "customPay"
                  },
                  "order_id": {
                    "name": "order_id",
                    "description": "订单号",
                    "type": "string",
                    "example": "21059591764404071557334003"
                  }
                },
                "required": [
                  "amount",
                  "currency",
                  "gateway",
                  "order_id",
                  "status"
                ],
                "example": {
                  "gateway": "customPay",
                  "order_id": "21059591764404071557334003",
                  "payment_details": {
                    "store_payment_id": "146462515",
                    "store_payment_name": "付款名称",
                    "pay_channel_deal_id": "1C40278814835131L"
                  },
                  "processed_at": "2023-04-12T22:59:52+08:00",
                  "status": "paid",
                  "amount": 2,
                  "create_at": 1632638624,
                  "currency": "USD"
                }
              },
              "example": [
                {
                  "amount": 2,
                  "create_at": 1632638624,
                  "currency": "USD",
                  "gateway": "customPay",
                  "order_id": "21059591764404071557334003",
                  "payment_details": {
                    "pay_channel_deal_id": "1C40278814835131L",
                    "store_payment_id": "146462515",
                    "store_payment_name": "付款名称"
                  },
                  "processed_at": "2023-04-12T22:59:52+08:00",
                  "status": "paid"
                }
              ]
            }
          },
          "required": [
            "order_payment_list"
          ],
          "example": {
            "order_payment_list": [
              {
                "order_id": "21059591764404071557334003",
                "payment_details": {
                  "store_payment_id": "146462515",
                  "store_payment_name": "付款名称",
                  "pay_channel_deal_id": "1C40278814835131L"
                },
                "processed_at": "2023-04-12T22:59:52+08:00",
                "status": "paid",
                "amount": 2,
                "create_at": 1632638624,
                "currency": "USD",
                "gateway": "customPay"
              }
            ]
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "transaction_list": {
                "name": "transaction_list",
                "description": "java.util.Random@7cfadf47",
                "type": "array",
                "items": {
                  "name": "transaction_list",
                  "description": "java.util.Random@7cfadf47",
                  "type": "object",
                  "properties": {
                    "order_id": {
                      "name": "order_id",
                      "description": "订单号",
                      "type": "string",
                      "example": "21059591764404071557334003"
                    },
                    "pay_channel_deal_id": {
                      "name": "pay_channel_deal_id",
                      "description": "外部渠道支付流水号",
                      "type": "string",
                      "example": "1C40278814835131L"
                    },
                    "status": {
                      "name": "status",
                      "description": "支付单状态",
                      "type": "string",
                      "example": "paid"
                    },
                    "amount": {
                      "name": "amount",
                      "description": "付款金额",
                      "type": "double",
                      "example": 2
                    },
                    "create_at": {
                      "name": "create_at",
                      "description": "创建时间",
                      "type": "string",
                      "example": "1632638624"
                    },
                    "id": {
                      "name": "id",
                      "description": "支付单号",
                      "type": "string",
                      "example": "23059287225140757637516981"
                    }
                  },
                  "example": {
                    "amount": 2,
                    "create_at": "1632638624",
                    "id": "23059287225140757637516981",
                    "order_id": "21059591764404071557334003",
                    "pay_channel_deal_id": "1C40278814835131L",
                    "status": "paid"
                  }
                },
                "example": [
                  {
                    "amount": 2,
                    "create_at": "1632638624",
                    "id": "23059287225140757637516981",
                    "order_id": "21059591764404071557334003",
                    "pay_channel_deal_id": "1C40278814835131L",
                    "status": "paid"
                  }
                ]
              }
            },
            "example": {
              "transaction_list": [
                {
                  "order_id": "21059591764404071557334003",
                  "pay_channel_deal_id": "1C40278814835131L",
                  "status": "paid",
                  "amount": 2,
                  "create_at": "1632638624",
                  "id": "23059287225140757637516981"
                }
              ]
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/orders/transactions.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "创建支付单",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_orders"
  ]
}
```