Creating a charge

After you connect to the AffiniPay Payment Gateway and collect and secure payment details, you can call the AffiniPay Payment Gateway API to run a charge.

To authenticate, you’ll need the merchant secret key. Using the test-mode secret key and a test account, you can start using the API immediately without actually submitting charges to the payment processing networks. When you’re ready to start processing payments, just switch to your live-mode secret key and a live account.

When you POST to the charges endpoint, you’ll include:

Example request
curl -X POST -H "Content-Type:application/json" --user <secret_key>: https://api.affinipay.com/v1/charges -d '
{
  "amount":"50000",
  "method":"wKgFaj72F3aBPvZneEsBew",
  "account_id":"diON4KOPnesamprmrxA8Iuo"
}

Having problems making a charge? Check out our FAQ.