/v1/facilities/{facility_id}/payments/surcharge-quoteAuthentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest example
Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.
curl --request POST \
--url 'https://api.staging.facily.ai/v1/facilities/<FACILITY_ID>/payments/surcharge-quote' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"amount": 0,
"payment_method_id": "00000000-0000-4000-8000-000000000001"
}'Parameters
facility_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
amountnumber | stringrequiredThe BASE amount to be charged, before any surcharge. The surcharge is added on top of it.
Pattern: ^(?!^[-+.]*$)[+-]?0*(?:\d{0,8}|(?=[\d.]{1,11}0*$)\d{0,8}\.\d{0,2}0*$)
Show amount schema
number | stringThe BASE amount to be charged, before any surcharge. The surcharge is added on top of it.
Variant 1: number
numberVariant 2: string
stringpayment_method_idstringrequiredThe vaulted instrument that would be charged. Must belong to a tenant at this facility, or be a one-time card of this facility -- a method at another facility in the same org is not quoted, and answers surchargeable: false.
Format: uuid
Responses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"amount": "<VALUE_MATCHING_PATTERN>",
"surcharge_amount": "<VALUE_MATCHING_PATTERN>",
"surchargeable": false,
"total_charged": "<VALUE_MATCHING_PATTERN>",
"bin_type": "string",
"rate": "<VALUE_MATCHING_PATTERN>"
},
"meta": {
"request_id": "string"
}
}application/json
dataSurchargeQuoteResponserequiredThe processor's answer, shaped for a confirm step.
Show data schema
amountstringrequiredThe base amount the quote was taken for, echoed back.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
bin_typestring | nullHow the processor classifies the card: CREDIT, DEBIT or PREPAID. Null when not quoted.
Show bin_type schema
string | nullHow the processor classifies the card: CREDIT, DEBIT or PREPAID. Null when not quoted.
Variant 1: string
stringVariant 2: null
nullratestring | nullThe surcharge rate as a percent, for example 3.0 for 3%. Null when not quoted.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show rate schema
string | nullThe surcharge rate as a percent, for example 3.0 for 3%. Null when not quoted.
Variant 1: string
stringVariant 2: null
nullsurcharge_amountstringrequiredWhat the cardholder pays on top of the amount. 0.00 when no surcharge applies. Never part of the ledger.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
surchargeablebooleanrequiredTrue when a surcharge applies to this card at this amount. False is a normal answer.
total_chargedstringrequiredWhat the cardholder's statement will show: amount plus surcharge. Equal to amount when none applies.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
metaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired