Payments
The TapTree API payment endpoints facilitate the creation, collection, and management of payments in an environmentally conscious way.
The initial setup is straightforward. Start by creating a payment, then direct customers to our secure checkout or their chosen payment method. After completion, a webhook not only updates you on the transaction status, but also informs you about the environmental contribution of the purchase.
Discover the Payments resource using Postman:
TapTree Postman CollectionEndpoints
Retrieve a payment
Fetch details of a specific payment using its unique identifier.
Cancel a payment
Cancel a previously created payment that is not yet finalized.
Payment status
Every payment starts as open and moves to pending once the customer begins the payment process. From pending, the payment can reach paid directly, or pass through an intermediate state first.
| Status | Description | Webhook event | Terminal? |
|---|---|---|---|
open | Payment created. Awaiting customer action. | — | No |
pending | Customer has started the payment process. | — | No |
authorized | Card authorized — amount reserved but not yet captured. Capture to collect funds, or void to release. | transactions.payment.authorized | No |
verify | Payment flagged for merchant review. Approve to collect funds, or decline to cancel. | transactions.payment.verify | No |
paid | Payment completed successfully. | transactions.payment.paid | Yes |
void | Authorization was released without capturing funds. | transactions.payment.void | Yes |
denied | Payment declined after merchant review. | transactions.payment.denied | Yes |
canceled | Payment canceled by the customer or merchant. | transactions.payment.canceled | Yes |
failed | Payment failed (e.g. insufficient funds, processor error). | transactions.payment.failed | Yes |
expired | Payment expired before completion. | transactions.payment.expired | Yes |
Not every payment passes through all states. Most payments go directly from
pending to paid. Card payments with delayed capture pass through
authorized first. The verify state only applies when the payment is
flagged for merchant review.
The payment model
The payment model contains all the information about your customer's payments.
Core attributes
- Name
id- Type
- string
- Description
Unique identifier for the payment.
- Name
org_id- Type
- string
- Description
Unique identifier for the corresponding organization.
- Name
acceptor_id- Type
- string
- Description
Unique identifier for the corresponding payment acceptor such as a website or a payment link.
- Name
status- Type
- string
- Description
Status of the payment, one of
open,pending,authorized,verify,paid,void,denied,canceled,failed, orexpired. Find more information about each status.
- Name
created_at- Type
- datetime
- Description
Timestamp of when the payment was created, in ISO 8601 format.
- Name
amount- Type
- object
- Description
The amount of the payment, containing a string encoded
valueand thecurrency.
- Name
return_url- Type
- string
- Description
The URL the customer is redirected to after completing or canceling the payment.
- Name
links- Type
- object
- Description
Links to the payment object in the
api, thecheckoutpage, and thedashboard. Each sub-object contains thehrefand thetypeof the link.
Optional attributes
- Name
webhook_url- Type
- string
- Optional
- optional
- Description
The URL the payment status is sent to after the payment reaches these states:
authorized,verify,paid,void,denied,canceled,failed, orexpired.
|- Name
paid_at- Type
- datetime
- Optional
- optional
- Description
Timestamp of when the payment was paid, in ISO 8601 format.
|- Name
authorized_at- Type
- datetime
- Optional
- optional
- Description
Timestamp of when the payment was authorized, in ISO 8601 format.
|- Name
expires_at- Type
- datetime
- Optional
- optional
- Description
Timestamp of when the payment expires, in ISO 8601 format.
|- Name
expired_at- Type
- datetime
- Optional
- optional
- Description
Timestamp of when the payment expired, in ISO 8601 format.
|- Name
canceled_at- Type
- datetime
- Optional
- optional
- Description
Timestamp of when the payment was
canceledeither by the shopper at the payment page or the merchant via the TapTree API. Timestamp is in ISO 8601 format.
|- Name
mode- Type
- string
- Optional
- optional
- Description
Indicates whether the payment is processed in 'test' or 'live' mode. The used authentication token determines this setting, so you cannot use a test token to create live payments, but a live token for testmode by setting
modetotest. Live tokens default tolive, i.e., processing in livemode.
|- Name
description- Type
- string
- Optional
- optional
- Description
An optional description of the payment. Useful for displaying to the customer.
|- Name
payment_method- Type
- string
- Optional
- optional
- Description
The payment method used for the payment, one of the methods available at the payment acceptor such as
card,paypal,sofort,applepay, orgooglepay. Automatically set when the payment is eitherauthorizedorpaid.If
payment_methodis defined (i.e., not null), a detail object is attached to the payment object, containing the details of the payment method.
|- Name
card- Type
- object
- Optional
- optional
- Description
If the payment was completed by card you will find details about
bin,last4,security,expiry_year, andexpiry_monthas strings in this object.If the payment was completed by a wallet such as Apple Pay or Google Pay, you will find a key
walletwith the valueapplepayorgooglepayrespectively. For the keybrandyou will find the card brand such asvisa,master, oramex.
|- Name
paypal- Type
- object
- Optional
- optional
- Description
If the payment was completed with PayPal you will find the customers
emailin this object.
|- Name
amount_captured- Type
- object
- Optional
- optional
- Description
The total amount that has been captured for this payment. Only present when
capture_methodismanualand the captured amount is greater than zero. Contains a string encodedvalueand thecurrency.
|- Name
amount_refunded- Type
- object
- Optional
- optional
- Description
The total amount that has been refunded for this payment. Only present when the refunded amount is greater than zero. Contains a string encoded
valueand thecurrency.
|- Name
sequence_type- Type
- string
- Optional
- optional
- Description
The sequence type of the payment, either
one_offorrecurring(not functional yet). Defaults toone_off.
|- Name
impact- Type
- object
- Optional
- optional
- Description
The environmental impact of the payment, containing the string encoded
valueandunit. Theunitis currently alwaysg CO2, but might be subject to change in the future.
|- Name
available_payment_methods- Type
- object
- Description
This property lists the payment methods available for a payment while it is in the
openstate. Each key within this object represents a specific payment method, such ascard,paypal,sofort,applepay,googlepay, and others. Accompanying each payment method is animpactobject detailing the environmental impact associated paying with that method. Thisimpactobject includes both thevalueof the impact (quantitative measure) and itsunit, which is currently denoted ing CO2. It's important to note that the impact unit may be updated in future versions.You can iterate over the
available_payment_methodsobject to retrieve the environmental impact for each payment method, or directly access the impact of a specific payment method using its key.The
available_payment_methodsobject includes only those payment methods that are currently active for the given acceptor. Additionally, this property is provided exclusively when the payment is in theopenstate.
- Name
billing- Type
- object
- Optional
- optional
- Description
Details for billing, covering the address where billing documents are sent.
|- Name
shipping- Type
- object
- Optional
- optional
- Description
Information regarding the shipment of the product, including the recipient's address and contact details for accurate delivery.
|- Name
customer- Type
- object
- Optional
- optional
- Description
Contains details about the
customerinvolved in the transaction. It's essential for personalizing the transaction experience and for certain security protocols.The inclusion of a
customer.shopper_idandcustomer.emailnot only enhances transaction security through 3DS v2 but also aids in building a comprehensive customer database for better service and analysis.
|
Payment object
{
"object": "payment",
"id": "pay_AzoSgo2h7mB",
"org_id": "org_5A8hsNqGGyW",
"acceptor_id": "acceptor_Aa54Z3THuFj",
"status": "paid",
"created_at": "2023-12-11T00:40:56.685Z",
"paid_at": "2023-12-11T00:44:58.944Z",
"mode": "test",
"description": "order #2",
"payment_method": "card",
"card": {
"bin": "555555",
"brand": "master",
"last4": "4444",
"wallet": "googlepay",
"security": "basic",
"expiry_year": "2025",
"expiry_month": "12"
},
"amount": {
"value": "15.00",
"currency": "eur"
},
"amount_captured": {
"value": "15.00",
"currency": "eur"
},
"impact": {
"value": "1081",
"unit": "g CO2"
},
"sequence_type": "one_off",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"locale": "de_DE",
"billing": {
"name": "Gisela Gundella",
"address": {
"city": "Saarbrücken",
"country": "DE",
"postal_code": "66123",
"street_and_number": "Waldweg 1",
"additional_address_information": "Wohnung 1"
}
},
"shipping": {
"name": "Gisela Gundella",
"email": "gisela@gundella-home.de",
"phone": "+49176111111111",
"address": {
"city": "Saarbrücken",
"country": "DE",
"postal_code": "66123",
"street_and_number": "Waldweg 1",
"additional_address_information": "Wohnung 1"
},
"carrier": {
"name": "UPS",
"tracking_urls": [
"https://tracking.ups.com/AOF1273kdk3812"
],
"tracking_numbers": [
"AOF1273kdk3812"
]
}
},
"customer": {
"id": "cus_349daeF91f",
"email": "gisela@gundella-home.de",
"shopper_id": "shop_11dk311df"
},
"links": {
"api": {
"href": "https://api.taptree.org/v1/payments/pay_AzoSgo2h7mB",
"type": "application/json"
},
"checkout": {
"href": "https://checkout.taptree.org/pay_AzoSgo2h7mB",
"type": "text/html"
},
"dashboard": {
"href": "https://my.taptree.org/org_5A8hsNqGGyW/payments/pay_AzoSgo2h7mB",
"type": "text/html"
}
}
}
Create a payment
Creates a new payment object and kicks off the payment process.
After creating a payment, you can redirect your customer to the links.checkout.href attribute in the response to complete the payment.
Required attributes
- Name
amount- Type
- object
- Description
The amount you want to charge your customer, containing a string encoded
valueand thecurrency.If you want to charge fifteen euros and twenty euro cents, you would pass the following object:
{ "value": "15.20", "currency": "eur" }
- Name
description- Type
- string
- Description
When you set up a payment, include a concise description that shows up on your customer's card or bank statement. This description helps both you and your customer quickly identify the transaction. To streamline record-keeping, incorporate a unique identifier into this description, linking it directly to a specific order in your system.
Be mindful of length; each payment method has a character limit for descriptions, with a maximum of 255 characters. If your description exceeds this limit, our system will automatically truncate it to comply. This truncation ensures compatibility across different payment platforms while maintaining essential details for easy reference.
- Name
return_url- Type
- string
- Description
After finishing the payment process, your customer will return to a specific URL you provide. It's useful to embed a unique identifier in the
return_url, like the order ID. This way, you can present a page that's tailored to the particular order when your customer comes back.
Optional attributes
- Name
webhook_url- Type
- string
- Optional
- optional
- Description
Choose a webhook URL to receive updates on payment status. Although setting
webhook_urlis optional, not doing so means you'll miss critical notifications about changes in payment status.Remember, the webhook URL must be externally accessible;
localhostwon't suffice. For local development, use a service like ngrok to route webhook calls to your local environment, ensuring you can test and handle payment updates effectively.
|- Name
locale- Type
- string
- Optional
- optional
- Description
Set the
localeproperty to define the language for the hosted payment pages your customers will see. Specifying alocaleis strongly recommended as it can significantly boost your conversion rate. If you don't set alocale, the system defaults to the browser's language, provided it's compatible with the payment method. Use a locale in the ISO 15897 format, typically represented asxx_XX, wherexxdenotes the language code andXXthe country code.Supported locales include:
de_DE,nl_NL,fr_FR,es_ES,en_US.
|- Name
payment_methods- Type
- array of strings
- Optional
- optional
- Description
To enhance your checkout process, adjust the
payment_methodsparameter. This modification allows two primary functions: directly redirecting customers to a specific payment method or presenting a customized selection of payment options in our hosted checkout.For direct redirection, specify a single method in
payment_methodsin the array, like["paypal"]. This skips the standard choice screen and takes the customer straight to PayPal. This direct approach streamlines the payment experience, particularly useful when a preferred method is already known.When multiple methods are preferred, list them in an array of strings within
payment_methods. For instance,["card", "applepay", "googlepay"]will display only these three options on the payment method screen. This method is especially beneficial for tailoring payment options to specific customer groups or regional preferences.Available methods are:
cardpaypalsofortapplepaygooglepaygiropayepsalipaywechatidealpayconiqpaysafecardprzelewyrivertysepa_direct_debittrustlyspraypayin3blikApple Pay and Google Pay are currently only available upon request.
|- Name
capture_method- Type
- string
- Optional
- optional
- Default
- default=automatic
- Description
The
capture_methodparameter determines when the payment amount is captured. By default, the system automatically captures the payment amount when the payment is authorized. However, you can change this behavior by settingcapture_methodtomanual. This setting allows you to capture the payment amount at a later time, typically up to five days after authorization. This approach is useful when you need to confirm the availability of goods or services before capturing the payment amount.Note that the
capture_methodparameter only applies to eligible payment methods, such ascardorpaypal. For other payment methods, the system automatically captures the payment amount when the payment is authorized.Available values:
automaticandmanual.Defaults to automatic. Manual is currently only available upon request.
||- Name
test_mode- Type
- boolean
- Optional
- optional
- Description
When true, creates a test payment even when using a live token.
|- Name
metadata- Type
- object
- Optional
- optional
- Description
Use the
metadataproperty to add custom key-value pairs to an object, providing a structured way to store extra details. This feature is useful for including information specific to your needs, like tracking codes or customer notes.Up to 20 key-value pairs can be added to the
metadataobject, with each key limited to 40 characters and each value to 500 characters. The total size of themetadataobject cannot exceed 5,000 characters.
|- Name
billing- Type
- object
- Optional
- optional
- Description
Details for billing, covering the address where billing documents are sent.
Including
billing.nameandbilling.addressis crucial not just for credit card transactions but for all payment methods. It serves several key purposes: enhancing the verification process, reducing the risk of fraudulent activities, and ensuring compliance with various financial regulations.A confirmed billing address matches the payment details with the payer's information, adding an extra layer of security to the transaction. This verification is especially important in digital transactions where physical verification isn't possible, thereby boosting the overall confidence and trust in your system.
|- Name
shipping- Type
- object
- Optional
- optional
- Description
Information regarding the shipment of the product, including the recipient's address and contact details for accurate delivery.
Accurate
shipping.addressinformation is essential for more than just logistical accuracy; it plays a significant role in fraud prevention and enhancing the security of transactions.For non-credit card payments, such as digital wallets or bank transfers, a verified shipping address confirms the legitimacy of the transaction, ensuring that the goods are sent to an authenticated location.
So this level of detail not only improves the security of transactions but also enhances customer satisfaction by ensuring timely and accurate delivery.
|- Name
customer- Type
- object
- Optional
- optional
- Description
Contains details about the
customerinvolved in the transaction. It's essential for personalizing the transaction experience and for certain security protocols.The inclusion of a
customer.shopper_idandcustomer.emailnot only enhances transaction security through 3DS v2 but also aids in building a comprehensive customer database for better service and analysis.
|
Request
curl https://api.taptree.org/v1/payments \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"amount": { "value": "15.20", "currency": "eur" },
"description": "Order #12345",
"metadata": { "order_id": "12345" },
"payment_methods": ["card"],
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"billing": {
"name": "John Doe",
"address": {
"street_and_number": "123 Main St",
"postal_code": "12345",
"city": "Cityville",
"country": "Countryland"
}
},
"customer": {
"shopper_id": "12345",
"email": "hey@yoursite.com"
}
}'
Example response
{
"object": "payment",
"id": "pay_AzoSgo2h7mB",
"org_id": "org_5A8hsNqGGyW",
"acceptor_id": "acceptor_Aa54Z3THuFj",
"status": "open",
"created_at": "2023-12-11T00:40:56.685Z",
"expires_at": "2023-12-11T01:00:56.685Z",
"mode": "test",
"description": "order #2",
"amount": {
"value": "15.00",
"currency": "eur"
},
"sequence_type": "one_off",
"capture_method": "automatic",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"available_payment_methods": {
"card": {
"impact" : {
"unit": "g CO2",
"value": "1081"
}
}
},
"billing": {
"name": "John Doe",
"address": {
"street_and_number": "123 Main St",
"postal_code": "12345",
"city": "Cityville",
"country": "Countryland"
}
},
"customer": {
"shopper_id": "12345",
"email": "hey@yoursite.com"
},
"links": {
"api": {
"href": "https://api.taptree.org/v1/payments/pay_AzoSgo2h7mB",
"type": "application/json"
},
"checkout": {
"href": "https://checkout.taptree.org/pay_AzoSgo2h7mB",
"type": "text/html"
},
"dashboard": {
"href": "https://my.taptree.org/org_5A8hsNqGGyW/payments/pay_AzoSgo2h7mB",
"type": "text/html"
}
}
}
Retrieve a payment
To obtain the details of an already created payment, you'll need to access the specific payment using its unique identifier. Each payment you create is assigned a unique ID, such as pay_3ouMA9myA3.
Parameters
To retrieve the information for a particular payment, replace the placeholder id in the endpoint URL with the actual payment ID. For example, to get details for the payment with ID pay_3ouMA9myA3, your endpoint URL should look like /v1/payments/pay_3ouMA9myA3. This action fetches all relevant data associated with that specific payment, including its status, amount, and any other stored details.
All available object details are documented in the payment model.
Request
curl https://api.taptree.org/v1/payments/pay_3ouMA9myA3 \
-H "Authorization: Bearer {token}"
Example response
{
"object": "payment",
"id": "pay_3ouMA9myA3y",
"org_id": "org_5A8hsNqGGyW",
"acceptor_id": "acceptor_Aa54Z3THuFj",
"status": "open",
"created_at": "2023-12-11T22:50:21.805Z",
"expires_at": "2023-12-11T23:10:21.805Z",
"mode": "test",
"description": "order #2",
"amount": {
"value": "15.00",
"currency": "eur"
},
"sequence_type": "one_off",
"capture_method": "automatic",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"available_payment_methods": {
"card": {
"impact" : {
"unit": "g CO2",
"value": "1081"
}
}
},
"billing": {
"name": "John Doe",
"address": {
"street_and_number": "123 Main St",
"postal_code": "12345",
"city": "Cityville",
"country": "Countryland"
}
},
"customer": {
"shopper_id": "12345",
"email": "hey@yoursite.com"
},
"links": {
"api": {
"href": "https://api.taptree.org/v1/payments/pay_3ouMA9myA3y",
"type": "application/json"
},
"checkout": {
"href": "https://checkout.taptree.org/pay_3ouMA9myA3y",
"type": "text/html"
},
"dashboard": {
"href": "https://my.taptree.org/org_5A8hsNqGGyW/payments/pay_3ouMA9myA3y",
"type": "text/html"
}
}
}
Update a payment
This endpoint is designed for updating specific details of an existing payment. You can modify certain attributes of a payment provided it is still in the open state.
Required parameters
To update a payment, replace id in the endpoint URL with the payment's ID, such as pay_3ouMA9myA3y.
Optional attributes
- Name
description- Type
- string
- Optional
- optional
- Description
Modify the description of the payment. Useful for adding or updating information visible to the customer. Note that the maximum length varies by payment method, up to 255 characters. Longer descriptions will be automatically truncated to fit the limits.
|- Name
return_url- Type
- string
- Optional
- optional
- Description
Update the URL to which your customer will be redirected after completing the payment. This is only editable if the payment is still
open.
|- Name
webhook_url- Type
- string
- Optional
- optional
- Description
Change the webhook URL to receive payment status updates. The new URL will be used for sending notifications about subsequent payment state changes.
|- Name
metadata- Type
- object
- Optional
- optional
- Description
Add or update metadata associated with the payment. This can be any JSON object. Up to 20 key-value pairs can be added, with each key limited to 40 characters and each value to 500 characters. The total size cannot exceed 5,000 characters. The metadata is included whenever you fetch the payment details.
|- Name
locale- Type
- string
- Optional
- optional
- Description
Adjust the language for the hosted payment pages. Accepts
xx_XXformatISO 15897locales. Useful for tailoring the customer's payment experience to their preferred language.
|
Request
curl -X PUT https://api.taptree.org/v1/payments/pay_3ouMA9myA3 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated order #12345",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"metadata": {
"customer_note": "Updated note"
},
"locale": "en_US"
}'
Example response
{
"object": "payment",
"id": "pay_3ouMA9myA3y",
"org_id": "org_5A8hsNqGGyW",
"acceptor_id": "acceptor_Aa54Z3THuFj",
"status": "open",
"created_at": "2023-12-11T22:50:21.805Z",
"expires_at": "2023-12-11T23:10:21.805Z",
"mode": "test",
"description": "Updated order #12345",
"amount": {
"value": "15.00",
"currency": "eur"
},
"sequence_type": "one_off",
"capture_method": "automatic",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"metadata": {
"customer_note": "Updated note"
},
"available_payment_methods": {
"card": {
"impact" : {
"unit": "g CO2",
"value": "1081"
}
}
},
"billing": {
"name": "John Doe",
"address": {
"street_and_number": "123 Main St",
"postal_code": "12345",
"city": "Cityville",
"country": "Countryland"
}
},
"customer": {
"shopper_id": "12345",
"email": "hey@yoursite.com"
},
"locale": "en_US",
"links": {
"api": {
"href": "https://api.taptree.org/v1/payments/pay_3ouMA9myA3y",
"type": "application/json"
},
"checkout": {
"href": "https://checkout.taptree.org/pay_3ouMA9myA3y",
"type": "text/html"
},
"dashboard": {
"href": "https://my.taptree.org/org_5A8hsNqGGyW/payments/pay_3ouMA9myA3y",
"type": "text/html"
}
}
}
Cancel a payment
Use this endpoint to cancel a payment, but only if its status is open. The ability to cancel a payment depends on the is_cancelable property in the payment object, which defaults to true. While cancellations can be done manually via the TapTree Dashboard, this endpoint enables programmatic cancellation.
Required parameters
To cancel a payment, replace id in the endpoint URL with the payment's ID, such as pay_3ouMA9myA3y.
Request
curl -X DELETE https://api.taptree.org/v1/payments/pay_3ouMA9myA3y \
-H "Authorization: Bearer {token}"
Example response
{
"object": "payment",
"id": "pay_3ouMA9myA3y",
"org_id": "org_5A8hsNqGGyW",
"acceptor_id": "acceptor_Aa54Z3THuFj",
"status": "canceled",
"created_at": "2023-12-11T22:50:21.805Z",
"expires_at": "2023-12-11T23:10:21.805Z",
"mode": "test",
"description": "Updated order #12345",
"amount": {
"value": "15.00",
"currency": "eur"
},
"sequence_type": "one_off",
"capture_method": "automatic",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"metadata": {
"customer_note": "Updated note"
},
"available_payment_methods": {
"card": {
"impact" : {
"unit": "g CO2",
"value": "1081"
}
}
},
"locale": "en_US",
"billing": {
"name": "John Doe",
"address": {
"street_and_number": "123 Main St",
"postal_code": "12345",
"city": "Cityville",
"country": "Countryland"
}
},
"customer": {
"shopper_id": "12345",
"email": "hey@yoursite.com"
},
"links": {
"api": {
"href": "https://api.taptree.org/v1/payments/pay_3ouMA9myA3y",
"type": "application/json"
},
"checkout": {
"href": "https://checkout.taptree.org/pay_3ouMA9myA3y",
"type": "text/html"
},
"dashboard": {
"href": "https://my.taptree.org/org_5A8hsNqGGyW/payments/pay_3ouMA9myA3y",
"type": "text/html"
}
}
}
List all payments
Retrieve a paginated list of payments associated with the current payment acceptor, displayed in descending order (newest first). The response is paginated for convenient browsing. You can paginate through the list using limit, starting_after, and ending_before parameters for more controlled access.
Optional query parameters
- Name
limit- Type
- integer
- Optional
- optional
- Default
- default=10
- Description
Set the maximum number of payments to return in one response. The limit can be up to 100 payments.
||- Name
starting_after- Type
- string
- Optional
- optional
- Description
A payment
idthat acts as a cursor for pagination returning payments listed after thisid. This parameter is useful when paginating through a large number of payments, where the response is split into multiple pages.Example: If your last retrieved payment
idispay_xyz123, usestarting_after=pay_xyz123in your next request to get payments followingpay_xyz123.
|- Name
ending_before- Type
- string
- Optional
- optional
- Description
A payment
idas a cursor for pagination. Returns payments listed before thisid. Ideal for navigating to previous pages.To access payments before
pay_abc789, useending_before=pay_abc789in your request, effectively fetching earlier payments up topay_abc789.
|
Request
curl -G https://api.taptree.org/v1/payments \
-H "Authorization: Bearer {token}" \
-d starting_after="pay_3ouMA9myA3" \
-d limit=20
Example response
{
"has_more": true,
"data": [
{
"object": "payment",
"id": "pay_3ouMA9myA3",
"org_id": "org_5A8hsNqGGyW",
"acceptor_id": "acceptor_Aa54Z3THuFj",
"status": "open",
"created_at": "2023-12-11T22:50:21.805Z",
"expires_at": "2023-12-11T23:10:21.805Z",
"mode": "test",
"description": "Updated order #12345",
"amount": {
"value": "15.00",
"currency": "eur"
},
"sequence_type": "one_off",
"capture_method": "automatic",
"return_url": "https://example.com/return",
"webhook_url": "https://example.com/webhook/endpoint",
"metadata": {
"customer_note": "Updated note"
},
// Other payment details
},
{
"object": "payment",
"id": "pay_2Xs7s4wm5kD",
// ...
},
// Additional payments
]
}