Get Payment Detail

Get detailed information about a specific payment.

Request

use dodopayments_rust::{to_pretty_json, DodoPaymentsClientBuilder};

#[tokio::main]

async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_key = std::env::var("DODO_API_KEY")?;

    let client = DodoPaymentsClientBuilder::new()
        .bearer_token(&api_key)
        .enviroment("test_mode")
        .build()?;

    let payment_id = "pay_xxxxxxxxxx";

    let resp = client.payments().id(payment_id).retrieve().send().await?;

    println!("{}", to_pretty_json(&resp)?);

    Ok(())
}

Path Parameters

ParameterTypeDescription
payment_idstringPayment Id

Responses

200 Status

FieldTypeDescription
billingBillingAddressBilling address details for payments
brand_idstringbrand id this payment belongs to
business_idstringIdentifier of the business associated with the payment
card_holder_nameobjectCardholder name
card_issuing_countryobject
card_last_fourobjectThe last four digits of the card
card_networkobjectCard network like VISA, MASTERCARD etc.
card_typeobjectThe type of card DEBIT or CREDIT
checkout_session_idobjectIf payment is made using a checkout session, this field is set to the id of the session.
created_atstringTimestamp when the payment was created
currencyCurrencyCurrency used for the payment
custom_field_responsesobjectCustomer's responses to custom fields collected during checkout
customerCustomerLimitedDetailsResponseDetails about the customer who made the payment
digital_products_deliveredbooleanbrand id this payment belongs to
discount_idobjectThe discount id if discount is applied
disputesarray<DisputeResponse>List of disputes associated with this payment
error_codeobjectAn error code if the payment failed
error_messageobjectAn error message if the payment failed
invoice_idobjectInvoice ID for this payment. Uses India-specific invoice ID if available.
invoice_urlobjectURL to download the invoice PDF for this payment.
metadataMetadataAdditional custom data associated with the payment
payment_idstringUnique identifier for the payment
payment_linkobjectCheckout URL
payment_methodobjectPayment method used by customer (e.g. "card", "bank_transfer")
payment_method_typeobjectSpecific type of payment method (e.g. "visa", "mastercard")
product_cartobjectList of products purchased in a one-time payment
refund_statusobject
refundsarray<RefundListItem>List of refunds issued for this payment
settlement_amountintegerThe amount that will be credited to your Dodo balance after currency conversion and processing. Especially relevant for adaptive pricing where the customer's payment currency differs from your settlement currency.
settlement_currencyCurrencyThe currency in which the settlement_amount will be credited to your Dodo balance. This may differ from the customer's payment currency in adaptive pricing scenarios.
settlement_taxobjectThis represents the portion of settlement_amount that corresponds to taxes collected. Especially relevant for adaptive pricing where the tax component must be tracked separately in your Dodo balance.
statusobject
subscription_idobjectIdentifier of the subscription if payment is part of a subscription
taxobjectAmount of tax collected in smallest currency unit (e.g. cents)
total_amountintegerTotal amount charged to the customer including tax, in smallest currency unit (e.g. cents)
updated_atobjectTimestamp when the payment was last updated

Especially relevant for adaptive pricing where the tax component must be tracked separately

Especially relevant for adaptive pricing where the tax component must be tracked separately

Especially relevant for adaptive pricing where the tax component must be tracked separately

Especially relevant for adaptive pricing where the tax component must be tracked separately

500 Status

Something went wrong :(