Skip to content

Merchant Open API

Merchants need to log in to the console to obtain the Merchant Developer Secret before calling this series of APIs.

Introduction

Request Method

  • HOST: https://open.idatariver.com
  • Headers: Authorization: Bear Your_Developer_Secret

Multi-language Support

The platform supports automatic translation of merchant project/product information into multiple languages. To obtain information in a specific language, simply include the X-Idr-Locale field in the Headers.

The translated content will be stored in the nameI18n and descI18n fields.

Currently, the automatic translation includes the name and desc fields of projects/products.

X-Idr-LocaleLanguage
en🇬🇧 English
fa🇮🇷 Persian
zh-cn🇨🇳 Simplified Chinese
ja🇯🇵 Japanese
ru🇷🇺 Russian
zh-hk🇭🇰 Traditional Chinese
de🇩🇪 German
ar🇦🇪 Arabic
es🇪🇸 Spanish
fr🇫🇷 French
ko🇰🇷 Korean
tr🇹🇷 Turkish
uk🇺🇦 Ukrainian
uz🇺🇿 Uzbek
kk🇰🇿 Kazakh
pl🇵🇱 Polish
pt🇵🇹 Portuguese
pa🇮🇳 Punjabi

Request Example

shell
curl https://open.idatariver.com/mapi?key=value \
  -H "Authorization: Bearer $iDataRiver_Merchant_Secret" \
  -H "X-Idr-Locale: en" \
shell
curl https://open.idatariver.com/mapi \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $iDataRiver_Merchant_Secret" \
  -H "X-Idr-Locale: en" \
  -d '{
    "key": "value"
  }'

Response Format

To ensure uniform management and maintenance of the API, responses follow the field format below:

Field NameDescription
code(Required) Return code, an integer representing the business status. Detailed meanings are provided in the table below.
result(Optional) The complete raw result, with its structure and explanations provided by the supplier.
msg(Optional) Reason for request failure.

Return Code Explanation

The meaning and explanation of the code field:

codeDescription
0Request successful
1000Internal error
1001Parameter error
1002Requested resource not found
1003Internal processing busy, please try again later
1004Insufficient permissions

API Documentation

Use Cases

Open APIs are divided into Public APIs and Private APIs with the following differences:

Public APIs are generally triggered by users, such as placing orders, viewing product information on the merchant's homepage, etc., suitable for use in the frontend of independent sites.

Private APIs should only be used by merchants themselves to access or manage core merchant data, suitable for backend processing of merchant data management.

Even Public APIs should not be directly exposed in the frontend to avoid leaking merchant secrets.

Basic Merchant Store Information Public

Returns basic merchant information.

GET /mapi/merchant/basicInfo

Merchant Homepage Information Public

Returns a list of merchant projects along with all product information under each project.

GET /mapi/merchant/info

Get Order Details Public

Retrieve detailed information of an order by order ID.

GET /mapi/order/info

FieldTypeRequiredDescription
idstringYesOrder ID

Create Product Order Public

Place a product order.

POST /mapi/order/add

FieldTypeRequiredDescription
projectIdstringYesProject ID
skuIdstringYesProduct ID
orderInfoobjectYesOrder details, example: {"quantity": 1,"coupon": "","contactInfo": "","affCode":""}, where quantity is the order quantity, coupon is the discount coupon (if none, pass an empty string), contactInfo is the contact information (required), used for retrieving the order, with string length of 5-100, and affCode is the affiliate promotion code (optional).

For the BUYMEABTC project, the skuId field is not required. The orderInfo field format is as follows:

{"amount":5, "private": false, "name": "", "message": ""}

  • amount Sponsorship amount, in USD
  • private Whether to make the sponsorship information public
  • name Nickname, can be empty
  • message Message, can be empty

Pay for Product Order Public

Get the order payment redirection link.

If the order price is 0, the purchase will be successful directly and no payment link will be returned.

POST /mapi/order/pay

FieldTypeRequiredDescription
idstringYesOrder ID
methodstringYesPayment method, from the method value in the mPayments field of the order details interface
redirectUrlstringNoRedirection link after successful payment, should point to the order page and include the complete domain name
callbackUrlstringNoBackend callback notification triggered when the order status changes, the order data will be sent to this link via a POST request (in JSON format), please process it within 5 seconds and return a 200 status code, otherwise it will be considered a callback failure. Current callback failures will not be retried. This URL must use a domain name and cannot be accessed through IP

Query Product Order List Public

Query the order list based on the contact information or order ID left when creating the order.

GET /mapi/order/search

FieldTypeRequiredDescription
querystringYesContact information or order number left when placing the order

Non-Public API

Please note, the following APIs are used to access or modify merchant internal private data and are only used for the merchant's own data management.

Get Merchant Order List Private

Retrieve the merchant's order list in reverse chronological order.

GET /mapi/order/list

FieldTypeRequiredDescription
statusstringNoOrder status, default is empty indicating no status filtering, possible values: DONE (completed), NEW (new order), EXPIRED (expired), REFUND (refunded)
pagestringNoPagination parameter, default is 1, increment by 1 for each page

Get All Projects Private

Returns all projects created by the merchant, including projects that are not yet online.

GET /mapi/project/list

Get Specific Project Private

Retrieve all data contained in a project, including product list, pricing list, and coupon list.

Digital products will return all inventory data.

GET /mapi/project/detail

FieldTypeRequiredDescription
idstringYesProject ID

Create New Project Private

Create a new project.

POST /mapi/project/add

FieldTypeRequiredDescription
namestringYesProject name
typestringYesProject type, currently supports digital products: DIGITAL

Update Project Information Private

Update basic project information.

POST /mapi/project/update

FieldTypeRequiredDescription
idstringYesProject ID, can be obtained from the project list interface
namestringYesProject name, no more than 50 characters
statusstringYesProject status, possible values: ONLINE, OFFLINE
i18nTypestringNoAutomatic translation status, possible values: enable-0, disable-1, default is 0
descstringNoProject description, no more than 500 characters
coverstringNoImage base64 encoding, no more than 2Mb, only supports PNG, JPG, JPEG formats, example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAkACQAAD...

Delete Project (Irreversible) Private

Delete a project.

POST /mapi/project/remove

FieldTypeRequiredDescription
projectstringYesProject ID

Get Single Product/SKU Details Private

Retrieve detailed information of a specific product under a project. Digital products will return data items.

POST /mapi/project/sku/detail

FieldTypeRequiredDescription
idstringYesProduct/SKU ID

Add Project Product/SKU Private

Add a product under a specified project.

POST /mapi/project/sku/add

FieldTypeRequiredDescription
projectIdstringYesProject ID

Update Product/SKU Private

Update product information.

When modifying digital product inventory data, the new data will directly overwrite the original inventory data items.

Therefore, if you need to change the inventory data items of digital products, please take the product offline first to avoid conflicts with ongoing orders.

POST /mapi/project/sku/update

FieldTypeRequiredDescription
idstringYesProduct/SKU ID
namestringNoProduct name, no more than 50 characters
statusstringNoProduct status, possible values: ONLINE, OFFLINE
prioritynumberNoProduct priority, range is 1-100
itemTypestringNoData item type, possible values: reusable-reuse, consumable-consumable
itemsarrayNoDigital product data items, each element corresponds to a card code, example: ["123", "456"], must pass the itemType parameter simultaneously. 🔔 This value will directly overwrite the original card codes, please use cautiously
docLinkstringNoExternal document link
hiddenStockboolNoWhether to hide inventory, values true or false
descstringNoProject description, no more than 500 characters

When updating a product, at least one valid field needs to be updated, otherwise it will return a failure.

Delete Product/SKU Private

Permanently delete a product, cannot be undone.

POST /mapi/project/sku/remove

FieldTypeRequiredDescription
idstringYesProduct/SKU ID

Add Pricing Plan Private

Add a pricing plan.

POST /mapi/project/pricing/add

FieldTypeRequiredDescription
projectIdstringYesProject ID

Update Pricing Plan Private

Update a pricing plan.

POST /mapi/project/pricing/update

FieldTypeRequiredDescription
idstringYesPricing plan ID
statusstringYesProduct status, possible values: ONLINE, OFFLINE
scopestringYesProduct status, possible values: global-global, specific range-specific
scopeItemsarrayNoWhen scope=specific, this array contains the IDs of the products to be affected and cannot be empty
policystringYesPricing strategy, possible values: fixed price-fixed, wholesale price-stage_quantity
pricestringNoFixed price, required when policy=fixed
stagesobjectNoWholesale price settings, required when policy=stage_quantity, example: [{ "threshold": 0, 'price': 10 },{ "threshold": 10, 'price': 8 }] means the unit price is 10 USD for purchases less than 10 units, and 8 USD for purchases of 10 units or more, with a maximum of 5 stages

Delete Pricing Plan Private

Permanently delete a pricing plan, cannot be undone.

Please ensure that there is at least one available pricing plan for the product.

POST /mapi/project/pricing/remove

FieldTypeRequiredDescription
idstringYesPricing plan ID

Add Coupon Private

Add a coupon.

POST /mapi/project/coupon/add

FieldTypeRequiredDescription
projectIdstringYesProject ID

Update Coupon Private

Update coupon rules.

POST /mapi/project/coupon/update

FieldTypeRequiredDescription
idstringYesCoupon ID
statusstringYesProduct status, possible values: ONLINE, OFFLINE
scopestringYesProduct status, possible values: global-global, specific range-specific
scopeItemsarrayNoWhen scope=specific, this array contains the IDs of the products to be affected and cannot be empty
policystringYesPricing strategy, possible values: reduction coupon-reduction, discount coupon-discount, fixed price coupon-fixed
reductionnumberNoReduction amount for reduction coupons, required when policy=reduction
fixednumberNoFixed price amount for fixed price coupons, required when policy=fixed
discountnumberNoDiscount percentage, range 1-100, required when policy=discount
cappednumberNoDiscount cap amount, used to control the maximum discount amount when policy=discount

Delete Coupon Private

Permanently delete a coupon, cannot be undone.

POST /mapi/project/coupon/remove

FieldTypeRequiredDescription
idstringYesCoupon ID

Telegram Bot Bulk Messaging Private

This feature requires merchants to first enable a custom Telegram bot. Merchants can also use the Telegram Bulk Messaging Assistant directly in the store.

Add a Telegram broadcast message to be sent using the merchant's custom Telegram bot.

🔔 This interface does not limit the number of bulk messages, but only one bulk message can be processed at a time. You must wait for the previous bulk message to be processed before sending another.

It is strongly recommended to use this feature wisely. Each bulk message will automatically filter out invalid users.

POST /mapi/rainbow/broadcast/add

FieldTypeRequiredDescription
contentstringYesBulk message content, no more than 4000 characters
testboolYesWhether it is test mode, pass true to send only to the account bound by the merchant (commonly used for testing before official bulk messaging), pass false to send to all users who can receive messages

Get Telegram Bot Bulk Messaging History Private

Retrieve recent Telegram bot bulk messaging history, including total number of users, number of users who declined, number of successful sent, and total execution time.

GET /mapi/rainbow/broadcast/list

Make things simple and timeproof.