POST /payment/complete/enterprise/{enterpriseId}

POST /payment/complete/enterprise/{enterpriseId}

Path parameters

application/json

Body

Payment Status

  • cartId string Required

    Globally unique cart id

  • enterpriseOrderId string Required

    THG internal order ID

  • initialRequest string Required

    Initial request url to Alipay/WechatPay, for customs's reference

  • initialResponse string Required

    Initial response url from Alipay/WechatPay, for customs's reference

  • paymentPayId string Required

    WechatPay/Alipay order ID

  • paidAt string Required

    Payment time in ISO_8601 format

  • status string Required

    Status of payment operation

    Values are success or failed.

  • Reason for failure

Responses

  • 200

    Payment status received successfully

    Hide response attributes Show response attributes object
    • code integer(int32)

      HTTP status code

    • message string

      Message

    • data object

      API response data

      Hide data attributes Show data attributes
  • 400

    Invalid message

    Hide response attributes Show response attributes object
    • code integer(int32)

      HTTP status code

    • message string

      Message

    • data object

      API response data

      Hide data attributes Show data attributes
  • 409

    Payment status already updated for this cart

  • 500

    Payment status update failed

    Hide response attributes Show response attributes object
    • code integer(int32)

      HTTP status code

    • message string

      Message

    • data object

      API response data

      Hide data attributes Show data attributes
POST /payment/complete/enterprise/{enterpriseId}
curl \
 -X POST https://nomad.samarkand-global.cn/checkout/payment/complete/enterprise/REC890 \
 -H "x-ca-key: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"cartId":"string","enterpriseOrderId":"string","initialRequest":"https://pay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB/orders/TEM1129354775085478274207817?time=1587033049529\u0026nonce_str=TEM1129354775085478274207817\u0026sign=cf78e7c81bd00717697c2b11577b48e66770504cb97d2a9b9621d1e99d8a9182","initialResponse":"https://pay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB/response=1587033049529\u0026nonce_str=TEM1129354775085478274207817\u0026sign=cf78e7c81bd00717697c2b11577b48e66770504cb97d2a9b9621d1e99d8a9182","paymentPayId":"string","paidAt":"2021-04-26T11:57:18Z","status":"success","failReason":"Invalid payment detail provided"}'
Request example
{
  "cartId": "string",
  "enterpriseOrderId": "string",
  "initialRequest": "https://pay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB/orders/TEM1129354775085478274207817?time=1587033049529&nonce_str=TEM1129354775085478274207817&sign=cf78e7c81bd00717697c2b11577b48e66770504cb97d2a9b9621d1e99d8a9182",
  "initialResponse": "https://pay.co/api/v1.0/wechat_jsapi_gateway/partners/F96FTB/response=1587033049529&nonce_str=TEM1129354775085478274207817&sign=cf78e7c81bd00717697c2b11577b48e66770504cb97d2a9b9621d1e99d8a9182",
  "paymentPayId": "string",
  "paidAt": "2021-04-26T11:57:18Z",
  "status": "success",
  "failReason": "Invalid payment detail provided"
}
Response examples (200)
{
  "code": 42,
  "message": "Status of operation",
  "data": {
    "cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
    "exchangeRate": 9.1
  }
}
Response examples (400)
{
  "code": 42,
  "message": "Status of operation",
  "data": {
    "cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
    "exchangeRate": 9.1
  }
}
Response examples (500)
{
  "code": 42,
  "message": "Status of operation",
  "data": {
    "cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
    "exchangeRate": 9.1
  }
}