Retrieve information about payments.
POST
request to /crm/v3/objects/commerce_payments
.
properties
object with values for the hs_initial_amount
and hs_initiated_date
properties. You can include other properties as needed. Note that some properties are read-only and cannot be set via the API.associations
array to set associations with other CRM records at the time of creation (e.g., contacts and orders).POST
request body below would create a payment with basic details that’s associated with a specific contact and order.
Field | Type | Description |
---|---|---|
properties | Object | An object containing key-value pairs for each property to set. |
associations | Array | An array containing association details. |
to | Object | An object containing the ID of the CRM record you want to associate the payment with. |
types | Array | An array containing association type details. |
associationCategory | String | The type of association (HUBSPOT_DEFINED or USER_DEFINED ). |
associationTypeId | Number | A unique identifier to indicate the association type between the payment and the other object. |
GET
request to crm/v3/objects/commerce_payments
.GET
request to the above URL and specify an payment ID. For example: crm/v3/objects/commerce_payments/44446244097
.POST
request to the search endpoint and to filter payments by property values.properties
query parameter in the request URL along with comma-separated property names. For example, making a GET
request to the following URL would result in the response below.
crm/v3/objects/commerce_payments?properties=hs_customer_email,hs_latest_status
POST
request that includes your filter criteria in the request body.
For example, to search for all refunded payments, you would make a POST
request to crm/v3/objects/commerce_payments/search
with the following request body.
filters
array specifies the search criteria, while the properties
array specifies which properties to return.
PATCH
request to /crm/v3/objects/commerce_payments/{paymentId}
. In the request body, include a properties
object containing the properties that you want to update.
For example, if you wanted to update a payment’s status from “processing” to “succeeded”, you could send the following request body.
DELETE
request to /crm/v3/objects/commerce_payments/{paymentId}
.
The payment will be moved to the recycling bin and can be restored within 90 days. After 90 days, the payment will be permanently deleted.
GET
request to /crm/v3/properties/commerce_payments
.
When managing your payment data, you can use the writeable properties in the tables below.
hs_currency_code
(enumeration): The currency code for the payment. Options will include the currencies configured for the account.hs_customer_email
(string): The buyer’s email address.hs_fees_amount
(number): The total amount HubSpot charged to process this payment.hs_initial_amount
(number): The total amount the customer was charged.hs_initiated_date
(datetime): The date the payment was initiated.hs_internal_comment
(string): An internal note/comment left by a user when creating an external payment record from an invoice.hs_latest_status
(enumeration): The most recently set payment status. Options include:
processing
succeeded
failed
partially_refunded
refunded
processing_refund
disputed_won
disputed_lost
disputed_action_required
disputed_awaiting_decision
hs_payment_method_bank_or_issuer
(string): The name of the bank or card issuer.hs_payment_method_last_4
(string): The last four digits of the payment method used.hs_payment_method_type
(enumeration): Depending on your location, the payment method the customer used. Options include:
card
ach
cash
check
wire_transfer
other
sepa
bacs
pads
hs_payout_date
(date time): The date a bank deposit associated with this payment was made.hs_processor_type
(enumeration): The processor used to collect the payment. Options include:
hs_payments
byo_stripe
none
quickbooks
xero
hs_reference_number
(string): The reference number associated with the external payment.hs_refunds_amount
(number): The total amount refunded to the customer.hs_billing_address_city
(string): The city for the payment method that the buyer used to make a payment.hs_billing_address_country
(string): The country for the payment method that the buyer used to make a payment.hs_billing_address_line_1
(string): The street address for the payment method that the buyer used to make a payment.hs_billing_address_line_2
(string): The apartment, unit number, or building for the payment method that the buyer used to make a payment. This is an optional field.hs_billing_address_state
(string): The state for the payment method that the buyer used to make a payment.hs_billing_address_zip
(string): The zip code for the payment method that the buyer used to make a payment.hs_line_item_discounts_amount
(number): The discount amount on the line items.hs_shipping_address_city
(string): The city of the shipping address associated with the payment.hs_shipping_address_country
(string): The country of the shipping address associated with the payment.hs_shipping_address_line_1
(string): The street address of the shipping address associated with the payment.hs_shipping_address_line_2
(string): The apartment, united number, or building of the shipping address associated with the payment.hs_shipping_address_state
(string): The state of the shipping address associated with the payment.hs_shipping_address_zip
(string): The zip code of the shipping address associated with the payment.hs_shipping_ship_to_name
(string): The person’s name associated with the payment.hs_digital_wallet_type
(enumeration): The type of digital wallet type used to create the payment. Options include:
apple_pay
google_pay
amex_express_checkout
link
masterpass
samsung_pay
visa_checkout
hs_fees_amount_in_settlement_currency
(number): The total amount HubSpot charged to process this payment in the settlement currency.hs_line_item_discounts_amount_in_portal_currency
(number): Line item discount amount in the account’s currency.hs_max_refundable_amount_in_portal_currency
(number): The maximum amount that can be refunded in the account’s default currency.hs_net_amount_in_settlement_currency
(number): The total amount you collected after fees in the settlement currency.hs_order_discount_code
(string): The discount code used.hs_order_discount_amount
(number): The discount amount on the order.hs_order_discount_percentage
(number): The discount percentage on the order.hs_payment_id
(string): The ID of the payment.hs_payment_method
(enumeration): How the customer made a payment, derived from an external source. Options depend on the payment methods enabled for your account.hs_payment_source_app
(enumeration): The source that created the payment. Options include:
SALES_CHECKOUT
QUOTE
INVOICE
MIGRATION
SUBSCRIPTION
hs_payment_source_id
(string): The ID of the source that created the payment.hs_payment_source_name
(string): The internal name of the source that created the payment.hs_payment_source_url
(string): The URL of the source that created the payment.hs_payment_type
(enumeration): The type of payment, the line item types on the payment (one_time_or_initial
or recurring
).hs_platform_fee
(number): The total amount charged to facilitate this payment.hs_platform_fee_in_portal_currency
(number): the total amount charged to facilitate this payment in the account’s default currency.hs_platform_fee_in_settlement_currency
(number): The total amount charged to facilitate this payment in the settlement currency.hs_refunds_amount_in_portal_currency
(number): The amount refunded in the account’s default currency.hs_settlement_currency_code
(enumeration): The currency code that the merchant’s payments will settle in. Options will include the currencies configured for the account.hs_total_discounts_amount
(number): The sum of all discounts on a payment collected from the buyer, including line-item and order discounts.associations
array. You can also use the associations API to update payments after creation.
You can associate payments with the following CRM objects:
389
387
391
428
1170
542
395
524
476
397
393
GET
request to /crm/v4/associations/commerce_payments/{toObjectType}/labels
.
PUT
request to /crm/v3/objects/commerce_payments/{paymentId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
. You can also use the associations API.
For example, to associate an existing payment with an existing order, you would make a PUT request to the following URL:
/crm/v3/objects/commerce_payments/{paymentId}/associations/order/{orderId}/523
To remove an association from an existing payment, make a DELETE
request to the following URL:
/crm/v3/objects/commerce_payments/{paymentId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
.
GET
request to:
crm/v3/objects/commerce_payments/{contactId}/associations/contact
This will return the IDs of the currently associated contact, along with meta information about the association type.
GET
request to crm/v3/objects/contacts/{contactId}