Skip to main content

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​

NameTypeRequiredDescriptionDefault
customer_idstringNoCustomer 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​

NameTypeRequiredDescriptionDefault
first_namestringYesCustomer's first name—
last_namestringYesCustomer's last name—
emailstringYesCustomer's email address—
phonestringNoCustomer'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.