cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/payments \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": "<string>",
"currency": "<string>",
"destination_id": "<string>",
"cancel_url": "<string>",
"gateway_options": {
"stripe": {
"tax_id_collection_enabled": true
}
},
"idempotency_key": "<string>",
"metadata": {},
"payment_method_id": "<string>",
"process_payment": true,
"save_card_and_make_default": false,
"success_url": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.payments.create_payment(amount="883.46", currency="CFP Franc", destination_id="<id>", destination_type="CUSTOMER", payment_method_type="OFFLINE", process_payment=True, save_card_and_make_default=False)
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.payments.createPayment({
amount: "883.46",
currency: "CFP Franc",
destinationId: "<id>",
destinationType: "CUSTOMER",
paymentMethodType: "OFFLINE",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Payments.CreatePayment(ctx, types.CreatePaymentRequest{
Amount: "883.46",
Currency: "CFP Franc",
DestinationID: "<id>",
DestinationType: types.PaymentDestinationTypeCustomer,
PaymentMethodType: types.PaymentMethodTypeOffline,
})
if err != nil {
log.Fatal(err)
}
if res.PaymentResponse != nil {
// handle response
}
}{
"amount": "<string>",
"attempts": [
{
"attempt_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"error_message": "<string>",
"id": "<string>",
"metadata": {},
"payment_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"destination_id": "<string>",
"destination_type": "INVOICE",
"environment_id": "<string>",
"error_message": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"gateway_metadata": {},
"gateway_payment_id": "<string>",
"gateway_tracking_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"invoice_number": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_method_id": "<string>",
"payment_method_type": "CARD",
"payment_status": "INITIATED",
"payment_url": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"save_card_and_make_default": true,
"succeeded_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"track_attempts": true,
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"voided_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Payments
Create payment
Use when recording a payment against an invoice (e.g. after receiving funds via a gateway or manual entry).
POST
/
payments
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/payments \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": "<string>",
"currency": "<string>",
"destination_id": "<string>",
"cancel_url": "<string>",
"gateway_options": {
"stripe": {
"tax_id_collection_enabled": true
}
},
"idempotency_key": "<string>",
"metadata": {},
"payment_method_id": "<string>",
"process_payment": true,
"save_card_and_make_default": false,
"success_url": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.payments.create_payment(amount="883.46", currency="CFP Franc", destination_id="<id>", destination_type="CUSTOMER", payment_method_type="OFFLINE", process_payment=True, save_card_and_make_default=False)
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.payments.createPayment({
amount: "883.46",
currency: "CFP Franc",
destinationId: "<id>",
destinationType: "CUSTOMER",
paymentMethodType: "OFFLINE",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Payments.CreatePayment(ctx, types.CreatePaymentRequest{
Amount: "883.46",
Currency: "CFP Franc",
DestinationID: "<id>",
DestinationType: types.PaymentDestinationTypeCustomer,
PaymentMethodType: types.PaymentMethodTypeOffline,
})
if err != nil {
log.Fatal(err)
}
if res.PaymentResponse != nil {
// handle response
}
}{
"amount": "<string>",
"attempts": [
{
"attempt_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"error_message": "<string>",
"id": "<string>",
"metadata": {},
"payment_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"destination_id": "<string>",
"destination_type": "INVOICE",
"environment_id": "<string>",
"error_message": "<string>",
"failed_at": "2023-11-07T05:31:56Z",
"gateway_metadata": {},
"gateway_payment_id": "<string>",
"gateway_tracking_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"invoice_number": "<string>",
"metadata": {},
"payment_gateway": "<string>",
"payment_method_id": "<string>",
"payment_method_type": "CARD",
"payment_status": "INITIATED",
"payment_url": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"save_card_and_make_default": true,
"succeeded_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"track_attempts": true,
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"voided_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
Payment configuration
Available options:
INVOICE, CUSTOMER Available options:
CARD, ACH, OFFLINE, CREDITS, PAYMENT_LINK, UPI Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
stripe, razorpay, nomod, moyasar, paddle, whop, chargebee Response
Created payment
Show child attributes
Show child attributes
Available options:
INVOICE, CUSTOMER Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
CARD, ACH, OFFLINE, CREDITS, PAYMENT_LINK, UPI Available options:
INITIATED, PENDING, PROCESSING, SUCCEEDED, OVERPAID, FAILED, REFUNDED, PARTIALLY_REFUNDED, VOIDED 
