CreateMonCashPayment

Create mon cash payment

POST https://sandbox.pgecom.com/api/moncash/token

Request Body

NameTypeDescription

gdes*

Number

Amount in gdes that convert in USD to your account

userID*

String

Your userID on PG Rewards so you can receive the funds

referenceId

String

Your internal reference ID for your own tracking

successUrl

String

Where you want us to redirect the user once we have completed the transaction

errorUrl

String

Where you want us to redirect the user once in case any error happens

metadata

String

Pass additional data you need to be retrieve when fetching order

customerFirstName

String

Customer first name

customerLastName

String

Customer last name

customerEmail

String

Customer email

phone

String

MonCash phone number

currency

String

Currency that you want to receive the funds to your account - default usd

{
    "sender": "info@pgecom.com",
    "id": "7a8d8d40-3c38-4de8-a0a0-a7df1617cf12",
    "orderId": "7a8d8d40-3c38-4de8-a0a0-a7df1617cf12",
    "gourdes": 500.886767,
    "amount": 3.37,
    "platform": "pgrewards",
    "successUrl": "http://google.com",
    "receiver": "info@pgecom.com",
    "errorUrl": "",
    "metadata": {},
    "operatorId": "5f56dfa3-a415-4818-8275-44fc63ece3fd",
    "userID": "5f56dfa3-a415-4818-8275-44fc63ece3fd",
    "customerId": "87ee04dd-41e8-42e8-b5b9-16c0e4a04c17",
    "currency": "usd",
    "status": "pending",
    "transactionType": "moncash_deposit",
    "redirectUrl": "http://sandbox.moncashbutton.digicelgroup.com/Moncash-middleware/Payment/Redirect?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjExMDgyNSIsInJlZiI6IjdhOGQ4ZDQwLTNjMzgtNGRlOC1hMGEwLWE3ZGYxNjE3Y2YxMiIsImNydCI6MTcwNDE1MDU0MTQ4MiwiZXh0IjoxNzA0MTUxMTQxNDgyLCJhcGkiOnRydWV9.Yuj9msvDcrlElKzd8yWFw0k28rt8AUNoCMlfKEtFASYqf0haLCspJRQNz7lm6UEy67VXmtgTJFN7PW6jYoOm2BQpT95Ezdn7QIzyNPAFOOt9Zd8Dk2sGJ74HwuOfsTLIYkTvBGaBCH2pMaqL1ZJ2GY-U-SwrzCpiokGbXaoIYIzpH9QAvkYg_XWTh6RIHjN3sPdKBfAYAT6ziFBbt5ivzSnkTbYaf0VjpWU_LDNwxsh7jOsE71zQqcmhheFpbTLydk3Thy_96Cqa4Yx2O55Qhi9rdm7TriIEoby0B0bKC3VsOT4r6vQsNvLJfXjEd8KTs7QADVi3f7fmHFNKpflTmg",
    "payment": {
        "mode": "sandbox",
        "path": "/Api/v1/CreatePayment",
        "payment_token": {
            "expired": "2024-01-01 06:19:01:482",
            "created": "2024-01-01 06:09:01:482",
            "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjExMDgyNSIsInJlZiI6IjdhOGQ4ZDQwLTNjMzgtNGRlOC1hMGEwLWE3ZGYxNjE3Y2YxMiIsImNydCI6MTcwNDE1MDU0MTQ4MiwiZXh0IjoxNzA0MTUxMTQxNDgyLCJhcGkiOnRydWV9.Yuj9msvDcrlElKzd8yWFw0k28rt8AUNoCMlfKEtFASYqf0haLCspJRQNz7lm6UEy67VXmtgTJFN7PW6jYoOm2BQpT95Ezdn7QIzyNPAFOOt9Zd8Dk2sGJ74HwuOfsTLIYkTvBGaBCH2pMaqL1ZJ2GY-U-SwrzCpiokGbXaoIYIzpH9QAvkYg_XWTh6RIHjN3sPdKBfAYAT6ziFBbt5ivzSnkTbYaf0VjpWU_LDNwxsh7jOsE71zQqcmhheFpbTLydk3Thy_96Cqa4Yx2O55Qhi9rdm7TriIEoby0B0bKC3VsOT4r6vQsNvLJfXjEd8KTs7QADVi3f7fmHFNKpflTmg"
        },
        "timestamp": 1704150541499,
        "status": 202,
        "httpStatusCode": 202
    },
    "referenceId": ""
}
const axios = require('axios');
let data = {
    "gdes": 500.88,
    "userID": "5f56dfa3-a415-4818-8275-44fc63ece3fd",
    "successUrl": "http://google.com",
    "description": "",
    "referenceId": "",
    "errorUrl": "",
    "customerFirstName": "",
    "customerLastName": "",
    "customerEmail": "",
    "metadata": {}
}
let config = {
  method: 'post',
  url: 'https://sandbox.pgecom.com/api/v1/moncash/token',
  headers: { },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

If transaction successful or failed, we'll include the following to the errorUrl or successUrl:

  • ${successUrl}?transactionId=${order.id}

  • ${errorUrl}?transactionId=${order.id}&errorMessage=${errorMessage}

Last updated