Charge Intent

A Charge Intent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one Charge Intent for each order or customer session in your system. You can reference the Charge Intent later to see the history of payment attempts for a particular session.

A Charge Intent transitions through multiple statuses throughout its lifetime as it interfaces with Frame.js to perform authentication flows and ultimately creates at most one successful charge.

The Charge Intent object

Attributes
idstring

Unique identifier for the object.

currencystring

Three-letter ISO currency code, in lowercase. Must be a supported currency.

statusenum

Status of this Charge Intent, one of incomplete, pending, canceled, refunded, reversed, failed, disputed, or succeeded.

descriptionnullable string

An arbitrary string attached to the object. Often useful for displaying to users.

amountpositive integer

Amount intended to be collected by this Charge Intent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00, a zero-decimal currency).

client_secretnullable string

The client secret of this Charge Intent. Used for client-side retrieval using a publishable key.

Use the client_secret to complete payments from your frontend with Frame.js. Never store, log, or expose this value to anyone other than the customer. Always use HTTPS on pages that include the client secret.

See our docs to accept a payment for proper client_secret handling.

livemodeboolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

latest_chargenullable dictionary

The latest charge attempt of this Charge Intent.

customernullable string

ID of the Customer this Charge Intent belongs to, if one exists.

payment_methodnullable string

ID of the payment method used in this Charge Intent.

metadatadictionary

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

shippingnullable dictionary

Shipping information for this Charge Intent.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

objectstring

String representing the object's type. Objects of the same type share the same value.

createdtimestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

updatedtimestamp

Time at which the object was last updated. Measured in seconds since the Unix epoch.

THE CHARGE INTENT OBJECT
{
  "id": "a70cd72f-e74a-40f2-96a2-3f60714aac4a",
  "currency": "usd",
  "latest_charge": null,
  "customer": {
    "id": "235978d1-9081-45ce-a57d-e0a9659e8880",
    "created": 1721007463,
    "shipping_address": null,
    "updated": 1721007463,
    "livemode": false,
    "name": "Amb. Gilberto Nitzsche",
    "phone": "+13159403449",
    "email": "gilberto+amb.+nitzsche@gmail.com",
    "description": null,
    "object": "customer",
    "metadata": [],
    "billing_address": null
  },
  "payment_method": {
    "id": "6c99a959-da90-4f18-a93f-9fd7a8080c17",
    "customer": null,
    "billing": null,
    "type": "card",
    "object": "payment_method",
    "created": 1721009419,
    "updated": 1721009419,
    "livemode": false,
    "card": {
      "brand": "visa",
      "exp_month": "12",
      "exp_year": "29",
      "issuer": null,
      "currency": null,
      "segment": null,
      "type": null,
      "last_four": "4242"
    }
  },
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_a70cd72f-e74a-40f2-96a2-3f60714aac4a_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "incomplete",
  "description": "Payment",
  "authorization_mode": "automatic",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 2000,
  "created": 1721010605,
  "livemode": false
}

Create a Charge Intent

Creates a Charge Intent object.

After the Charge Intent is created, attach a payment method and confirm to continue the payment. When you use confirm=true during creation, it's equivalent to creating and confirming the Charge Intent in the same call. You can use any parameters available in the confirm API when you supply confirm=true.

Parameters
amountREQUIREDpositive integer

Amount intended to be collected by this Charge Intent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00, a zero-decimal currency).

currencyREQUIREDstring

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customerstring

ID of the Customer this Charge Intent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this Charge Intent.

descriptionstring

An arbitrary string attached to the object. Often useful for displaying to users.

payment_methodstring

ID of the payment method (a PaymentMethod, Card, or compatible Source object) to attach to this Charge Intent.

confirmboolean

Set to true to attempt to confirm this Charge Intent immediately. This parameter defaults to false. When creating and confirming a Charge Intent at the same time, you can also provide the parameters available in the Confirm API.

receipt_emailstring

Email address to send the receipt to. If you specify receipt_email for a payment in live mode, you send a receipt regardless of your email settings.

metadatadictionary

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

authorization_modeenum

Controls when the funds will be captured from the customer's account.

automaticstring

Default value. Frame automatically captures funds when the customer authorizes the payment.

manualstring

Place a hold on the funds when the customer authorizes the payment, but don't capture the funds until later.

customer_datadictionary

If provided, this hash will be used to create a Customer. The new Customer will appear in the customer property on the Charge Intent.

nameREQUIREDstring

The customer's full name or business name.

emailREQUIREDstring

The customer's email address.

payment_method_datadictionary

If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the payment_method property on the Charge Intent.

attachboolean

Indicates that you intend to make future payments with this Charge Intent's payment method. If you provide a Customer with the Charge Intent, you can use this parameter to attach the payment method to the Customer.

typeREQUIREDenum

The type of the PaymentMethod. We only accept card at the moment.

card_numberREQUIREDstring

The card number, as a string without any separators.

exp_monthREQUIREDstring

Two-digit number representing the card's expiration month.

exp_yearREQUIREDstring

The last two-digit number representing the card's expiration year.

cvcREQUIREDstring

The card's CVC. It is highly recommended to always include this value.

billingdictionary

Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

citynullable string

City, district, suburb, town, or village.

countrynullable string

Two-letter country code (ISO 3166-1 alpha-2).

statenullable string

State, county, province, or region.

postal_codenullable string

ZIP or postal code.

line_1nullable string

Address line 1 (e.g., street, PO Box, or company name).

line_2nullable string

Address line 2 (e.g., apartment, suite, unit, or building).

payment_method_optionsdictionary

Use this to provide configurations that are specific to the payment method being used in this Charge Intent.

carddictionary

Contains all configuration settings for any credit or debit card transactions processed for this Charge Intent.

three_d_securedictionary

If 3D Secure verification was handled by a third-party provider, this object holds the necessary authentication data for the transaction.

cryptogramREQUIREDstring

The authentication value (also known as AAV, CAVV, or AEVV). This is a 20-byte value, base64-encoded into a 28-character string.

transaction_idREQUIREDstring

A unique ID for the authentication transaction. For the legacy 3D Secure 1 protocol, this is the XID. For 3D Secure 2, it's the Directory Server Transaction ID (dsTransID).

versionREQUIREDstring

Specifies which version of the 3D Secure standard (e.g., "2.1.0", "1.0.2") was used to authenticate the transaction.

ares_trans_statusenum

The status code from the Authentication Response (ARes) message. This is returned by the card issuer's server and indicates the result of the authentication. Valid values are Y, N, U, A, C, D, R, or I.

electronic_commerce_indicatorREQUIREDenum

The ECI value, which is provided by the 3D Secure service. This indicator signals the level of security that was successfully applied to the e-commerce transaction. Valid values are 00, 01, 02, 04, 05, 06, or 07.

Returns

Returns a Charge Intent object.

POST/v1/charge_intents
curl --request POST \
  --url https://api.framepayments.com/v1/charge_intents \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": 2000,
  "currency": "usd",
  "customer": "235978d1-9081-45ce-a57d-e0a9659e8880",
  "description": "Payment",
  "payment_method": "6c99a959-da90-4f18-a93f-9fd7a8080c17",
  "confirm": false
}'
RESPONSE
{
  "id": "a70cd72f-e74a-40f2-96a2-3f60714aac4a",
  "currency": "usd",
  "latest_charge": null,
  "customer": {...},
  "payment_method": {...},
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_a70cd72f-e74a-40f2-96a2-3f60714aac4a_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "incomplete",
  "description": "Payment",
  "authorization_mode": "automatic",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 2000,
  "created": 1721010605,
  "livemode": false
}

Update a Charge Intent

Updates properties on a Charge Intent object without confirming.

Depending on which properties you update, you might need to confirm the Charge Intent again. For example, updating the payment_method always requires you to confirm the Charge Intent again. If you prefer to update and confirm at the same time, we recommend updating properties through the confirm API instead.

Parameters
amountinteger

Amount intended to be collected by this Charge Intent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00, a zero-decimal currency).

customerstring

ID of the Customer this Charge Intent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this Charge Intent.

descriptionstring

An arbitrary string attached to the object. Often useful for displaying to users.

payment_methodstring

ID of the payment method (a PaymentMethod, Card, or compatible Source object) to attach to this Charge Intent.

metadatadictionary

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

Returns

Returns a Charge Intent object.

PATCH/v1/charge_intents/:id
curl --request PATCH \
  --url https://api.framepayments.com/v1/charge_intents/d8b77e7c-bee5-415a-bdcb-7a79a18d6994 \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "customer": "47a10b46-151b-4cc6-99d7-4994ef2081f1"
}'
RESPONSE
{
  "id": "d8b77e7c-bee5-415a-bdcb-7a79a18d6994",
  "currency": "usd",
  "livemode": false,
  "subscription": null,
  "latest_charge": null,
  "customer": {
    "id": "47a10b46-151b-4cc6-99d7-4994ef2081f1",
    ...,
  },
  "payment_method": null,
  "shipping": {...},
  "metadata": {},
  "client_secret": "ci_d8b77e7c-bee5-415a-bdcb-7a79a18d6994_secret_pHhZ8hpzePvJCd3ojF1YsGC5McNqs38RPEj",
  "status": "requires_payment_method",
  "description": "ok",
  "authorization_mode": "automatic",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 1000,
  "created": 1739886881
}

Retrieve a Charge Intent

Retrieves the details of a Charge Intent that has previously been created.

Parameters

No parameters.

Returns

Returns a Charge Intent if a valid identifier was provided.

GET/v1/charge_intents/:id
curl --request GET \
  --url https://api.framepayments.com/v1/charge_intents/a70cd72f-e74a-40f2-96a2-3f60714aac4a \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "a70cd72f-e74a-40f2-96a2-3f60714aac4a",
  "currency": "usd",
  "latest_charge": null,
  "customer": {...},
  "payment_method": {...},
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_a70cd72f-e74a-40f2-96a2-3f60714aac4a_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "incomplete",
  "description": "Payment",
  "authorization_mode": "automatic",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 2000,
  "created": 1721010605,
  "livemode": false
}

List all ChargeIntents

Returns a list of ChargeIntents.

Parameters
per_pageinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

pageinteger

The page offset at which you'd like to resume fetching data.

Returns

A dictionary with a data property that contains an array of up to limit ChargeIntents. Each entry in the array is a separate Charge Intent object. If no more ChargeIntents are available, the resulting array will be empty.

GET/v1/charge_intents
curl --request GET \
  --url https://api.framepayments.com/v1/charge_intents \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "meta": {
    "page": 1,
    "url": "/v1/charge_intents",
    "has_more": false,
    "prev": null,
    "next": null
  },
  "data": [
    {
      "id": "a70cd72f-e74a-40f2-96a2-3f60714aac4a",
      "currency": "usd",
      "latest_charge": null,
      "customer": {...},
      "payment_method": {...},
      "shipping": null,
      "metadata": {},
      "client_secret": "ci_a70cd72f-e74a-40f2-96a2-3f60714aac4a_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
      "status": "incomplete",
      "description": "Payment",
      "authorization_mode": "automatic",
      "failure_description": null,
      "object": "charge_intent",
      "amount": 2000,
      "created": 1721010605,
      "livemode": false
    },
    {...},
    {...}
  ]
}

Cancel a Charge Intent

You can cancel a Charge Intent object when it's in one of these statuses: pending, incomplete or requires_capture.

After it's canceled, no additional charges are made by the Charge Intent and any operations on the Charge Intent fail with an error.

Parameters

No parameters.

Returns

Returns a Charge Intent object if the cancellation succeeds. Returns an error if the Charge Intent is already canceled or isn't in a cancelable state.

POST/charge_intents/:id/cancel
curl --request POST \
  --url https://api.framepayments.com/v1/charge_intents/07fa5e20-ba30-48ce-9a13-4b1ce2381739/cancel \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "07fa5e20-ba30-48ce-9a13-4b1ce2381739",
  "currency": "usd",
  "latest_charge": null,
  "customer": {...},
  "payment_method": {...},
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_07fa5e20-ba30-48ce-9a13-4b1ce2381739_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "canceled",
  "description": "Payment",
  "authorization_mode": "automatic",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 4000,
  "created": 1721024039,
  "livemode": false
}

Confirm a Charge Intent

Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the Charge Intent will attempt to initiate a payment.

Parameters

No parameters.

Returns

Returns the resulting Charge Intent after all possible transitions are applied.

POST/charge_intents/:id/confirm
curl --request POST \
  --url https://api.framepayments.com/v1/charge_intents/545e76dc-7b89-412c-b7f0-ae190a8dd5d8/confirm \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "545e76dc-7b89-412c-b7f0-ae190a8dd5d8",
  "currency": "usd",
  "latest_charge": {...},
  "customer": {...},
  "payment_method": {...},
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_545e76dc-7b89-412c-b7f0-ae190a8dd5d8_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "succeeded",
  "description": "Payment",
  "authorization_mode": "manual",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 4000,
  "created": 1721020087,
  "livemode": false
}

Capture a Charge Intent

Capture the funds of an existing uncaptured Charge Intent.

Parameters
amount_captured_centsREQUIREDinteger

The amount to capture from the Charge Intent in cents.

Returns

Returns a Charge Intent object with status="succeeded" if the Charge Intent is capturable.

POST/charge_intents/:id/capture
curl --request POST \
  --url https://api.framepayments.com/v1/charge_intents/96409dca-4551-46a8-bb6c-cf53ee7e50ef/capture \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount_captured_cents": 4000
}'
RESPONSE
{
  "id": "96409dca-4551-46a8-bb6c-cf53ee7e50ef",
  "currency": "usd",
  "latest_charge": {...},
  "customer": {...},
  "payment_method": {...},
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_96409dca-4551-46a8-bb6c-cf53ee7e50ef_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "succeeded",
  "description": "Payment",
  "authorization_mode": "manual",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 4000,
  "created": 1721021625,
  "livemode": false
}

Void remaining amount

Voids the remaining amount of a Charge Intent that has been partially captured. This permanently cancels the ability to capture any remaining funds from the Charge Intent.

Parameters

No parameters.

Returns

Returns a Charge Intent object with the remaining amount voided if the operation succeeds. Returns an error if the Charge Intent is not in a state that allows voiding the remaining amount.

POST/v1/charge_intents/:id/void_remaining
curl --request POST \
  --url https://api.framepayments.com/v1/charge_intents/96409dca-4551-46a8-bb6c-cf53ee7e50ef/void_remaining \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "id": "96409dca-4551-46a8-bb6c-cf53ee7e50ef",
  "currency": "usd",
  "latest_charge": {...},
  "customer": {...},
  "payment_method": {...},
  "shipping": null,
  "metadata": {},
  "client_secret": "ci_96409dca-4551-46a8-bb6c-cf53ee7e50ef_secret_hqcbv4AemDukEpDi5ikfKA3rXDpZAuHwBZw",
  "status": "succeeded",
  "description": "Payment",
  "authorization_mode": "manual",
  "failure_description": null,
  "object": "charge_intent",
  "amount": 4000,
  "created": 1721021625,
  "livemode": false
}