[ Web Proxy ]
URL:
Viewing: https://developer.ecrypt.com/docs/charge-customer-wallet [Back]  [Original]

Charge Customer
GuidesAPI Reference
Charge Customer

Charge Customer

Charging a customer requires that the customer has a payment method on file. That payment method must be the default payment method on their account. You can also charge a customers wallet directly.

Functions Overview:
Create Customer
Authorization / Sale / Credit

Continue reading to understand the the commands and responses for each function.

Auth CommandSale CommandCredit Command
curl --location --request POST 'https://api.preferredpayments.com/v1/transactions/authorize' \
--header 'X-API-Key: PRIVATE-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payment":{
		"customer":{
			"id":"00000000-0000-0000-0000-000000000000"
		}
	},
	"amount": {
		"value": 1.00
	}
}'
curl --location --request POST 'https://api.preferredpayments.com/v1/transactions/sale' \
--header 'X-API-Key: PRIVATE-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payment":{
		"customer":{
			"id":"00000000-0000-0000-0000-000000000000"
		}
	},
	"amount": {
		"value": 1.00
	}
}'
curl --location --request POST 'https://api.preferredpayments.com/v1/transactions/credit' \
--header 'X-API-Key: PRIVATE-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payment":{
		"customer":{
			"id":"00000000-0000-0000-0000-000000000000"
		}
	},
	"amount": {
		"value": 1.00
	}
}'
Response
{
    "transaction_id": "1234567890",
    "auth_code": "123456",
    "response_code": "APPROVED",
    "response_text": "TRANSACTION_WAS_APPROVED",
    "avs": {
        "code": "",
        "text": ""
    },
    "cvv": {
        "code": "",
        "text": ""
    },
    "metadata": {
        "credit_card_network": "visa",
        "name_on_card": "Test Tester",
        "credit_card_number": "4***********1111",
        "credit_card_expires": "0123"
    },
    "request_id": "ABCD1234567890"
}

Add customer
Charge Customer Wallet
Copy Page

Web Proxy Viewer  |  New URL  |  Original Page