Create payment
Creates a payment intent in `requires_payment_method` (or equivalent) state. May return **200** or **201** with the same envelope.
Authorization
bearerAuth Use Authorization: Bearer <token>. The same header supports: (1) JWT access token from the configured auth provider; (2) secret API key whose value contains sk_ within the first 32 characters (e.g. sk_live_…, sk_test_…); (3) publishable key containing pk_. Sandbox keys typically include _test_ in the string; the server resolves repositories from that.
In: header
Query Parameters
Account that owns the new payment.
Payment intent: amount in minor units, currency, optional customer and routing-related options.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.hsrcpay.com/v1/payments/" \ -H "Content-Type: application/json" \ -d '{ "auto_capture": true, "secure_mode": "auto", "currency": "USD" }'{
"message": "success",
"success": true,
"data": {
"object": "payment",
"id": "string",
"account_id": "string",
"customer_id": "string",
"amount": 0,
"currency": "USD",
"status": "CREATED",
"metadata": {
"property1": null,
"property2": null
},
"created_at": null,
"updated_at": null,
"checkout_session_id": "string",
"installments": 0,
"routing_origin": "MERCHANT_DIRECT",
"charges": [
{
"object": "charge",
"id": "string",
"payment_id": "string",
"payment_method_id": "string",
"customer_id": "string",
"account_id": "string",
"status": "CREATED",
"amount": 0,
"authorized_amount": 0,
"captured_amount": 0,
"refunded_amount": 0,
"currency": "USD",
"installments": 0,
"security": {
"property1": null,
"property2": null
},
"transaction": {
"property1": null,
"property2": null
},
"exchanges": [
null
],
"details": {
"property1": null,
"property2": null
},
"performance": {
"duration": 0,
"property1": null,
"property2": null
},
"metadata": {
"property1": null,
"property2": null
},
"routing_plan_id": "string",
"routing_origin": "MERCHANT_DIRECT",
"attempt_no": 0,
"payment_provider_id": "string",
"payment_provider_method_id": "string",
"payment_provider_config_snapshot": {
"property1": null,
"property2": null
},
"created_at": null,
"updated_at": null,
"property1": null,
"property2": null
}
],
"customer": {
"object": "customer",
"id": "string",
"account_id": "string",
"name": "string",
"email": "string",
"phone": "string",
"country": "string",
"alternate_emails": [
"user@example.com"
],
"is_guest": true,
"deleted": true,
"metadata": {
"property1": null,
"property2": null
},
"created_at": null,
"updated_at": null,
"addresses": [
{
"object": "customer_address",
"id": "string",
"customer_id": "string",
"type": "BILLING",
"is_default": true,
"label": "string",
"country": "string",
"city": "string",
"state": "string",
"line1": "string",
"line2": "string",
"zip": "string",
"created_at": null,
"updated_at": null,
"property1": null,
"property2": null
}
],
"payment_methods": [
{
"id": "string",
"property1": null,
"property2": null
}
],
"property1": null,
"property2": null
},
"routing_plans": [
{
"object": "routing_plan",
"id": "string",
"account_id": "string",
"payment_id": "string",
"request_id": "string",
"trace_id": "string",
"current_index": 0,
"routing_origin": "MERCHANT_DIRECT",
"candidates": null,
"metadata": null,
"created_at": null,
"updated_at": null,
"property1": null,
"property2": null
}
],
"events": [
{
"object": "event",
"id": "string",
"event": "string",
"account_id": "string",
"workspace_id": "string",
"data": null,
"version": 0,
"request_id": "string",
"trace_id": "string",
"region": "string",
"subject_type": "string",
"subject_id": "string",
"payment_id": "string",
"charge_id": "string",
"refund_id": "string",
"checkout_session_id": "string",
"actor_type": "string",
"actor_id": "string",
"api_key_id": "string",
"service": "string",
"routing_plan_id": "string",
"attempt_id": "string",
"created_at": null,
"property1": null,
"property2": null
}
],
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "success",
"success": true,
"data": {
"object": "payment",
"id": "string",
"account_id": "string",
"customer_id": "string",
"amount": 0,
"currency": "USD",
"status": "CREATED",
"metadata": {
"property1": null,
"property2": null
},
"created_at": null,
"updated_at": null,
"checkout_session_id": "string",
"installments": 0,
"routing_origin": "MERCHANT_DIRECT",
"charges": [
{
"object": "charge",
"id": "string",
"payment_id": "string",
"payment_method_id": "string",
"customer_id": "string",
"account_id": "string",
"status": "CREATED",
"amount": 0,
"authorized_amount": 0,
"captured_amount": 0,
"refunded_amount": 0,
"currency": "USD",
"installments": 0,
"security": {
"property1": null,
"property2": null
},
"transaction": {
"property1": null,
"property2": null
},
"exchanges": [
null
],
"details": {
"property1": null,
"property2": null
},
"performance": {
"duration": 0,
"property1": null,
"property2": null
},
"metadata": {
"property1": null,
"property2": null
},
"routing_plan_id": "string",
"routing_origin": "MERCHANT_DIRECT",
"attempt_no": 0,
"payment_provider_id": "string",
"payment_provider_method_id": "string",
"payment_provider_config_snapshot": {
"property1": null,
"property2": null
},
"created_at": null,
"updated_at": null,
"property1": null,
"property2": null
}
],
"customer": {
"object": "customer",
"id": "string",
"account_id": "string",
"name": "string",
"email": "string",
"phone": "string",
"country": "string",
"alternate_emails": [
"user@example.com"
],
"is_guest": true,
"deleted": true,
"metadata": {
"property1": null,
"property2": null
},
"created_at": null,
"updated_at": null,
"addresses": [
{
"object": "customer_address",
"id": "string",
"customer_id": "string",
"type": "BILLING",
"is_default": true,
"label": "string",
"country": "string",
"city": "string",
"state": "string",
"line1": "string",
"line2": "string",
"zip": "string",
"created_at": null,
"updated_at": null,
"property1": null,
"property2": null
}
],
"payment_methods": [
{
"id": "string",
"property1": null,
"property2": null
}
],
"property1": null,
"property2": null
},
"routing_plans": [
{
"object": "routing_plan",
"id": "string",
"account_id": "string",
"payment_id": "string",
"request_id": "string",
"trace_id": "string",
"current_index": 0,
"routing_origin": "MERCHANT_DIRECT",
"candidates": null,
"metadata": null,
"created_at": null,
"updated_at": null,
"property1": null,
"property2": null
}
],
"events": [
{
"object": "event",
"id": "string",
"event": "string",
"account_id": "string",
"workspace_id": "string",
"data": null,
"version": 0,
"request_id": "string",
"trace_id": "string",
"region": "string",
"subject_type": "string",
"subject_id": "string",
"payment_id": "string",
"charge_id": "string",
"refund_id": "string",
"checkout_session_id": "string",
"actor_type": "string",
"actor_id": "string",
"api_key_id": "string",
"service": "string",
"routing_plan_id": "string",
"attempt_id": "string",
"created_at": null,
"property1": null,
"property2": null
}
],
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"message": "string",
"success": false,
"error": {
"code": 0,
"message": "string",
"details": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}Get payment GET
Returns one payment. `account_id` in query must match the payment’s owner when supplied. Supports the same `include_*` expansions as the list endpoint.
Confirm payment GET
Confirms the payment with the given method and optional routing hints. Response is the updated payment DTO (status, charges, etc.).