latestOpenAPI 3.0.0Apache 2.02026-08-201250995.7 KB

bd9694db5fce

Charges

Create a Charge

Permissions needed: any of (CREATE_CHECKUPS, VIEW_COUNTER_SALE) Creates a new charge for a specific pet parent and clinic and returns it. surcharge is accepted only for DSP integrated saved card payments (when provider_data.payment_method_id is provided).

post/api/v1/charges

Query parameters

Additional info to include: mainSale,mainPayment,payments,chargeReceipt

Request body

clinic_idinteger

Clinic is on which pet parent is client on.

client_idinteger

Pet parent id

sale_idinteger

Id of sale to associate the charge to, if <i>as_credit</i> is <i>false</i> the sale will be paid first if there are multiple due sales and <i>amount</i> is greater than sale amount due

amountnumber float
type1 | 2 | 3 | 4 | 6 | 7

1 - Cash 2 - Card 3 - Order 6 - Check 7 - Other

card_brand'master_card' | 'visa' | 'american_express' | 'discover' | 'other' nullable
datestring date-time
notesstring nullable

Payment note

create_receiptboolean nullable
as_creditboolean

If true charge is not applied to due sales and is kept as client credit

surchargenumber float

Surcharge amount to be added to the charge total. Can be sent only for DSP integrated saved card payments (provider_data.payment_method_id).

Example request

{
  "clinic_id": 1234,
  "client_id": 234,
  "sale_id": 234,
  "amount": 100,
  "type": 2,
  "card_brand": "master_card",
  "provider_data": {
    "payment_method_id": "pm_123"
  },
  "date": "2020-01-01T00:00:00Z",
  "surcharge": 0.35
}

Response

Created