# Merchant's Exchange Rate

# Request

# Basic

URL API:

https://a.mypaynz.com/rate/forex_rate
  1. Request method: POST
  2. Parameter method: Form URL-Encoded
  3. Set Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# API Request Limiation

Same IP 60 times per hour.

TIP

  1. The interface exchange rate is for reference only, the actual payment rate is subject to the time of payment.
  2. The interface data is not updated frequently, and developers should cache the data on their own servers.

# Parameter

Parameter Type Nullable Parameter Description
mid int(4) No Merchant ID
sign string(32) No Signature, please refer to signature explaination section

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java
## Query Rate
curl -X "POST" "https://a.mypaynz.com/rate/forex_rate" \
     -H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
     -H 'Cookie: ci_session=msasjhcraj1k6682htouhm5ra2rt7685' \
     --data-urlencode "mid=10224" \
     --data-urlencode "sign=ac05fe25fcc7de8b53d38d0246ac0e0a"

# Response

# Successes

{
  "code": "200",
  "msg": "SUCCESS",
  "data": {
    "currency": "NZD",
    "alipay": {
      "rate": 4.732188
    },
    "wechat": {
      "rate": 4.734636
    }
  },
  "timestamp": 1606712986
}

# Error

Signature Error

{
    'is_success':'FALSE'
    'message': 'SIGN_ERROR'
}

Other Error

{
    'is_success':'FALSE'
    'message': 'COMBINE_ERROR'
}

# Common Exchange Rate API (soon to be deprecate)

# Request

# Basic

URL API:

https://a.mypaynz.com/rate/query_rate
  1. Request method: GET

# API Request Limiation

Same IP 60 times per hour.

TIP

  1. The interface exchange rate is for reference only, the actual payment rate is subject to the time of payment.
  2. The interface data is not updated frequently, and developers should cache the data on their own servers.

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java
## Query Rate
curl "https://a.mypaynz.com/rate/query_rate" \
     -H 'Cookie: ci_session=msasjhcraj1k6682htouhm5ra2rt7685'

# Response

# Successes

{
  "is_success": "TRUE",
  "message": "QUERY RATE",
  "extra": [
    {
      "id": "265662",
      "type": "alipay",
      "currency": "NZD",
      "rate": "4.6394",
      "ct": "2020-11-30 12:00:02"
    },
    {
      "id": "265673",
      "type": "wechat",
      "currency": "NZD",
      "rate": "4.6418",
      "ct": "2020-11-30 12:45:02"
    },
    {
      "id": "265663",
      "type": "alipay_web",
      "currency": "NZD",
      "rate": "4.65943",
      "ct": "2020-11-30 12:00:02"
    }
  ]
}