Skip to main content
POST
/
appointments
/
{appointmentId}
/
authorized
Authorize an appointment payment
curl --request POST \
  --url https://api.guile.app/appointments/{appointmentId}/authorized \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "amount": "456.78"
}
'
{
  "givenName": "<string>",
  "barber": {
    "id": "<string>",
    "givenName": "<string>",
    "surname": "<string>",
    "preferredName": "<string>",
    "biography": "<string>",
    "spokenLanguages": [
      "<string>"
    ],
    "experience": 50
  },
  "location": {
    "id": "<string>",
    "name": "<string>",
    "shopName": "<string>"
  },
  "services": [
    {
      "id": "<string>",
      "name": "<string>",
      "cost": "456.78",
      "duration": "<string>"
    }
  ],
  "occursOn": "2023-11-07T05:31:56Z",
  "duration": "<string>",
  "cost": "456.78",
  "id": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "totalAuthorized": "456.78",
  "totalCaptured": "456.78",
  "totalRefunded": "456.78",
  "surname": "<string>",
  "recurringAppointmentId": "<string>"
}

Headers

Idempotency-Key
string
required

A client-generated idempotency key to ensure operations are only processed once even if a client retries the operation. The V4 UUID format, as defined in RFC 4122, is recommended to avoid collisions but is not required.

Path Parameters

appointmentId
string
required

The unique, opaque system identifier for a resource. This case-sensitive ID is also used as path parameters in URLs or in other properties or parameters that reference a resource by ID rather than URL.

Body

application/json

Request body for authorizing an appointment payment.

amount
string<decimal>

The amount to authorize in USD. If not set, this amount is calculated based on barber settings and cannot exceed the total appointment cost.

Pattern: ^-?(0|[1-9][0-9]*)\.[0-9][0-9]$
Example:

"456.78"

Response

Ok. The operation succeeded.

A representation of an appointment.

givenName
string<text>
required

The given name of the customer.

Required string length: 1 - 55
barber
object
required

The barber for this appointment.

location
object
required

The location for this appointment.

services
object[]
required

The services for this appointment.

occursOn
string<date-time>
required

The date and time the appointment occurs on. This is expressed in RFC 3339 YYYY-MM-DDThh:mm:ss.sssZ date-time format in UTC time zone.

duration
string<duration>
required

The duration of the appointment. The value is an ISO 8601 duration string.

For example, an appointment lasting 30 minutes would be represented as PT30M.

cost
string<decimal>
required

The cost of the appointment, excluding any tips, fees or taxes.

Pattern: ^-?(0|[1-9][0-9]*)\.[0-9][0-9]$
Example:

"456.78"

id
string
required

The unique, opaque system identifier for a resource. This case-sensitive ID is also used as path parameters in URLs or in other properties or parameters that reference a resource by ID rather than URL.

createdAt
string<date-time>
required

The date-time when this resource was created, in RFC 3339 date-time YYYY-MM-DDThh:mm:ss.sssZ format, UTC. This is derived and immutable.

updatedAt
string<date-time>
required

The date-time when this resource was updated, in RFC 3339 date-time YYYY-MM-DDThh:mm:ss.sssZ format, UTC. This is derived and immutable.

state
enum<string>
required

The appointment state. This is derived and immutable.

Available options:
pending,
scheduled,
canceled,
completed
paymentState
enum<string>
required

The state state of the appointment. This is derived and immutable.

Available options:
pending,
authorized,
paid,
failed
totalAuthorized
string<decimal>
required

The sum amount of authorized payments for this appointment.

Pattern: ^-?(0|[1-9][0-9]*)\.[0-9][0-9]$
Example:

"456.78"

totalCaptured
string<decimal>
required

The sum amount of captured payments for this appointment.

Pattern: ^-?(0|[1-9][0-9]*)\.[0-9][0-9]$
Example:

"456.78"

totalRefunded
string<decimal>
required

The sum amount of refunded payments for this appointment.

Pattern: ^-?(0|[1-9][0-9]*)\.[0-9][0-9]$
Example:

"456.78"

surname
string<text>

The surname of the customer, if known.

Required string length: 1 - 55
recurringAppointmentId
string

The identifier of the recurring appointment this appointment belongs to, if any. This field is only present for appointments that are part of a recurring series.

cancelationFeeType
enum<string>

If included, the type of cancelation fee incurred. This is derived and immutable.

Available options:
lateCancelation,
noShow
paymentMethodSource
enum<string>

The payment source for this appointment. Only platform payments can be authorized through Guile; external payments, such as cash or peer-to-peer payments, cannot.

Available options:
platform,
external