Documentación/Referencia de API

API REFERENCE

Enviar una declaración aduanera

POSThttps://mapi.yabandpay.com/Payments
Live API
API PLAYGROUND · Live API

Enviar una declaración aduanera

POSThttps://mapi.yabandpay.com/Payments
Automatically signed with your credentials

Request parameters14

Required fields first

海关申报提交

trade_idRequiredstringdata.trade_idYabandPay交易ID
customsRequiredstringdata.customs海关名称
mch_customs_noRequiredstringdata.mch_customs_no商户海关备案号
mch_nameRequiredstringdata.mch_name商户海关备案名称
Optional parameters 10
dutyOptionalintegerdata.duty关税,单位(分),不会提交给海关
action_typeOptionalstringdata.action_type报关类型,ADD 新增 MODIFY 修改,默认ADD 新增
sub_order_noComplete groupstringdata.sub_order_no商户子订单号选填(拆单时必传)
currencyComplete groupstringdata.currency报关的币种建议CNY选填(拆单时必传)
order_feeComplete groupintegerdata.order_fee子订单金额(通过QueryOrder获取订单总金额amount_cny),order_fee=transport_fee+product_fee选填(拆单时必传)
transport_feeComplete groupintegerdata.transport_fee子订单物流金额,单位(分)选填(拆单时必传)
product_feeComplete groupintegerdata.product_fee子订单商品价格,单位(分)选填(拆单时必传)
cert_typeOptionalstringdata.cert_type证件类型,请传固定值IDCARD,暂只支持大陆身份证
cert_idOptionalstringdata.cert_id证件号码,用户大陆身份证号,尾号为字母X的身份证号,请大写字母X
nameOptionalstringdata.name用户姓名

Credentials stay on this page. Your secret key is never stored or sent to the documentation server.

Parámetros

ParameterTypeDescripciónObligatorio
data.trade_idstringYabandPay交易ID✓
data.customsstring海关名称✓
data.mch_customs_nostring商户海关备案号✓
data.mch_namestring商户海关备案名称✓
data.dutyinteger关税,单位(分),不会提交给海关—
data.action_typestring报关类型,ADD 新增 MODIFY 修改,默认ADD 新增—
data.sub_order_nostring商户子订单号—
data.currencystring报关的币种建议CNY—
data.order_feeinteger子订单金额(通过QueryOrder获取订单总金额amount_cny),order_fee=transport_fee+product_fee—
data.transport_feeinteger子订单物流金额,单位(分)—
data.product_feeinteger子订单商品价格,单位(分)—
data.cert_typestring证件类型,请传固定值IDCARD,暂只支持大陆身份证—
data.cert_idstring证件号码,用户大陆身份证号,尾号为字母X的身份证号,请大写字母X—
data.namestring用户姓名—

Consejo

Nota:

  1. Cada pedido puede tener un único regestro sin dividir y varios regestros de divesión. Los regestros de divesión con el mesmo sub_order_no (número de subpedido del comercio) se consideran el mesmo regestro.
  1. Para modificar la información de la declaración aduanera, establezca action_type en MODIFY. Solo se pueden modificar el número de regestro del comercio, el nombre regestrado, el código aduanero y el importe, así como la información del documento de identidad del usuario. Para regestros de pedidos divididos, pase sub_order_no para identificar el regestro que se modificará.
  1. Si una transacción se presentó para declaración aduanera, pero el portal electrónico pierde el pedido, utilice la API de reenvío. Al reenviarla, mantenga el mesmo número de referencia de declaración aduanera que en la solicitud original.
  1. Los importes de la API de declaración aduanera se expresan en fenes.
  1. La moneda de la declaración aduanera es CNY (el importe pagado por el usuario en CNY) y se puede obtener mediante Order query.
ParámetroTipoDescripciónObligatorio
userStringUID de la cuenta de cajero o superadminestradorObligatorio
signStringSignatureObligatorio
methodStringv3.CustomDeclareOrderObligatorio
timeLongTimestampObligatorio
  • Parámetros
ParámetroTipoDescripciónObligatorio
trade_idStringID de transacción de YabandPayObligatorio
customsStringNombre de la aduanaObligatorio
mch_customs_noStringNúmero de regestro aduanero del comercioObligatorio
mch_nameStringNombre del comercio regestrado en la aduanaObligatorio
dutyIntImpuesto aduanero en fenes; no se presenta a la aduanaOpcional
action_typeStringAcción de la declaración: ADD para añadir, MODIFY para modificar; el valor predeterminado es ADDOpcional
sub_order_noStringNúmero de subpedido del comercioOpcional (obligatorio para pedidos divididos)
currencyStringMoneda de la declaración; se recomienda CNYOpcional (obligatorio para pedidos divididos)
order_feeIntSub-order amount (obtain the total order amount amount_cny through QueryOrder), order_fee=transport_fee+product_feeOpcional (obligatorio para pedidos divididos)
transport_feeIntSub-order shipping amount in fenOpcional (obligatorio para pedidos divididos)
product_feeIntSub-order product price in fenOpcional (obligatorio para pedidos divididos)
cert_typeStringIdentity document type; pass the fixed value IDCARD. Only mainland China identity cards are currently supported.Opcional
cert_idStringIdentity document number: the user's mainland China identity card number. If the number ends with X, use an uppercase X.Opcional
nameStringUser's nameOpcional

customs field values:

WeChat Pay customs declaration values

CampoDescripción
GUANGZHOU_ZSGuangzhou (General Administration version)
GUANGZHOU_HP_GJGuangzhou Huangpu Inspection and Quarantine
GUANGZHOU_NS_GJGuangzhou Nansha Inspection and Quarantine
HANGZHOU_ZSHangzhou (General Administration version)
NINGBONingbo
ZHENGZHOU_BSZhengzhou (Bonded Logistics Center)
CHONGQINGChongqing
SHANGHAI_ZSShanghai (General Administration version)
SHENZHENShenzhen
ZHENGZHOU_ZH_ZSZhengzhou Comprehensive Bonded Zone (General Administration version)
TIANJINTianjin

TIANJIN (To send an order to Tianjin Customs, configure both the Tianjin Customs regestration information and the Tianjin Inspection and Quarantine regestration information in the merchant management portal. Cuando calling the customs declaration API, send only to Tianjin Customs, using a single API request.)

Alipay customs declaration values

CampoDescripción
ZONGSHUGeneral Administration of Customs of China
ZHENGZHOUZhengzhou
NINGBONingbo
SHANGHAI_CBTShanghai

Ejemplo de firma:

Parámetros ordenados y concatenados en una cadena de consulta con formato de URL

"customs=NINGBO&mch_customs_no=3302462090&mch_name=宁波保税区嘉里大通物流有限公司&method=v3.CustomDeclareOrder&time=1560499094&trade_id=4760a968-4c5d-1e7e-3b88-89641af6e041&user=YOUR_CASHIER_UID"

Firme la cadena A con secret_key

La firma resultante es:

"YOUR_SIGNATURE"

Ejemplo de solicitud:

{
	"user": "YOUR_CASHIER_UID",
	"sign": "YOUR_SIGNATURE",
	"method": "v3.CustomDeclareOrder",
	"time": 1560499094,
	"data": {
		"trade_id": "4760a968-4c5d-1e7e-3b88-89641af6e041",
		"customs": "NINGBO",
        "mch_customs_no": "3302462090",
        "mch_name": "宁波保税区嘉里大通物流有限公司"
	}
}

Customs declaration response example:

{
    "status": true,
    "code": "200",
    "data": {
        "appid": "",
        "return_code":"SUCCESS",
        "result_code":"SUCCESS",
        "mchid": "3302462090",
        "out_trade_no": "4434a6e235e81cde4aee954c0031ad96",
        "state": "SUCCESS",
        "sub_order_id": "e0721a7f957e8e55dfbb5c7bcb4441d6",
        "sub_order_no": "1234567890",
        "transaction_id": "2024061922001467961423939655",
        "verify_department": "OTHERS",
        "verify_department_trade_id": "2024061922001467961423939655",
        "cert_check_result": "SAME", //Identity comparison between the purchaser and payer (UNCHECKED: purchaser identity not uploaded; SAME: uploaded purchaser identity matches payer identity; DIFFERENT: uploaded purchaser identity differs from payer identity)
        "transId": "20240619161756813048",
        "customs_declarations_id": "e0721a7f957e8e55dfbb5c7bcb4441d6"
    },
    "message": ""
}

State estados:

StatusDescripción
UNDECLAREDUndeclared (the declaration has been submitted and is awaiting customs processing; no resubmission is needed)
SUBMITTEDDeclaration submitted (this status is recorded when the order has been sent to customs, the merchant submits a new declaration, and customs provides a modification API)
PROCESSINGDeclaration in progress
SUCCESSDeclaration successful
FAILDeclaration failed
EXCEPTCustoms API error