Charges

To charge a customer voucher, you create a Charge object. You can retrieve and refund individual charges as well as list all charges. Charges are identified by a unique, random ID.

Charge object

Field
Type
Description

id

string

Unique identifier for the object.

amount

integer

Amount intended to be collected by this charge. A positive integer in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency.

currency

string

Three-letter ISO currency code (ISO-4217). Must be a supported currency.

payer[firstname]

string

The customer’s firstname.

payer[lastname]

string

The customer’s lastname.

payer[email]

string

The customer’s email.

payer[phone]

string

The customer’s phone number.

payer[address_city]

string

The customer’s city.

payer[address_country]

string

The customer’s country (Two-letter ISO code representing the country).

payer[address_line1]

string

The customer’s address line1.

payer[address_line2]

string

The customer’s address line2.

payer[address_state]

string

The customer’s state.

payerer[address_zip]

string

The customer’s zip.

payer[ip]

string

The customer’s ip address.

payer[id]

string

The customer’s id in your website.

voucher

string

Voucher serial

created_at

int

Time at which the object was created. Measured in seconds since the Unix epoch.

status

enum

The status of the charge is either “succeeded”, “pending”, or “failed”.

metadata

hash

A set of key-value pairs that you can attach to a charge object. It can be useful for storing additional information about the charge in a structured format.

livemode

bool

indicator about if the object if for production or test.

{
	"id": "AWT_fCCMh9GTrU2CKeaeXw==",
	"amount": 1000,
	"currency": "USD",
	"payer": {
		"id": "123",
		"firstname": "John",
		"lastname": "Doe",
		"email": "john@example.com",
		"ip": "127.0.0.1",
		"address_city": "Mannheim Neckarstadt",
		"address_country": "DE",
		"address_line1": "Scharnweberstrasse 24",
		"address_line2": "",
		"address_zip": "68167",
		"address_state": "BW",
		"phone": "+4906211 12 72935"
	},
	"source": "01CKZQR849A9MM529MF5HCG8RN",
	"created_at": "1533294682",
	"status": "succeeded",
	"livemode": false
}

Last updated