Post Ad
HTTP Request
POST /v5/p2p/item/create
Request Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| tokenId | true | string | Token ID. E.g. USDT,ETH,BTC |
| currencyId | true | string | Currency ID. E.g. HKD,USD,EUR |
| side | true | string | Buying or selling the token. 0: buy; 1: sell |
| priceType | true | string | Pricing exchange rate model. 0: fixed rate; 1: floating rate |
| premium | true | string | The premium applied to the floating exchange rate |
| price | true | string | Price |
| minAmount | true | string | Min. transaction amount |
| maxAmount | true | string | Max. transaction amount |
| remark | true | string | Advertisement description (max length: 900) |
| tradingPreferenceSet | true | Object | Trading preferences |
| > hasUnPostAd | false | string | Whether the counterparty must not have posted any advertisements. 0: not required; 1: required |
| > isKyc | false | string | Is it necessary for the counterparty to complete identity authentication? 0: not required; 1: required |
| > isEmail | false | string | Is it necessary for the counterparty to bind an email address? 0: not required; 1: required |
| > isMobile | false | string | Is it necessary for the counterparty to bind a mobile number? 0: not required1: required |
| > hasRegisterTime | false | string | Is the registration time required to be no less than {} days? 0: not required; 1: required |
| > registerTimeThreshold | false | string | Registration time threshold(Unit: Day) |
| > orderFinishNumberDay30 | false | string | Limit on number of completed orders in the last 30 days |
| > completeRateDay30 | false | string | Completion rate in the last 30 days |
| > nationalLimit | false | string | KYC restricted countries. Format: three-letter ISO country code |
| > hasOrderFinishNumberDay30 | false | string | Is it necessary to have no less than {} orders in the last 30 days? 0: not required; 1: required |
| > hasCompleteRateDay30 | false | string | Is it necessary to have a completion rate of no less than {} in the last 30 days? 0: not required; 1: required |
| > hasNationalLimit | false | string | Whether or not KYC restricted countries list enabled; 0: disabled; 1: enabled |
| paymentIds | true | array[string] | Payment method type ID (len<=5). Please use Get User Payment to get id of a payment method added to your account. |
| quantity | true | string | Amount of tokens in an advertisement |
| paymentPeriod | true | string | Payment period (unit: minutes) |
| itemType | true | string | ORIGIN: original P2P advertisement, generally refers to non-bulk advertisement; BULK: bulk advertisement |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| itemId | string | item Id |
| securityRiskToken | string | security risk token |
| riskTokenType | string | risk token type |
| riskVersion | string | risk version |
| needSecurityRisk | boolean | Whether security risk is necessary |
Request Example
- HTTP
- Python
POST /v5/p2p/item/create HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1675866354698
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"tokenId": "USDT",
"currencyId":"EUR",
"side": "0",
"priceType":"0",
"premium":"",
"price":"0.92",
"minAmount":"20",
"maxAmount":"45000",
"paymentIds":["7110"],
"remark":"test",
"tradingPreferenceSet":{
"isKyc": "1",
"hasCompleteRateDay30": "1",
"completeRateDay30": "95",
"hasOrderFinishNumberDay30": "1",
"hasRegisterTime":"0",
"hasUnPostAd":"0",
"isEmail":"0",
"isMobile":"0",
"nationalLimit":"",
"orderFinishNumberDay30":"60",
"registerTimeThreshold": "0",
},
"quantity":"20000",
"paymentPeriod":"15",
"itemType":"ORIGIN"
}
from bybit_p2p import P2P
api = P2P(
testnet=True,
api_key="xxxxxxxxxxxxxxxxxx",
api_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
print(api.post_new_ad(
tokenId="USDT",
currencyId="EUR",
side="0",
priceType="0",
premium="0",
price="0.92",
minAmount="20",
maxAmount="45000",
remark="test",
tradingPreferenceSet={
"hasUnPostAd": "0",
"isKyc": "1",
"isEmail": "0",
"isMobile": "0",
"hasRegisterTime": "0",
"registerTimeThreshold": "0",
"orderFinishNumberDay30": "60",
"completeRateDay30": "95",
"nationalLimit": "",
"hasOrderFinishNumberDay30": "1",
"hasCompleteRateDay30": "1"
},
paymentIds=["7110"],
quantity="20000",
paymentPeriod="15",
itemType="ORIGIN"
))
Response Example
{
"ret_code": 0,
"ret_msg": "SUCCESS",
"result": {
"itemId": "1899659847717838848",
"securityRiskToken": "",
"riskTokenType": "",
"riskVersion": "",
"needSecurityRisk": false
},
"ext_code": "",
"ext_info": {},
"ext_map": {},
"time_now": "1741749176.939208"
}