Fetch Card
Request Url
sandbox:https://api.sandbox.hitpoints.com/v1/pin/fetch
production:https://api.hitpoints.com/v1/pin/fetch
Request Method
POST
Request Parameters
Parameters
Required
Type
Description
out_trade_id
Yes
string(50)
the unique orderId in reseller's system
product_id
Yes
int
HitPoints ProductId,refer to the response from Query Product List API
quantity
Yes
int
the quantity of card in order,The number of single order cannot exceed the maximum number restricted by the product
random_key
Yes
string(16)
randomly set the value with random string
Request Success Response
{
"data": {
"order_id": 25,
"reseller_id": 10003,
"out_trade_id": "201929886C",
"user_account_id": 2,
"category_name": "Happy Card",
"product_name": "10 Yuan",
"currency": "CNY",
"product_id": 2,
"par_value": "10.00",
"reseller_discount": "25.00",
"unit_price": "7.50",
"quantity": 3,
"total_price": "22.50",
"status": "completed",
"create_time": 1568084501,
"order_pins": [
{
"pin_sn": "R000000025W00001",
"pin_key": "M22S0FPT59S1O9DJ",
"order_id": 25,
"product_id": 2,
"category_name": "Happy Card",
"product_name": "10 Yuan",
"currency": "CNY",
"amount": "10.00",
"cost_price": "7.50",
"status": "active",
"create_time": 1568084501,
"expire_time": 1630339200
},
{
"pin_sn": "C000000025A00002",
"pin_key": "3J7D73YREX4P43HH",
"order_id": 25,
"product_id": 2,
"category_name": "Happy Card",
"product_name": "10 Yuan",
"currency": "CNY",
"amount": "10.00",
"cost_price": "7.50",
"status": "active",
"create_time": 1568084501,
"expire_time": 1630339200
},
{
"pin_sn": "X000000025H00003",
"pin_key": "VWE933L5244Y0RDR",
"order_id": 25,
"product_id": 2,
"category_name": "Happy Card",
"product_name": "10 Yuan",
"currency": "CNY",
"amount": "10.00",
"cost_price": "7.50",
"status": "active",
"create_time": 1568084501,
"expire_time": 1630339200
}
]
},
"code": 200,
"message": "ok",
"success": true
}Response Fields Description
Field
Description
code
The response code describe the request is success or not, code = 200 means success
message
The description message to the code
success
Describe the code with bool, when code = 200 , it's true, otherwise it's false
These fields below will response when code=200
Fields
Description
data
response data
order_id
HitPoints Internal fetching card OrderID
reseller_id
Reseller UserID
out_trade_id
The unique fetching card orderID in reseller's system
user_account_id
The balance account ID to pay the fetching card order
category_name
Product category name
product_name
Product name
product_id
Product Id
currency
Product currency
par_value
The face value of the product
reseller_discount
The reseller discount(%),the price to the reseller is: par_value * (1 - discount_rate%)
unit_price
the unit_price = total_price/quantity;the total_price=par_value x reseller_discount x quantity
total_price
The total_price,this amount will be deducted from reseller's balance account
status
pending_pay = total price is not deducted; in_process order is paid and card is in processing; completed = the card has return to reseller, order is completed,refunded = the order wad refunded
created_time
the time to fetching card, Unix Time
These fields below will response when code=200
Fields
Description
order_pins[]
the card list of the order
pin_sn
card serial number
pin_key
card secret
order_id
HitPoints OrderID of the card
product_id
the product ID to create this card
category_name
the product category name
product_name
the product name
currency
the product currency
amount
the product face value
cost_price
the product cost price for reseller
status
product status:active = can be used, inactive = cannot be used, verified = already used, void = is scrapped, expired = is expired
create_time
the product create time
expire_time
the product expire time
Response Headers:
Fields
Description
Sign
The signature from HitPoints server
Date-GMT
The Time String for HitPoints calculate response signature
Notice: if request failed,that the code!=200, or this is no data field in response body,there will be no Sign field in response header
Fail response example:
Last updated
Was this helpful?