API
Checking Raims account

Charges

Create and track charges and get payment receipts.

A charge specifies the amount a customer should pay your company. After creating it, track its status to check whether the customer paid. Creation alone does not confirm payment or available account balance.

The base URL for requests is https://api.raims.com.

Create and check your first charge

This walkthrough uses Sandbox without requesting email. Copy IDs from your own responses between steps; the displayed values are examples.

  1. Create the payer record

    Use Create a customer and keep the returned id.

    Request example excerptPOST /v1/customers

    Create a customer

    JSON
    {
      "tax_id": "12345678909"
    }
  2. Create the charge

    In Create a charge, replace customer_id with the returned ID and choose a valid due date for the time of your test.

    Request example excerptPOST /v1/charges

    Create a new charge

    JSON
    {
      "customer_id": "cus_1Q2W3E4R5T6Y7U8I9O0P",
      "amount_cents": 10000,
      "due_date": 1893456000,
      "send_email": false
    }

    Without choosing a method in this input, the charge does not request direct issuance. Keep the charge id, which differs from the customer ID.

  3. Confirm the test payment

    Use that ID in Confirm payment. The response identifies the same charge and its paid state:

    HTTP 200 response example excerptPOST /v1/simulations/charges/{id}/confirm_payment

    Simulation applied

    JSON
    {
      "charge_id": "ch_3AbHiWSrsZBoaTg47OcMzC",
      "status": 4,
      "duplicate": false
    }
  4. Check the resource and balance

    Retrieve the charge using the same ID and check status. Also query the balance and statement. The entry can take a few moments to appear; repeating confirmation does not speed it up.

To offer payment, choose the creation behavior before sending:

IntentCreation inputWhere to obtain payment instructions
Display Pix in your systempayment_method: 1, without a custom listpayment_information.pix when issuance is available.
Display boleto in your systempayment_method: 2, without a custom listpayment_information.boleto, using the required boleto customer details.
Let the payer choose in checkoutOmit payment_method or use 0; request create_checkout: true to obtain the linkcheckout_url in the response.
Restrict methods without issuing during creationA custom payment_method_types list, with the scalar omitted or 0Issuance after checkout selection.

Customer and payment method conditions still apply. The test confirmation above does not choose a method for the charge; to test payment details and the receipt, create it with the intended method as described below.

Customer and environment

Use a customer already registered in the authenticated company and environment. To register the payer, see Create a customer. To look up an existing record, use Retrieve a customer.

Copy the customer's id to customer_id when creating the charge. Do not send your own system's identifier in that field. Sandbox records and charges are kept separate from Production data. Use Sandbox to test without moving real funds.

Use Simulation to confirm a payment or apply a failure to a test charge. You can also test pending or failed issuance and cancellation, as well as boleto clearing before settlement. These endpoints are exclusive to Sandbox and let you check results without making a real payment.

To issue Pix when creating the charge, the linked customer must have a valid CPF/CNPJ. The API uses this record; do not send another tax ID in the charge request. The tax ID identifies the customer being charged without requiring payment from a bank account held by that person or business.

Create a charge

Create a new charge, with POST /v1/charges, accepts the customer and charge amount. Send amount_cents as an integer in cents: 10000 represents R$ 100,00. The allowed amount ranges from 100 to 999999999999 cents.

Each request creates one charge. payment_method_types lets you define a custom list of accepted methods that overrides the account default for that charge only. Omitting the list or sending null keeps inheritance from the checkout configuration. Platform availability still applies, and a custom link configuration can reduce the charge's options.

payment_method is separate from the list and keeps the behavior for choosing or restricting a method when the list is not provided. With a custom list, omit this field or send 0. See formats and codes in Payment methods.

Title and description are optional and accept up to 512 characters each.

Store the identifier returned by the API to associate the charge with your system. If a request ends without a conclusive response, check the result before repeating the request.

Receive Pix when creating a charge

In POST /v1/charges, send the customer_id of a registered customer and payment_method: 1, without a custom list in payment_method_types. Issuance uses the valid CPF/CNPJ in that record; do not send another tax ID, name or email in the charge request. The response includes payment_information.pix, with copy_paste, expires_at and qr_code_base64. You can display this data in your system without sending the payer to Raims checkout. Issuance does not confirm payment.

payment_information.pix_status shows the result: available when Pix is available, pending while issuance has not been confirmed, failed when it could not be issued and not_generated when no Pix issuance is available. For failed, check payment_information.pix_error for the reason.

Display the QR Code and use the copy-and-paste code

When receiving Pix during creation with POST /v1/charges, the QR Code is returned in payment_information.pix.qr_code_base64 as a Base64 PNG image. To display it on a page, add the data:image/png;base64, prefix before this value. copy_paste is the code to copy, and expires_at shows expiration in Unix UTC seconds.

201 and 202 responses for Pix

If you receive 202, the charge already has an ID but Pix is not yet available. Store that ID and look up the same charge in Retrieve a charge. Do not create another charge to track this issuance. The lookup returns the available data and current status; looking it up does not issue another code.

If issuance remains pending or fails, contact support and provide the charge ID. A 201 response confirms charge creation. Check payment_information.pix_status and the payment data to see whether Pix is available.

Compare available, failed and pending issuance

HTTP 201 response example excerptPOST /v1/charges

Charge with Pix available

JSON
{
  "id": "ch_1Q2W3E4R5T6Y7U8I9O0P",
  "payment_information": {
    "pix_status": "available"
  }
}

Pix is available in the payment details. The charge has not been paid yet.

Pix at creation or in checkout

A list such as payment_method_types: [1] configures the accepted methods but keeps issuance after checkout selection. To request Pix during creation itself, use payment_method: 1.

Receive a boleto when creating a charge

In POST /v1/charges, send payment_method: 2, without a custom list in payment_method_types. In customer_id, use the ID of a customer with a name, valid email, valid CPF/CNPJ and address. The postal code is in zip_code and the number in street_number in the customer record. You do not need to send another payer or address in the charge request. Email is required for issuance even with send_email: false; providing it in the record does not request a message.

Raims can fill in missing street, neighborhood, city and state from the postal code when this data is available. Existing address values are kept. The number must be in the record; it and the address complement do not come from the postal code. The complement is optional. If the postal code does not supply all required data, complete the address in Update an existing customer before issuing the boleto.

The address used for issuance does not change the customer record. This differs from completion when creating a customer: there, providing a number or complement prevents postal code completion. During boleto issuance, they can be filled in while Raims completes the other missing fields.

When the boleto is available, payment_information.boleto contains line_digits, barcode and due_date. Use the payment line and barcode in your system. The due date is in Unix UTC seconds and corresponds to the boleto date. Issuing this data does not confirm payment. In Sandbox, the boleto is simulated and must not be used for a real payment.

A list such as payment_method_types: [2] configures boleto in checkout, with issuance after the payer's selection. To issue it during creation, use payment_method: 2.

201 and 202 responses for boleto

payment_information.boleto_status shows available when data is available, pending when issuance has not yet been confirmed, failed when it could not be issued and not_generated when no issuance is available or requested. boleto_error gives the reason for a pending result or failure, when present.

A 201 response confirms charge creation; check boleto_status to see whether the boleto was issued. For 202, store the ID and track the same charge in Retrieve a charge. The lookup does not repeat or renew issuance. If it remains pending or fails, contact support with the charge ID without creating another charge to repeat issuance.

If customer data prevents creation, correct the record indicated by the error before resending the request. Confirmed issuance also does not mean the customer paid; track the charge's status.

Boleto payment progress appears in payment_information.boleto_payment_status: awaiting_payment for an issued boleto awaiting payment, compensated for a cleared payment awaiting settlement and settled for a settled payment. Without available progress data, the field returns null. Clearing does not yet mean available credit. To test these steps, see Boleto clearing and settlement.

Reference in your system

Send the order or charge identifier in your system as external_reference, for example PEDIDO-123. This field belongs to the charge and is separate from the external reference registered on the customer.

The reference is optional. At creation, omitting the field, sending null, empty text or only spaces leaves the charge without a reference. The API removes leading and trailing spaces. The create, lookup and update responses include external_reference, with the registered value or null.

You can change or remove the reference in Update an existing charge. Omitting the field keeps the current value; sending null, empty text or only spaces removes the reference. This change does not change the Raims identifier or linked customer.

In GET /v1/charges, the external_reference filter searches for the full current value of the charge's reference. The comparison is case-sensitive and accent-sensitive. Keep the same value along with other filters when navigating by cursor. A create or update may take a few seconds to appear in this search; avoid continuous requests at short intervals.

The same reference can appear on more than one charge. Repeating this reference alone does not make the API reuse a charge. Also store the returned id to recognize each charge and check an inconclusive result before trying again.

Additional integration data

Use metadata to store small pieces of information that associate the charge with your system, such as a branch or sales channel. Customer and charge data are separate: the customer's map is not copied to a new charge.

Due date

Provide the due date in due_date, in Unix UTC seconds. Choose a date and time at least five minutes after the request reaches the API. Account for transmission time when calculating that interval. The maximum is the corresponding day ten years from today, in São Paulo time.

For Pix, the due date keeps the specified time. Boleto uses the São Paulo due date, including the same day. Charge and checkout expiration does not confirm cancellation of a boleto already issued. To stop receiving payments through that boleto, track confirmation of the charge revocation.

To receive checkout_url without sending an email, use create_checkout: true when creating the charge and keep send_email: false. A return URL is not required to receive the link. Use the returned address to send the payer to that charge's checkout.

success_redirect_url and cancel_redirect_url configure the destinations for returning from checkout to the company's website. success_redirect_url is the destination after payment confirmation. cancel_redirect_url is the destination of the option to return to the website; this navigation does not revoke the charge.

Send complete HTTPS URLs of up to 2048 characters each on a company domain. Do not use credentials in the URL, an IP address, localhost or a Raims domain. The fields are optional: you can omit them, send null or leave them empty. Fields containing only spaces also do not define a return URL. Providing at least one of these URLs generates the link. Look up the charge to confirm payment in your system even if the payer returned through the success URL.

create_checkout and send_email are optional and use false when omitted. Without these options and without return URLs, the request creates the charge without generating a link or requesting an email; checkout_url returns null.

Use send_email: true to request that the charge be emailed to the customer's registered email. You also receive the link in checkout_url. First check that the customer has a valid email. To obtain only the link, use create_checkout: true with send_email: false.

This checkout belongs to a specific charge. To obtain or configure the link of a charge already created, use Payment links.

While the company awaits completion of its registration review, sending is restricted to the account holder's email. An email that is missing, invalid or different from the holder's email under that condition prevents creation with an email request. Outside that pending-registration restriction, a missing or invalid email does not prevent creating the charge and link, but no email is sent. Direct boleto issuance requires a valid email even without requesting a message. A successful request does not confirm email delivery or payment of the charge.

List charges

List charges, with GET /v1/charges, looks up records in the authenticated company and environment. Use filters for charge identifier, external reference, customer, email registered on the charge, status, registered payment method and creation, due date and payment intervals. Changing the customer's email does not change the email already registered on existing charges.

Retrieve a charge

Retrieve a charge, with GET /v1/charges/{id}, looks up the record, status and payment data in one request. Use the identifier received when creating or listing charges. The charge must belong to the authenticated company and environment.

payment_information.pix_status and payment_information.pix_error show the Pix issuance result. For boleto, check boleto_status and boleto_error in the same object. If creation returned 202, use the same ID in this lookup. The response may remain pending; repeated lookups do not restart issuance.

Use status to track the charge's condition and is_payable to check whether it can accept payment. payment_method shows the charge's current method; payment_method_types shows the configured custom list or null for inheritance; checkout_payment_method shows the method used to generate payment, or null before generation. Selecting an option on screen does not confirm issuance or payment. When creating with payment_method: 1, check payment_information.pix; with payment_method: 2, check payment_information.boleto for the available data.

The payment_information object brings together the QR Code, Pix copy-and-paste code and its expiration, or the data of a boleto already issued. Pix and boleto can be issued during creation with the respective payment_method or after checkout selection. Before issuance, a charge can accept payment without Pix or boleto data. When no issuance is available for the chosen method or the charge cannot accept payment, the data is null. The record and status remain available, including for paid, canceled or expired charges.

The lookup returns the existing checkout link or null. It does not change the charge or generate or renew Pix, boleto or link. It also does not request an email. Repeated lookups do not speed up issuance or payment confirmation. The list shows a charge summary and status without Pix and boleto data.

For counts, amounts and payment rate, see Charge statistics in Financial information.

Boleto PDF

Use Download a boleto, with GET /v1/charges/{id}/boleto, to obtain the PDF of a boleto already issued. The identifier is the charge's ID. You can attach the file to your system or give it to the customer without opening checkout. The request requires authentication for the same company and environment.

The download requires an issued boleto with the data needed to generate the file. You can obtain it while awaiting payment, during clearing and after settlement. A canceled or failed boleto or one without issuance data has no PDF available. Charge expiration alone does not confirm boleto cancellation.

If you receive BOLETO_DOCUMENT_NOT_AVAILABLE, look up the charge to check boleto issuance and progress. Repeating the download does not issue or renew the boleto or change its due date.

The endpoint returns JSON with url and expires_at. Make a GET request to the complete url to download the PDF from files.raims.com without sending Authorization or the API key in that download. expires_at shows expiration in Unix UTC seconds; after that, call the authenticated endpoint again. An invalid or expired link may receive HTTP 403 during download without the API's JSON error envelope. The URL can be reused until it expires and grants access to anyone who has it. Share it only with authorized people and do not record it in logs.

The document contains boleto instructions and does not prove payment. In Sandbox, it is identified as a simulation and must not be used for payment. To document a confirmed payment, use the receipt described below.

Payment data and receipt

Use Look up payment data, with GET /v1/charges/{id}/payment, to obtain confirmed payment data and display it in your system. For the prepared document, use Download a payment receipt, with GET /v1/charges/{id}/receipt. The identifier is the charge's ID, with the ch_ prefix.

The receipt is available for paid charges, partially refunded charges or charges with a dispute won by the company, as long as payment amount and date are recorded. If the document is unavailable, look up the charge to check its state before trying again.

GET /v1/charges/{id}/payment returns amount, payment method, date and registered details of the payer and receiving company. The payer's name and tax ID are those registered on the charge; they do not prove ownership of the bank account that made the payment. Fields without available information may be null.

For Production Pix payments, end_to_end_id shows the receipt's bank identifier when available. Use it to check the payment against the bank receipt or in your system's reconciliation. The field is null when there is no confirmed bank identification, for boleto payments and in Sandbox. A null value does not undo payment confirmation. This identifier differs from the charge's ch_ ID and the data used to initiate Pix.

GET /v1/charges/{id}/receipt returns JSON with url and expires_at for downloading the PDF. Make this request from your integration's server with an API key or OAuth session. Download the PDF from the complete url at files.raims.com without sending the key in that download. expires_at shows expiration in Unix UTC seconds. If the link expires, call the authenticated endpoint again for another link. An invalid or expired link may receive HTTP 403 during download without the API's JSON error envelope. The URL can be reused until it expires and grants access to anyone who has it; share it only with authorized people and do not record it in logs. The document is issued by Raims and does not replace a tax invoice or bank payment receipt. In Sandbox, the data and receipt identify the payment as simulated.

A partial refund does not change the payment receipt's original amount. To document each completed refund, use the refund receipt, with the rf_ identifier of the corresponding request.

Update a charge

Update an existing charge, with PATCH /v1/charges/{id}, changes the title, description, external reference and metadata by public identifier. Send the fields you want to change. Omitted fields keep their current value; for text fields, null or empty text clears the field you send. An empty body ({}) keeps the data. The metadata map follows the update by key rules. See how to use external_reference in Reference in your system.

Amount, due date and linked customer are defined at creation and cannot be changed by this request. To charge another amount or use another due date, revoke the eligible charge. Wait for revocation confirmation before creating the replacement charge. The due date alone does not prevent editing a charge that remains open. Paid, canceled, refunded charges or charges in other final states do not allow these fields to be edited. A request that changes only metadata remains allowed for an existing charge; see Additional integration data.

If the state prevents editing, CHARGE_NOT_UPDATABLE shows the current state and accepted states. Look up the charge before deciding how to continue; editing does not change its financial state.

Editing keeps the identifier, status and payment data. It does not generate or renew Pix, boleto or checkout link or request an email.

Revoke a charge

Revoke a charge, with DELETE /v1/charges/{id}, cancels a charge that should no longer accept payment. Use the ID from creation or lookup, in the same authenticated company and environment.

In Sandbox, you can test revocation without moving real funds. To check tracking of a pending or failed cancellation, prepare the result in Simulation before sending the revocation request.

In Production, revocation depends on the charge's status and payment data already issued. For issued Pix, cancellation must be confirmed. For boleto, the request may remain pending until confirmation. Track the same charge through the individual lookup; an accepted request does not mean cancellation is complete. If you do not receive cancellation confirmation, look up the same charge before trying again.

A rejection with CHARGE_NOT_REVOCABLE shows the state or payment condition that prevented the action. A boleto still being issued, a payment already identified and a rejected cancellation require different follow-up actions. Check the message and charge; revocation is not a way to request a refund.

The record and history remain available for lookup after revocation. Repeating the request for a charge already canceled in the same company and environment returns the same confirmation. To charge again, create another charge.

A paid Pix charge can follow the refund flow. Revocation does not refund, reimburse or return funds and does not request an email.

See the fields and responses in Create a new charge, List charges, Retrieve a charge, Update an existing charge and Revoke a charge. To prepare your integration credential, see Authentication.