Charge intent creation

This method creates a new charge request for the specified subscription.

SecurityApi-Key
Request
Request Body schema: application/json
subscription_id
required
string <= 255 characters

The subscription id that will be charged.

Example: "13a0f1aa-5e47-4894-aa8b-282dd19593ec"
amount
required
number <float> >= 1

Amount that will be charged. Do not use thousands separator, and a maximum of 4 decimal places. It will assume the currency in which the merchant registered its account in Khipu.

Example: 10000
subject
required
string <= 255 characters

Subject to identify the charge.

Example: "Charge Service XYZ Id 11.222.333-0"
body
required
string <= 5120 characters

Charge description.

Example: "Service XYZ - November 2022 - Amount: $10.000"
error_response_url
required
string <= 1024 characters

URL that will be called if an error occurs in the charge process. A JSON will be sent by POST with the following structure:

  {
    "subscription_id": string,
    "transaction_id": string,
    "error_message": string
  }
Example: "https://my-domain.biz/charge-error-api"
custom
required
string <= 1073741824 characters

This field can be used to send custom information about the charge intent. It can be in text format or base64-encoded document.

Example: "Custom information content."
transaction_id
required
string <= 255 characters

Merchant's unique identifier for this operation. For example, the invoice number.

Example: "INVOICE-23ffcfbe1e4a4d1c9dc631fe70bddaa0"
notify_url
required
string <= 1024 characters

URL that will be called once the charging process finishes and the payment is conciliated. A POST will be sent with parameters that allows fetch the payment details, using the same flow of a normal payment. See the documentation for details.

Example: "https://my-domain.biz/charge-notify-api"
notify_api_version
string <= 255 characters

API version for instant payment notification(same value as used for the payment API).

Example: "1.3"
Responses
200

Successful operation. Returns a JSON object with the charge intent id that can be used to trace the request of a direct debit charge.

400

Bad Request

401

Unauthorized - Invalid or missing credentials

404

Not found - Resource not available

500

Remote service error :(

post/v1/automatic-payment/charge-intent
Request samples
application/json
{
  • "subscription_id": "13a0f1aa-5e47-4894-aa8b-282dd19593ec",
  • "amount": 10000,
  • "subject": "Charge Service XYZ Id 11.222.333-0",
  • "body": "Service XYZ - November 2022 - Amount: $10.000",
  • "custom": "Custom information content.",
  • "transaction_id": "INVOICE-23ffcfbe1e4a4d1c9dc631fe70bddaa0",
  • "notify_api_version": "1.3"
}
Response samples
application/json
{
  • "payment_id": "v67prof2ugg3"
}