FinishSettlement

PUT /settlement/{merchant}

Finish a settlement order.

Path parameters

  • merchant string Required

    Merchant name to payment company, e.g. wechat.sh_smk

application/json

Body

  • orderRef string Required

    Merchant system settlemnt order number

  • transactionId string Required

    Payment company transaction number

  • finish boolean | null

    Whether the account distribution is completed. If it is false, the remaining amount of this order will not be unfrozen and returned to the secondary merchants, and the order can be divided again.

    Default value is false.

  • finishDesc string | null

    Description for finishing profit orders

  • receivers array[object] | null

    Receivers of the profit sharing.

    Hide receivers attributes Show receivers attributes
    • type string

      Receiver type of profit sharing. MERCHANT_ID: merchants, PERSONAL_OPENID: personal. PERSONAL_OPENID is not available

      Values are MERCHANT_ID or PERSONAL_OPENID.

    • The receiver account.

    • name string

      The receiver account.

    • amount integer(int32)

      The amount of account allocation, in cent, cannot exceed the payment amount of the original order and the maximum proportion of account allocation

    • Payment method, must be wechatpay or alipay

      Values are wechatpay or alipay.

    • The description of profit sharing.

    • Merchant ID of receiver.

    • result string | null

      Profit sharing order result

      Values are PENDING, SUCCESS, REFUND, or CLOSED.

    • The finish time of profit sharing with the rfc3339 standard format.

    • The failed reason of profit sharing.

      Values are ACCOUNT_ABNORMAL, NO_RELATION, or RECEIVER_HIGH_RISK.

    • detailId string

      Profit sharing detailed order number, which can be used for reconciliation with the fund bill.

  • Payment method, must be wechatpay or alipay

    Values are wechatpay or alipay.

Responses

  • 200

    Finish a settlement order successfully.

    Hide response attributes Show response attributes object
    • code integer(int32)
    • message string | null

      Response message

    • outOrderNo string | null

      The profit sharing number of the merchant

    • transactionId string | null

      Transaction ID of payment company

    • orderId string | null

      Payment system order number, the unique identifier returned by the payment system

    • status string | null

      Profit sharing order status

      Values are PROCESSING or FINISHED.

    • receivers array[object] | null

      Receivers of the profit sharing

      Hide receivers attributes Show receivers attributes
      • type string

        Receiver type of profit sharing. MERCHANT_ID: merchants, PERSONAL_OPENID: personal. PERSONAL_OPENID is not available

        Values are MERCHANT_ID or PERSONAL_OPENID.

      • The receiver account.

      • name string

        The receiver account.

      • amount integer(int32)

        The amount of account allocation, in cent, cannot exceed the payment amount of the original order and the maximum proportion of account allocation

      • Payment method, must be wechatpay or alipay

        Values are wechatpay or alipay.

      • The description of profit sharing.

      • Merchant ID of receiver.

      • result string | null

        Profit sharing order result

        Values are PENDING, SUCCESS, REFUND, or CLOSED.

      • The finish time of profit sharing with the rfc3339 standard format.

      • The failed reason of profit sharing.

        Values are ACCOUNT_ABNORMAL, NO_RELATION, or RECEIVER_HIGH_RISK.

      • detailId string

        Profit sharing detailed order number, which can be used for reconciliation with the fund bill.

    • finishDescription string | null

      Description of the end of the profit sharing

    • finishAmount integer | null

      The amount of the end of the profit sharing, in cent

  • 400

    Request validation failure

    Hide response attributes Show response attributes object
  • 401

    Not Authenticated.

    Hide response attributes Show response attributes object
  • 500

    Something wrong when query the payout.

    Hide response attributes Show response attributes object
PUT /settlement/{merchant}
curl \
 -X PUT https://nomad.samarkand-global.cn/broker/v1/settlement/wechat.sh_smk \
 -H "app-api-key: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"orderRef":"string","transactionId":"transaction_id_123","finish":false,"finishDesc":"分账完结","receivers":[{"type":"MERCHANT_ID","receiverAccount":"1900000109","name":"1900000109","amount":12,"paymentMethod":"wechatpay","description":"分帐1900000110","receiverMchid":"Orange","result":"SUCCESS","finishTime":"2015-05-20T13:29:35.120+08:00","failReason":"NO_RELATION","detailId":"3601111111111111111111"}],"paymentMethod":"wechatpay"}'
Request example
{
  "orderRef": "string",
  "transactionId": "transaction_id_123",
  "finish": false,
  "finishDesc": "分账完结",
  "receivers": [
    {
      "type": "MERCHANT_ID",
      "receiverAccount": "1900000109",
      "name": "1900000109",
      "amount": 12,
      "paymentMethod": "wechatpay",
      "description": "分帐1900000110",
      "receiverMchid": "Orange",
      "result": "SUCCESS",
      "finishTime": "2015-05-20T13:29:35.120+08:00",
      "failReason": "NO_RELATION",
      "detailId": "3601111111111111111111"
    }
  ],
  "paymentMethod": "wechatpay"
}
Response examples (200)
{
  "code": 200,
  "message": "success",
  "outOrderNo": "string",
  "transactionId": "transaction_id_123",
  "orderId": "string",
  "status": "FINISHED",
  "receivers": [
    {
      "type": "MERCHANT_ID",
      "receiverAccount": "1900000109",
      "name": "1900000109",
      "amount": 12,
      "paymentMethod": "wechatpay",
      "description": "分帐1900000110",
      "receiverMchid": "Orange",
      "result": "SUCCESS",
      "finishTime": "2015-05-20T13:29:35.120+08:00",
      "failReason": "NO_RELATION",
      "detailId": "3601111111111111111111"
    }
  ],
  "finishDescription": "string",
  "finishAmount": 88
}
Response examples (400)
{
  "code": 200,
  "message": "success"
}
Response examples (401)
{
  "code": 200,
  "message": "success"
}
Response examples (500)
{
  "code": 200,
  "message": "success",
  "errors": "Something wrong when making the service."
}