CryptMin API - Place Order

This is a detailed TUTORIAL on how to place an order by using CryptMin API.

This function is used to create a product order for a specified member. You must provide information in all of the mandatory fields marked with an asterisk (*) for the account to function properly.

You must have the memberId created in Step 2: Create Member in order to call this service. Manual reference: CryptMin API - Create Member.

At the moment, this service only allows one kind of product to be ordered in a single order..

  • If you want to order different products, then you need to make this API service call per product.
  • If you want to order multiple quantities of the same product, then you can do so in a single API call by specifying the "qty" parameter.
The order created via this service is held pending on the CryptMin side. Once the payment to CryptMin has been confirmed, the order will be officially marked as being paid and the products purchased will become effective.

Request Fields

  • memberId*: CryptMin member ID returned in "2. Create Member". This is NOT part of the JSON body, but part of the URL endpoint as per above. Mandatory.
  • itemCode*: ItemCode of the CryptMin product purchased. Max 18 characters. Mandatory.
  • qty: Quantity of the CryptMin product purchased. Integer greater than 0. Defaults to 1 if not specified.

Response Fields

  • status: "ok" when the order is successfully created, and "error" if not.
  • errors: Array of error messages. Empty if status is "ok".
  • rowCount: Number of records contained in the data body.
  • timestamp: Unix timestamp of when the response was generated.
  • data: Array of data body. If status is "ok", it would contain;
    • orderNum: Unique order number of the order created.
    • memberId: Member's ID. This should be the same as the {memberId} specified in the request URL.
    • amount: Total amount of the order created.

cURL Request Sample

curl -X POST \
  https://cryptmin.com/api/index.php/v2/member/10017/order \
  -H 'Authorization: Basic dGVzdGJhc2U6dGVzdFByaXZhdGVLZXkxMjM=' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: a964a4c1-448c-d1bc-7a6d-7cd366d47137' \
  -d '{
    "itemCode": "TEST_001",
    "qty": 2

Successful Response Example

    "status": "ok",
    "errors": [],
    "rowCount": 3,
    "timestamp": 1519806508,
    "data": {
        "orderNum": "11480",
        "memberId": "10017",
        "amount": "6.00"