Payments

  1. List payments
  2. Search payments
  3. Get a single payment
  4. Create a new payment
  5. Update a payment
  6. Cancel a payment

Parameters

Name Type Read/Write Description
id Integer Read Payment’s id.
order_id String Read Id of order (only for instant bookings managed by Bookingsync)
transaction_id String Read/Write Id of paypal transaction.
address1 String Read/Write Payer’s first address. (100 characters max)
address2 String Read/Write Payer’s second address. (100 characters max)
amount_in_cents Integer Read/Write Required. Payment’s value.
card String Read/Write Payment’s card number, only the last 4 digits are visible. (example: "XXXX-XXXX-XXXX-1234").
city String Read/Write Payer’s city. (100 characters max)
country_code String Read/Write Payer’s country code, list of codes is available at wikipedia.
currency String Read/Write Payment’s currency code, list of codes described in enums section.
description String Read. Combined descriptions of all booking payments (if managed by Bookingsync).
kind String Read/Write Required. Payment’s kind, list of kinds described in enums section.
email String Read/Write Payer’s email.
fullname String Read/Write Payer’s fullname.
ip String Read Payer’s ip.
locale String Read/Write Payer’s preferred locale, list of locales described in enums section.
notes Text Read/Write Payment’s additional information.
state String Read/Write Payer’s state. (100 characters max, required if country_code set to US)
test Boolean Read Payment’s test status.
zip String Read/Write Payer’s zip code. (10 characters max)
created_at Time Read Payment’s create time.
updated_at Time Read Payment’s update time.
rejected_at Time Read Payment’s reject time.
canceled_at Time Read Payment’s cancel time.
paid_at Time Read/Write Payment’s issue time.
Name Type Read/Write Description
id Integer Read Payment’s id.
order_id String Read Id of order (only for instant bookings managed by Bookingsync)
transaction_id String Read Id of paypal transaction.
address1 String Read Payer’s first address.
address2 String Read Payer’s second address.
amount_in_cents Integer Read Payment’s value.
card String Read Payment’s card number, only the last 4 digits are visible. (example: "XXXX-XXXX-XXXX-1234").
city String Read Payer’s city.
country_code String Read Payer’s country code, list of codes is available at wikipedia.
currency String Read Payment’s currency code, list of codes described in enums section.
description String Read. Combined descriptions of all booking payments (if managed by Bookingsync).
kind String Read Payment’s kind, list of kinds described in enums section.
email String Read Payer’s email.
fullname String Read Payer’s fullname.
ip String Read Payer’s ip.
locale String Read Payer’s preferred locale, list of locales described in enums section.
notes Text Read Payment’s additional information.
state String Read Payer’s state.
test Boolean Read Payment’s test status.
zip String Read Payer’s zip code.
created_at Time Read Payment’s create time.
updated_at Time Read Payment’s update time.
rejected_at Time Read Payment’s reject time.
canceled_at Time Read Payment’s cancel time.
paid_at Time Read Payment’s issue time.
Name Type Read/Write Description
id Integer Read Payment’s id.
order_id String Read Id of order (only for instant bookings managed by Bookingsync)
transaction_id String Read/Write Id of paypal transaction.
address1 String Read/Write Payer’s first address. (100 characters max)
address2 String Read/Write Payer’s second address. (100 characters max)
amount_in_cents Integer Read/Write Required. Payment’s value.
card String Read/Write Payment’s card number, only the last 4 digits are visible. (example: "XXXX-XXXX-XXXX-1234").
city String Read/Write Payer’s city. (100 characters max)
country_code String Read/Write Payer’s country code, list of codes is available at wikipedia.
currency String Read/Write Payment’s currency code, list of codes described in enums section.
description String Read. Combined descriptions of all booking payments (if managed by Bookingsync).
kind String Read/Write Required. Payment’s kind, list of kinds described in enums section.
email String Read/Write Payer’s email.
fullname String Read/Write Payer’s fullname.
ip String Read Payer’s ip.
locale String Read/Write Payer’s preferred locale, list of locales described in enums section.
notes Text Read/Write Payment’s additional information.
state String Read/Write Payer’s state. (100 characters max, required if country_code set to US)
test Boolean Read Payment’s test status.
zip String Read/Write Payer’s zip code. (10 characters max)
created_at Time Read Payment’s create time.
updated_at Time Read Payment’s update time.
rejected_at Time Read Payment’s reject time.
canceled_at Time Read Payment’s cancel time.
paid_at Time Read/Write Payment’s issue time.

List payments

List all payments for a given account.

GET /payments

Response

{
  "links": {
    "payments.account": "https://www.bookingsync.com/api/v3/accounts/{payments.account}",
    "payments.bookings": "https://www.bookingsync.com/api/v3/bookings/{payments.bookings}",
    "payments.bookings_payments": "https://www.bookingsync.com/api/v3/bookings_payments/{payments.bookings_payments}"
  },
  "payments": [
    {
      "id": 2,
      "address1": "Bernhard Creek",
      "address2": null,
      "amount_in_cents": 100000,
      "card": null,
      "city": "East Winifred",
      "country_code": "US",
      "currency": "USD",
      "description": "Payment for Awesome Rental from Friday 01 Jun 2017, 04:00 PM to Friday 8 Jun 2017, 10:00 AM",
      "email": "john@example.com",
      "fullname": "John Doe",
      "ip": "192.0.2.1",
      "kind": "cash",
      "locale": "en",
      "notes": null,
      "order_id": null,
      "state": "Monatana",
      "test": null,
      "transaction_id": null,
      "zip": "07671-8254",
      "created_at": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "rejected_at": null,
      "canceled_at": null,
      "paid_at": "2017-11-09T09:08:17Z",
      "links": {
        "account": 33,
        "bookings": [
          21
        ],
        "bookings_payments": [
          3
        ]
      }
    }
  ]
}

Search payments

Search parameters allow to filter payments by specified fields.

Example:

GET /payments?order_id=BS-abc-123

Search Parameters

Name Type Description
order_id String List of comma separated IDs. Returns only payments with this order_id(s)

Get a single payment

Returns a single payment identified by ID.

GET /payments/:payment_id

Response

{
  "links": {
    "payments.account": "https://www.bookingsync.com/api/v3/accounts/{payments.account}",
    "payments.bookings": "https://www.bookingsync.com/api/v3/bookings/{payments.bookings}",
    "payments.bookings_payments": "https://www.bookingsync.com/api/v3/bookings_payments/{payments.bookings_payments}"
  },
  "payments": [
    {
      "id": 2,
      "address1": "Bernhard Creek",
      "address2": null,
      "amount_in_cents": 100000,
      "card": null,
      "city": "East Winifred",
      "country_code": "US",
      "currency": "USD",
      "description": "Payment for Awesome Rental from Friday 01 Jun 2017, 04:00 PM to Friday 8 Jun 2017, 10:00 AM",
      "email": "john@example.com",
      "fullname": "John Doe",
      "ip": "192.0.2.1",
      "kind": "cash",
      "locale": "en",
      "notes": null,
      "order_id": null,
      "state": "Monatana",
      "test": null,
      "transaction_id": null,
      "zip": "07671-8254",
      "created_at": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "rejected_at": null,
      "canceled_at": null,
      "paid_at": "2017-11-09T09:08:17Z",
      "links": {
        "account": 33,
        "bookings": [
          21
        ],
        "bookings_payments": [
          3
        ]
      }
    }
  ]
}

Create a new payment

Returns a newly created payment.

POST /bookings/:booking_id/payments

Example JSON request

{
  "payments": [
    {
      "address1": "Bernhard Creek",
      "address2": null,
      "amount_in_cents": 100000,
      "city": "East Winifred",
      "country_code": "US",
      "currency": "GBP",
      "email": "john@example.com",
      "fullname": "John Doe",
      "kind": "cash",
      "locale": "en",
      "state": "Monatana",
      "zip": "07671-8254",
      "paid_at": "2017-11-09T09:08:17Z"
    }
  ]
}

Response

{
  "links": {
    "payments.account": "https://www.bookingsync.com/api/v3/accounts/{payments.account}",
    "payments.bookings": "https://www.bookingsync.com/api/v3/bookings/{payments.bookings}",
    "payments.bookings_payments": "https://www.bookingsync.com/api/v3/bookings_payments/{payments.bookings_payments}"
  },
  "payments": [
    {
      "id": 2,
      "address1": "Bernhard Creek",
      "address2": null,
      "amount_in_cents": 100000,
      "card": null,
      "city": "East Winifred",
      "country_code": "US",
      "currency": "USD",
      "description": "Payment for Awesome Rental from Friday 01 Jun 2017, 04:00 PM to Friday 8 Jun 2017, 10:00 AM",
      "email": "john@example.com",
      "fullname": "John Doe",
      "ip": "192.0.2.1",
      "kind": "cash",
      "locale": "en",
      "notes": null,
      "order_id": null,
      "state": "Monatana",
      "test": null,
      "transaction_id": null,
      "zip": "07671-8254",
      "created_at": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "rejected_at": null,
      "canceled_at": null,
      "paid_at": "2017-11-09T09:08:17Z",
      "links": {
        "account": 33,
        "bookings": [
          21
        ],
        "bookings_payments": [
          3
        ]
      }
    }
  ]
}

Update a payment

Returns an updated payment identified by ID.

PUT /payments/:payment_id

Example JSON request

{
  "payments": [
    {
      "address1": "Bernhard Creek",
      "address2": null,
      "amount_in_cents": 100000,
      "city": "East Winifred",
      "country_code": "US",
      "currency": "GBP",
      "email": "john@example.com",
      "fullname": "John Doe",
      "kind": "cash",
      "locale": "en",
      "state": "Monatana",
      "zip": "07671-8254",
      "paid_at": "2017-11-09T09:08:17Z"
    }
  ]
}

Response

{
  "links": {
    "payments.account": "https://www.bookingsync.com/api/v3/accounts/{payments.account}",
    "payments.bookings": "https://www.bookingsync.com/api/v3/bookings/{payments.bookings}",
    "payments.bookings_payments": "https://www.bookingsync.com/api/v3/bookings_payments/{payments.bookings_payments}"
  },
  "payments": [
    {
      "id": 2,
      "address1": "Bernhard Creek",
      "address2": null,
      "amount_in_cents": 100000,
      "card": null,
      "city": "East Winifred",
      "country_code": "US",
      "currency": "USD",
      "description": "Payment for Awesome Rental from Friday 01 Jun 2017, 04:00 PM to Friday 8 Jun 2017, 10:00 AM",
      "email": "john@example.com",
      "fullname": "John Doe",
      "ip": "192.0.2.1",
      "kind": "cash",
      "locale": "en",
      "notes": null,
      "order_id": null,
      "state": "Monatana",
      "test": null,
      "transaction_id": null,
      "zip": "07671-8254",
      "created_at": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "rejected_at": null,
      "canceled_at": null,
      "paid_at": "2017-11-09T09:08:17Z",
      "links": {
        "account": 33,
        "bookings": [
          21
        ],
        "bookings_payments": [
          3
        ]
      }
    }
  ]
}

Cancel a payment

Required OAuth scope: :payments_write_owned or :payments_write

Returns an empty response with ‘204 No Content’ status code on success.

DELETE /payments/:payment_id