Getting Started
- Accounts
- Charging Sessions
- Charging Stations
- Drivers
- Estimations
- Fleets
- Invoices
- Payment Methods
- Reports
- Reservations
- Transactions
- Vehicles
- Vehicle Telemetries
- Webhook Endpoints
Payment Methods
Create a Payment Method
Creates a new Payment Method object (for example, a credit card). You can later attach this method to a driver or fleet for charging session payments or invoices.
POST
/
payment_methods
Copy
curl --request POST \
--url https://api.chargeapi.co/v1/payment_methods \
--header 'Content-Type: application/json' \
--data '{
"type": "card",
"details": {
"number": "4242424242424242",
"exp_month": 12,
"exp_year": 2027,
"cvc": "123"
},
"billing_details": {
"name": "John Doe",
"address": {
"line1": "123 Elm Street",
"city": "Springfield",
"state": "IL",
"postal_code": "62704",
"country": "US"
}
}
}'
Copy
{
"id": null,
"object": null,
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"created": null,
"details": {
"brand": null,
"last4": null,
"exp_month": null,
"exp_year": null
},
"driver": null,
"fleet": null,
"type": null
}
Body
application/json
Response
200
application/json
Returns the newly created Payment Method object.
Copy
curl --request POST \
--url https://api.chargeapi.co/v1/payment_methods \
--header 'Content-Type: application/json' \
--data '{
"type": "card",
"details": {
"number": "4242424242424242",
"exp_month": 12,
"exp_year": 2027,
"cvc": "123"
},
"billing_details": {
"name": "John Doe",
"address": {
"line1": "123 Elm Street",
"city": "Springfield",
"state": "IL",
"postal_code": "62704",
"country": "US"
}
}
}'
Copy
{
"id": null,
"object": null,
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"created": null,
"details": {
"brand": null,
"last4": null,
"exp_month": null,
"exp_year": null
},
"driver": null,
"fleet": null,
"type": null
}
Assistant
Responses are generated using AI and may contain mistakes.