Skip to content
StraventaDocs

Initiate a payment attempt

Initiate a payment attempt.

POST
/v1/public/payments/intents/{shortcode}/charge

Initiate a payment attempt.

Path Parameters

shortcode*string

Header Parameters

Idempotency-Key*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/public/payments/intents/string/charge" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "attempt_id": "7a838dca-3ea8-4a7c-8133-ba2c86aeb22d",
  "channel_code": "string",
  "status": "string",
  "render": {
    "qr_string": "string",
    "qr_png_base64": "string",
    "va_number": "string",
    "va_bank_code": "string",
    "va_account_holder": "string",
    "va_expiry_at": "2019-08-24T14:15:22Z",
    "bank_code": "string",
    "account_number": "string",
    "expiration_date": "2019-08-24T14:15:22Z",
    "payment_url": "http://example.com",
    "instructions": [
      "string"
    ]
  },
  "redirect_url": "http://example.com"
}
{
  "error": "validation_failed",
  "message": "amount_idr is required",
  "request_id": "req_018f4d9f"
}
{
  "error": "validation_failed",
  "message": "amount_idr is required",
  "request_id": "req_018f4d9f"
}
{
  "error": "too_many_attempts",
  "message": "too many payment attempts — please complete the captcha challenge",
  "request_id": "req_018f4d9f",
  "require_captcha": true,
  "site_key": "10000000-ffff-ffff-ffff-000000000001"
}
{
  "error": "validation_failed",
  "message": "amount_idr is required",
  "request_id": "req_018f4d9f"
}

Was this page helpful?