API

Docs

Support

Sign in

Alipay / WeChat Pay

QR Scan Pay is a user-friendly way for Alipay and WeChat Pay consumers to pay on the web. It differs from traditional credit card online payment flows in the way that it generates a QR image (PNG) directly for merchants to embed into their checkout web pages. Consumers, upon being presented the payment QR code, use the Alipay and/or WeChat Pay app on their devices to scan the QR code, after which payment authorization is carried out between consumers and Alipay/WeChat Pay. After the payment is successfully completed on the consumer’s device, a merchant-specific payment confirmation screen can be presented inside the Alipay/WeChat Pay app; this is where merchants can present more information about the orders, the company, or even upsells.

QR Code Generation

H5 Payment helps merchants quickly integrate Alipay and WeChat Pay into their H5 websites. When consumers initiate a payment from merchants, Citcon provides an easy HTTP redirect integration for consumers to complete payments with either Alipay or WeChat Pay, followed by an optional confirmation page provided by merchants. Therefore, the user experience is transparent of Citcon.

The following patterns are supported with H5 Payment

1) Alipay in PC Web – consumers shop on a merchant’s website in a computer browser (all modern browsers are supported) and initiate payment. They are prompted to authenticate with Alipay if they haven’t done so on the same browser. After successful authentication, they confirm payment and are redirected back to the merchant’s website.

2) Alipay in Mobile Web – consumers shop on a merchant’s mobile-optimized website in a mobile browser (all modern mobile browsers are supported), and initiate payment.
    a) If Alipay App is installed on the same mobile device, Alipay App is opened, consumers confirm to pay inside Alipay App. Upon successful payment, they are shown the merchant’s payment confirmation inside the App.
    b) If Alipay App is not installed, consumers are prompted to authenticate with Alipay within the same mobile browser if they haven’t done so on the same browser. After successful authentication, they confirm payment and are redirected back to the merchant’s website.

 

3) WeChat Pay Within WeChat App – WeChat Pay must be initiated within the WeChat App. The typical ways are:
    a) Official Account Payment – consumers read an article published by a merchant’s WeChat official account. Merchants embed a link inside the article to bring consumers to their mobile-optimized H5 shopping website, inside WeChat App’s in-app browser. Consumers shop and initiate payment within WeChat App’s in-app browser, after which WeChat prompts them to confirm payment. Once the payment is successful, consumers are brought back to the merchant’s H5 websites. Everything is done inside WeChat App.
    b) Alternatively, merchants can generate a QR code of their mobile-optimized shopping website’s entry URL. Consumers use the “Scan QR Code” feature inside WeChat App to load the website. The rest of the procedures are the same as above.

The parameters are:

authorization

REQUIRED

The merchant-specific token distributed by Citcon at the time of merchant onboarding. Please keep the token secure, as this is used for authenticating merchant API calls. Note this is passed in header.

amount

REQUIRED

The amount the customers are going to pay for. It’s an integer with no decimal places or thousand separators, rounded to cents. For example, if the price for an item is 9.99, the amount passed in should be 999.

currency

REQUIRED

3-character ISO currency code

vendor

REQUIRED

Alipay or WeChat pay

reference

REQUIRED

Merchant’s identifier to locate an order, such as order ID, transaction ID, etc. This is used for merchants to inquire, refund, or internal tracking of order and payment status. Within a merchant, this reference should be unique.

ipn_url

Optional

This URL is invoked when Alipay or WeChat Pay has a successful payment status. It serves the purpose to notify merchants of this successful payment status. This URL should be able to accept HTTP POST with multiple parameters. See the next section for details.

callback_url

Optional

This page will be shown after payment has been successfully completed. It could be a static “Thank you for payment” HTML page, or, could be a dynamic page that shows customized content. The URL here is in the format of “https://xxxx/xxx.” The dynamic page can also be used to track payment successes. For example, upon receiving a call on the URL, you can update your database of payment statuses about case ABCD12345.

allow_duplicates

Optional

Allows for multiple transactions to be created from one reference ID. When called, it will create a new transaction with the same reference ID.


If omitted, the call will reference the previously created transactions from the reference ID.

mweb

Optional

Allows consumer to complete payment by opening payment URL in mobile browser.

The successful API invocation returns a URL similar to https://uat.citconpay.com/payment/qr?q=7e79ae7950fe9549857452917ca0e90d

This URL, loaded in browser, serves as a payment QR code.

Integration with a merchant is a 2-step process.

1. Merchant’s backend calls the above URL, passes in parameters, to get the QR code URL

2. Merchant’s frontend then uses <img/> tag to embed the QR code URL in the web page for customers to scan and pay

Example Request

$ curl https://uat.citconpay.com/payment/pay_qr \
-H "Authorization: Bearer 12341234123412341234123412341234" \
-d amount=2 \
-d currency="USD" \
-d vendor="generic" \
-d reference="84238473247832874238" \
-d ipn_url="https://merchant.com/ipn.php" \
-d callback_url="https://dev.citcon-inc.com" \
-d allow_duplicates="yes" \
-d timeout="300" 

Example Response:

https://uat.citconpay.com/payment/qr?q=D0000001097-460761bdaefd4a4e3d50

H5 Payment

H5 Payment helps merchants quickly integrate Alipay and WeChat Pay into their H5 websites. When consumers initiate a payment from merchants, Citcon provides an easy HTTP redirect integration for consumers to complete payments with either Alipay or WeChat Pay, followed by an optional confirmation page provided by merchants. Therefore, the user experience is transparent of Citcon.

The following patterns are supported with H5 Payment

 

1) Alipay in PC Web – consumers shop on a merchant’s website in a computer browser (all modern browsers are supported), and initiate payment. They are prompted to authenticate with Alipay if they haven’t done so on the same browser. After successful authentication, they confirm payment and are redirected back to the merchant’s website.

2) Alipay in Mobile Web – consumers shop on a merchant’s mobile optimized website in a mobile browser (all modern mobile browsers are supported), and initiate payment.
    a) If Alipay App is installed on the same mobile device, Alipay App is opened, consumers confirm to pay inside Alipay App. Upon successful payment, they are shown the merchant’s payment confirmation inside the App.
    b) If Alipay App is not installed, consumers are prompted to authenticate with Alipay within the same mobile browser if they haven’t done so on the same browser. After successful authentication, they confirm payment and are redirected back to the merchant’s website.

3) WeChat Pay Within WeChat App – WeChat Pay must be initiated within the WeChat App. The typical ways are:
    a) Official Account Payment – consumers read an article published by a merchant’s WeChat official account. Merchants embed a link inside the article to bring consumers to their mobile optimized H5 shopping website, inside WeChat App’s in-app browser. Consumers shop and initiate payment within WeChat App’s in-app browser, after which WeChat prompts them to confirm payment. Once the payment is successful, consumers are brought back to the merchant’s H5 websites. Everything is done inside WeChat App.
    b) Alternatively, merchants can generate a QR code of their mobile optimized shopping website’s entry URL. Consumers use the “Scan QR Code” feature inside WeChat App to load the website. The rest of the procedures are the same as above.

The parameters are:

authorization

REQUIRED

The merchant-specific token distributed by Citcon at the time of merchant onboarding. Please keep the token secure, as this is used for authenticating merchant API calls. Note this is passed in the header.

amount

REQUIRED

The amount the customers are going to pay for. It’s an integer with no decimal places or thousand separators, rounded to cents. For example, if the price for an item is 9.99, the amount passed in should be 999.

currency

REQUIRED

3-character ISO currency code

vendor

REQUIRED

Alipay or WeChat pay

reference

REQUIRED

Merchant’s identifier to locate an order, such as order ID, transaction ID, etc. This is used for merchants to inquire, refund, or internal tracking of order and payment status. Within a merchant, this reference should be unique.

ipn_url

Optional

This URL is invoked when Alipay or WeChat Pay has a successful payment status. It serves the purpose to notify merchants of this successful payment status. This URL should be able to accept HTTP POST with multiple parameters. See the next section for details.

callback_url

Optional

This page will be shown after payment has been successfully completed. It could be a static “Thank you for payment” HTML page, or, could be a dynamic page that shows customized content. The URL here is in the format of “https://xxxx/xxx.” The dynamic page can also be used to track payment successes. For example, upon receiving a call on the URL, you can update your database of payment statuses about case ABCD12345.

allow_duplicates

Optional

Allows for multiple transactions to be created from one reference ID. When called, it will create a new transaction with the same reference ID.


If omitted, the call will reference to the previously created transactions from the reference ID.

mweb

Optional

Allows consumer to complete payment by opening payment URL in mobile browser.

The successful API invocation returns a URL similar to https://proxy.citconpay.com/u_landing?q=7e79ae7950fe9549857452917ca0e90d

Merchants redirect users to the resulted URL above from their websites.

Integration with a merchant is a 2-step process.

1. Merchant’s backend calls the above URL, passes in parameters, to get the payment URL

2. Merchant’s frontend then uses the above URL to redirect users from their websites to pay.

Example Request

$ curl https://uat.citconpay.com/payment/pay \
-H "Authorization: Bearer 12341234123412341234123412341234" \
-d amount=2 \
-d currency="USD" \
-d vendor="generic" \
-d reference="84238473247832874238" \
-d ipn_url="https://merchant.com/ipn.php" \
-d callback_url="https://dev.citcon-inc.com" \
-d allow_duplicates=yes

Example Response:

https://uat.citconpay.com/payment/landing?q=D0000001096-a456e61b3eba4fa988e9

To redirect consumers to this URL in PHP code:

<?php
header( 'Location: https://uat.citconpay.com/payment/landing?q=7e79ae7950fe9549857452917ca0e90d' ) ;
?>

WeChat Mini Program Payment

WeChat Mini Programs are mobile app-like applications built using WeChat’s own markup language and framework. Mini programs are published to and hosted on WeChat servers.

To initiate a WeChat Payment request inside WeChat Mini Programs, in the merchant’s script, an HTTP request is made to Citcon’s API via wx.request, together with an openid that the Mini Program obtained from user login and the other payment-related data. Citcon processes the API request and responds with necessary parameters for Mini Program to invoke WeChat Pay directly. The response is in JSON.

Citcon recommends that merchants invoke this API from the merchant’s backend services, instead of from Mini Programs directly. Because the token and ipn_url are in the API request, initiating the call from Mini Programs adds security risk of exposure of such sensitive information.

The preferred architecture is:

  1. Mini Program uses wx.request() function to invoke merchant’s own backend service, passes in the openid (obtained from wx.login() function), and other payment-related data;

  2. Merchant’s backend calls Citcon’s Mini Program Payment API and passes in the code and other parameters identified below in the specification;

  3. Citcon returns Mini Program required payment parameters, as described below, to the merchant’s backend;

  4. Merchant’s backend relays and returns the same parameters returned by Citcon API to Mini Program;

  5. Mini Program invokes wx.requestPayment() function together with the parameters received from merchant’s backend

The parameters are:

authorization

REQUIRED

The merchant-specific token distributed by Citcon at the time of merchant onboarding. Please keep the token secure, as this is used for authenticating merchant API calls. Note this is passed in the header.

openid

REQUIRED

This is the openid for a WeChat user that mini-programs obtained after a wx.login() call. For more on how to obtain a code and exchange code for openid in mini-programs, please see here.

amount

REQUIRED

The amount the customers are going to pay for. It’s an integer with no decimal places or thousand separators, rounded to cents. For example, if the price for an item is 9.99, the amount passed in should be 999.

currency

REQUIRED

3-character ISO currency code

reference

REQUIRED

Merchant’s identifier to locate an order, such as order ID, transaction ID, etc. This is used for merchants to inquire, refund, or internal tracking of order and payment status. Within a merchant, this reference should be unique.

ipn_url

Optional

This URL is invoked when Alipay or WeChat Pay has a successful payment status. It serves the purpose to notify merchants of this successful payment status. This URL should be able to accept HTTP POST with multiple parameters. See next section for details

mweb

Optional

Allows consumer to complete payment by opening payment URL in mobile browser.

Returns

Returns result of the WeChat Mini Program Payment request.

ARGUMENTS

result

string

Response of the API call, success or fail.

reason

string

If the transaction fails, the reason contains details of the failure; if the result is a success, the reason field is not returned.

data

JSON

If the transaction is successful, the data JSON object is returned. The object contains the following fields.

timeStamp

string

Timestamp. Number of seconds since 1970-01-01 00:00:00, ie., current time.

nonceStr

string

Random string with length less than or equal to 32 characters.

package

string

This is the name-value pair for prepay_id (returned by WeChat). It’s in the format of: prepay_id=xxxx

signType

string

Signing algorithm. Currently only MD5 is supported.

paySign

string

Signature of this payment request.

Example Request

 $ curl https://uat.citconpay.com/payment/pay_wxmini \
	  -H "Authorization: Bearer C59CE8752C8C4A6FB4B610E99CE3D5A8" \
	  -d openid="EE8A90223BCCD" \
	  -d amount=2 \
	  -d currency="USD" \
	  -d reference="jkh25jh1348fd89sg" \
	  -d ipn_url="https://merchant.com/ipn.php" 
      

Example Successful Response:

{
	"result": "success",
	"data": {
		"appId": "wx112121212121",
		"nonceStr": "gpiorxr7oeautjes8gqw5pjco544xofb",
		"package": "prepay_id=wx201704070854364686cc48c30275957447",
		"signType": "MD5",
		"timeStamp": "1491526475",
		"paySign": "8DD4CC7A41D7831CD5CCFAD440754826"
	}
}

Example Failed Response:

{
	"result": "fail",
	"reason": "failed to create payment"
}
Citcon recommends that merchants invoke the above API from the merchant’s backend services, instead of from Mini Programs directly. Because the token and ipn_url are in the API request, initiating the call from Mini Programs adds security risk of exposure of such sensitive information.
 
Example of how Mini Program uses the parameters to request payment:
//app.js
    App({
    payTap: function() {
    wx.login({
    success: function(res) {
    if (res.code) {
    // call merchant backend here, which calls Citcon payment API
    wx.request({
    url: 'https://merchant_backend/generate_mini_program_pay_data',
    data: {
    code: res.code,
    amount: 1
    },
    success: function(merchantRes) {
    if (merchantRes.result == 'success') {
    wx.requestPayment({
    'timeStamp': merchantRes.timestamp,
    'nonceStr': merchantRes.nonceStr,
    'package': merchantRes.package,
    'signType': merchantRes.signType,
    'paySign': merchantRes.paySign,
    'success':function(res){
    // merchant handles success payment scenario, such as wx.navigateTo sucess page
                  },
    'fail':function(res){
    // merchant handles failure payment scenario, such as wx.navigateTo failure page
                  }
    })                            
    } else {
    console.log('Failed to invoke merchant API!' + merchantRes.errMsg);
              }
    }
    })
    } else {
          console.log('Failed to get user login data!' + res.errMsg)
    }
    }
    });
  }
    })

IPN (Instant Payment Notification)

For a merchant to get notified when a payment has been successfully completed for an order, merchants will provide an ipn_url in pay_qr API call. When payment is completed, Citcon sends an HTTP POST to this URL and passes in the following parameters:

a. id (the id that shows up in the QR code URL)
b. amount
c. status
d. currency
e. time
f. reference (Merchant’s internal identifier used to generate QR code)
g. notify_id

Upon receipt of the notification, merchants can mark their internal databases or system of payment status, or communicate with customers accordingly.

The IPN are initiated from Citcon’s servers hosted in AWS. Please make sure that merchants allow HTTP incoming traffic from AWS.

An example of IPN HTTP POST field:
“id”=”0c4486d74a30e87adcbc569156a6084d”
“amount”=”1”
“status”=”success”
“currency”=”USD”
“time”=”2016-11-09 07:49:53”
“reference”=”ABCD123457890”
“notify_id”=”78b6d63503e7a97cb6e8d09c23de5f5n0u”


To verify and authenticate the IPN,
1) Construct a string of all key/value pairs using only keys in the “fields” field, including “fields”, using the format of key1=value1&key2=value2, this list should be sorted alphabetically by keys. Note that neither the keys or values should be URL encoded. For example,
amount=1&card_number=41**********1111&currency=USD&exp_date=1020&fields=id, amount,notify_status,currency,time,reference,notify_id, result_message,card_number,exp_date,transaction_type, recurring_id&id=af37ffeb2f4785a97bba4e0496cc0c80& notify_id=090217A15-6222841B-5363-4FB7-886F-3CE38415ACDD& notify_status=success&recurring_id=af37ffeb2f4785a97bba4e0496cc0c80& reference=7ed9e2623acdd8ffb8c6a90dd605c6cf& result_message=SUCCESS&time=2017-02-09 13:50:42& transaction_type=CCADDRECURRING
2) Append &token=<merchant token> to the end of the string above:
amount=1&card_number=41**********1111& currency=USD& exp_date=1020&fields=id,amount,notify_status, currency,time,reference,notify_id,result_message, card_number,exp_date,transaction_type, recurring_id&id=af37ffeb2f4785a97bba4e0496cc0c80& notify_id=090217A15-6222841B-5363-4FB7-886F-3CE38415ACDD&notify_status=success& recurring_id=af37ffeb2f4785a97bba4e0496cc0c80& reference=7ed9e2623acdd8ffb8c6a90dd605c6cf& result_message=SUCCESS&time=2017-02-09 13:50:42& transaction_type=CCADDRECURRING&token=123456
3) MD5 hash the string above, to compute a signature. This signature should match the sign field posted in IPN.

The sample code to compute a signature here:

  function sign_ipn($reply, $token) {
  ksort($reply);
  $flat_reply = "";
  foreach ($reply as $key=>$value) {
  $flat_reply = $flat_reply."$key=$value&";
  }
  $flat_reply = $flat_reply."token=$token";
  return md5($flat_reply);
  }
  
  $fields = $_POST['fields'];
  $data['fields'] = $fields;
  $tok = strtok($fields, ",");
  while ($tok !== false) {
  $data[$tok] = $_POST[$tok];
    $tok = strtok(",");
  }
  $mysign = sign_ipn($data, '123456');

Upon receipt of the notification, merchants can mark their internal databases or system of payment status, or communicate with customers accordingly asynchronously.

The IPN are initiated from Citcon’s servers hosted in AWS. Please make sure that merchants allow HTTP incoming traffic from AWS.

An example of IPN HTTP POST field:
“id”=”0c4486d74a30e87adcbc569156a6084d”
“amount”=”1”
“notify_status”=”success”
“currency”=”USD”
“time”=”2016-11-09 07:49:53”
“reference”=”ABCD123457890”
“notify_id”=”78b6d63503e7a97cb6e8d09c23de5f5n0u”
“fields”=”id,amount,notify_status,currency,time,reference,notify_id”

Inquire

This API allows merchants to inquire about the status of a particular payment and/or order.

The parameters are:

ARGUMENTS

authorization

REQUIRED

The merchant-specific token distributed by Citcon at the time of merchant onboarding. Please keep the token secure, as this is used for authenticating merchant API calls. Note this is passed in header.

transaction_id

conditional

The transaction ID to inquire.
Required when reference ID is not used.

reference

conditional

The reference ID of a transaction used to inquire.
Required when a transaction ID is unknown.

inquire_method

optional

Set to “real” to return the details of the transaction.

Response Parameters:

VARIABLES

type

Type of transaction. Possible values are charge (payment) and refund (return of money)

amount

Amount of money charged or returned. This is an integer\ without decimal places or thousand separators. For example, 9.99 is returned as 999

currency

3-character ISO country code, for example, USD.

reference

Merchant’s identifier to locate an order, such as order ID, transaction ID, etc. This is used for merchant to inquire, refund, or internal tracking of order and payment status. Within a merchant, this reference should be unique.

time

Time of transaction in the format of yyyy-MM-dd HH:mm:ss

note

Notes when refund was given, only available when notes was passed in during refund API call.

status

Status of this transaction, can be success, null or expired. null implies Non-expired QR Code / No Payment. expired implies Expired QR Code / No Payment received

Example Request

$ curl https://uat.citconpay.com/payment/inquire \
-H "Authorization: Bearer 417356AA994543DC8F4C4776C31246D7" \
-d transaction_id=D0000001079-83c6b94bf5b61afe2e21 \
-d inquire_method=real

Example Request​

$ curl https://uat.citconpay.com/payment/inquire \
-H "Authorization: Bearer 417356AA994543DC8F4C4776C31246D7" \
-d reference=1000002061

Example Response:

{
	"id": "D0000001079-83c6b94bf5b61afe2e21",
	"type": "charge",
	"amount": 1,
	"time": "2016-11-05 06:17:12",
	"reference": "1000002061",
	"status": "success",
	"currency": "USD",
	"note": "null"
}

Status of this transaction, can be success, null or expired. null implies Non-expired QR Code / No Payment. expired implies Expired QR Code / No Payment received

Refund

This API allows our merchants to make full or partial refunds on successfully paid transactions in the same currency as the original transaction. Merchants may make multiple partial refunds on an original transaction. However, the total refund(s) amount cannot exceed the amount of the original transaction. Refunds are available anytime but there are considerations. Same-day refund transactions tend to be more successful because if you sold something for $1000, you then have $1000 of cash in your till. Therefore, if someone comes and asks for a $350 refund, you have enough cash to refund. However, if that same person wants an $1100 refund, that would not work as you’re still missing $100. The point being the funds from the original transaction is still in your Citcon account therefore you have sufficient funds to perform the refund.

Refunds submitted on subsequent days may fail due to insufficient funds in your Citcon account. For example When you start your day, you have zero $ in your till. If a customer comes and asks for a refund, you have no cash to give, therefore a refund cannot happen.

Your Citcon account holds funds from payment method(s) transactions settled next day T1 or subsequent days usually T2-T3. Successfully charged transactions are + and refunds are – from your account. Merchants may apply for an exemption when there are insufficient funds in your Citcon account to refund by submitting a request through support@citcon-inc.com. Merchants may also apply to support@citcon-inc.com to enable refunds within the Citcon Dashboard. Merchants may also submit to support@citcon-inc.com requesting Citcon enable refunds even when their Citcon account balance has insufficient funds.

The parameters are:

ARGUMENTS

authorization

REQUIRED

The merchant-specific token distributed by Citcon at the time of merchant onboarding. Please keep the token secure, as this is used for authenticating merchant API calls. Note this is passed in the header.

transaction_id

or

trans_reference

ONLY ONE IS REQUIRED

The transaction ID to refund.

Merchant’s identifier to locate an order, such as order ID, transaction ID, etc. Pass by QR code generation

amount

or

trans_amount

ONLY ONE IS REQUIRED

The amount the customers are going to refund for. It’s an integer with no decimal places or thousand separators, rounded to cents. For example, if the price for an item is 9.99, the amount passed in should be 999.

currency

or

trans_currency

ONLY ONE IS REQUIRED

3-character ISO currency code

Please use a combination of amount and currency or another combination of trans_amount and trans_currency

reason

Optional

Note or comments for this refund

Example Request

Refund by transaction_id

$ curl https://uat.citconpay.com/payment/refund \
-H "Authorization: Bearer 1234567890abcdef1234567890abcdeq" \
-d amount=1 \
-d currency="USD" \
-d transaction_id="3bfa17281b2e20c5e3303e045" \
-d reason="test"

Example Request

$ curl https://uat.citconpay.com/payment/refund \
-H "Authorization: Bearer 1234567890abcdef1234567890abcdeq" \
-d trans_amount=10 \
-d trans_currency="HKD" \
-d transaction_id="3bfa17281b2e20c5e3303e045" \
-d reason="test"

Example Request

Refund by transaction_reference

$ curl https://uat.citconpay.com/payment/refund \
-H "Authorization: Bearer 1234567890abcdef1234567890abcdeq" \
-d amount=1 \
-d currency="USD" \
-d transaction_reference="20190627182000" \
-d reason="test"

Refund by transaction_reference

{
   "id":"U0000092892-f84960c2a7e3af7",
   "transaction_id":"U0000092891-fe9c93c42d",
   "refunded":true,
   "status":"success"
}


{
   "refunded":flase,
   "status":"Invalid source. Please contact Citcon."
}

Cancel

This API allows merchants to cancel a payment transaction. The valid cancellation window starts 15 minutes after payment is created till it’s settled. If the original payment is pending, it will be canceled. If the original payment goes through successfully, it will be refunded in full amount. In general, merchants use this API to manage inventory and payment lifecycle.

If a payment has already been settled, merchants should use refund API, instead of cancel API, to return payment funds to consumers.

If a payment has already been canceled, merchants will receive an error message which is “Duplicate cancellation“.

If a cancel request is out of cancellation windows, the merchant will receive an error message which is “Not in cancellation window“.

The parameters are:

ARGUMENTS

authorization

REQUIRED

The merchant-specific token distributed by Citcon at the time of merchant onboarding. Please keep the token secure, as this is used for authenticating merchant API calls. Note this is passed in the header.

transaction_id

or

trans_reference

ONLY ONE IS REQUIRED

The transaction ID to cancel.

Merchant’s identifier to locate an order, such as order ID, transaction ID, etc. Pass by QR code generation

amount

REQUIRED

The amount the customers are going to refund for. It’s an integer with no decimal places or thousand separators, rounded to cents. For example, if the price for an item is 9.99, the amount passed in should be 999.

currency

REQUIRED

3-character ISO currency code

reason

Optional

Note or comments for this cancel

Example Request

Cancel by transaction_id​

$ curl https://uat.citconpay.com/payment/cancel \
-H "Authorization: Bearer 1234567890abcdef1234567890abcdeq" \
-d transaction_id="3bfa17281b2e20c5e3303e045" \
-d reason="test"

Example Request

Cancel by transaction_reference

$ curl https://uat.citconpay.com/payment/cancel \
-H "Authorization: Bearer 1234567890abcdef1234567890abcdeq" \
-d transaction_reference="20190627182000" \
-d reason="test"

Example Response

{
   "transaction_id":"U0000092892-f84960c2a7e3af7",
   "transaction_reference":"20190627182000",
   "cancelled":true,
   "status":"Order cancelled"
}


{
   "transaction_id":"U0000092892-f84960c2a7e3af7",
   "transaction_reference":"20190627182000",
   "refunded":flase,
   "status":"Duplicate cancellation"
}