Payment Endpoints
This guide explains how to work with payment-related endpoints in the Optimize Everything API system.
📚 Full API Documentation: For all endpoints, see https://api.opteverything.com/docs
Prerequisites​
- You have your authentication token
- You have integrated with a payment gateway (e.g., Braintree, Stripe)
Client Token Generation​
Endpoint​
POST /payment/payment/client-tokens
Required Information​
Name | Type | Required | Description | Default |
---|---|---|---|---|
customer_id | string | No | Customer ID for generating client token from payment gateway | — |
Example Request​
curl -X POST "https://api.opteverything.com/payment/payment/client-tokens" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{
"customer_id": "customer123"
}'
Expected Response​
{
"client_token": "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJmYWRlZGNhY2UifQ=="
}
Customer Management​
Create Customer​
Endpoint​
POST /payment/payment/customers
Required Information​
Name | Type | Required | Description | Default |
---|---|---|---|---|
first_name | string | Yes | Customer's first name | — |
last_name | string | Yes | Customer's last name | — |
string | Yes | Customer's email address | — | |
phone | string | No | Customer's phone number | — |
Example Request​
curl -X POST "https://api.opteverything.com/payment/payment/customers" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890"
}'
Expected Response​
{
"customer_id": "customer123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890"
}
Payment Status Values​
- AUTHORIZED: Transaction has been authorized but not settled
- SUBMITTED_FOR_SETTLEMENT: Transaction has been submitted for settlement
- SETTLED: Transaction has been settled
- SETTLEMENT_DECLINED: Settlement was declined
- FAILED: Transaction failed
- VOIDED: Transaction has been voided
- REFUNDED: Transaction has been refunded
Notes​
- All amounts are specified in the currency of the user's account
- Payment method nonces are temporary tokens from your payment gateway
- Customer IDs are unique identifiers from the payment gateway
- Transaction IDs are unique identifiers from the payment gateway
For more details, see the API documentation.