Invoice API (1.0.0)

Download OpenAPI specification:Download

Invoice API

invoice

The Invoice API

Get a list of invoices

Get a list of invoices

SecurityApiKey
Request
query Parameters
offset
integer

The starting position for result paging

limit
integer

The maximum number of results to return. Maximum is 21

status
Array of strings

A list of invoice statuses to filter by

Items Enum: "unknown" "new" "processing" "completed" "failed" "waitingapproval" "pendingreview" "sent" "accepted" "rejected" "markedaspaid" "validated" "validatedandfailed"
invoiceNumber
string

The invoice number (RS TRANS#) of the invoice to get. If present, all other filters will be ignored.

fromDeletedAt
string <date-time>

The lower bound of the deleted date range. Only invoices deleted after this date will be included in the response. Provide the date and time in ISO 8601 format (e.g., "2023-06-15T09:30:00Z").

toDeletedAt
string <date-time>

The upper bound of the deleted date range. Only invoices deleted before this date will be included in the response. Provide the date and time in ISO 8601 format (e.g., "2023-06-15T09:30:00Z").

fromAuthorizedAt
string <date-time>

The lower bound of the authorized date range. Only invoices authorized after this date will be included in the response. Provide the date and time in ISO 8601 format (e.g., "2023-06-15T09:30:00Z").

toAuthorizedAt
string <date-time>

The upper bound of the authorized date range. Only invoices authorized before this date will be included in the response. Provide the date and time in ISO 8601 format (e.g., "2023-06-15T09:30:00Z").

customField
string

Custom Field name and value (stringified object with the structure of '{name:name,value:value}') of the invoice to get.

Responses
200

Success

default

Error Response

get/
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

Create an invoice

Create an invoice.

SecurityApiKey
Request
Request Body schema: application/json
companyId
required
string

The RoadSync ID of the company creating the invoice

locationId
required
string

The RoadSync ID of the location creating the invoice

required
Array of objects (LineItem)
name
required
string

The payer's name

email
string

The payer's email address. Either email or phone is required.

phone
string

The payer's phone number. Either phone or email is required.

description
string

Optional description of the invoice

comments
string

Optional comments that will be added to the invoice and receipt.

customFields
object

Values for fields configured for the current location. These can be configured to be required.

shiftId
string

The employee shift when the invoice is being created. Required if the location has at least one shift configured.

storeCardOnFile
boolean

Option to save the card for future invoice payments

Responses
201

Created

default

Error Response

post/
Request samples
application/json
{
  • "locationId": "O8MqwQ1X3L5Ryax4OanNK2lGxerYA8",
  • "companyId": "2POMkDK9LZNw3BP0GBGoExejWylYq0",
  • "lineItems": [
    ],
  • "phone": "4041231234",
  • "email": "testuser@roadsync.com",
  • "name": "John Doe",
  • "customFields": {
    },
  • "shiftId": "kNbRqo6QJjLnxa75yBPzpDZ193MlmA",
  • "comments": "These are the comments"
}
Response samples
application/json
{
  • "data": {
    }
}

Get an invoice

Get an invoice.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

Responses
200

Success

default

Error Response

get/{id}
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Update invoice fields

Update invoice fields. Only the passed in fields will be updated on the invoice.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

Request Body schema: application/json
Array of objects (LineItem)
name
string

The payer's name

email
string

The payer's email address

phone
string

The payer's phone number

description
string

Optional description of the invoice

comments
string

Optional comments that will be added to the invoice and receipt.

Responses
200

Success

default

Error Response

patch/{id}
Request samples
application/json
{
  • "lineItems": [
    ],
  • "name": "string",
  • "email": "string",
  • "phone": "string",
  • "description": "string",
  • "comments": "string"
}
Response samples
application/json
{
  • "data": {
    }
}

Send an invoice to a recipient

Send a URL to view the invoice and make payment through Remote Checkout.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

Request Body schema: application/json
email
string

The email address to send the URL to

phone
string

The phone number to SMS the URL to

Responses
204

Success

default

Error Response

post/{id}/send
Request samples
application/json
{
  • "email": "string",
  • "phone": "string"
}
Response samples
application/json
{
  • "errors": [
    ]
}

Void an invoice

Void an invoice.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

Request Body schema: application/json
reason
string

The reason the invoice is being voided.

Enum: "requestedbycustomer" "incorrectamount" "prepaidcontract" "duplicate" "fraudulent" "alternate" "driverleft" "unabletoservice" "unknown"
Responses
204

Success

default

Error Response

post/{id}/void
Request samples
application/json
{
  • "reason": "requestedbycustomer"
}
Response samples
application/json
{
  • "errors": [
    ]
}

Clone an invoice

Creates a clone of the specified invoice.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

Responses
201

Success

default

Error Response

post/{id}/clone
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Refund the payment for an invoice

Refund the specified amount for a paid invoice. This can only be done for invoices that were paid by credit card.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

Request Body schema: application/json
amount
number

The amount to refund. This can not be greater than the total invoice amount.

Responses
204

Success

default

Error Response

post/{id}/refund
Request samples
application/json
{
  • "amount": 0
}
Response samples
application/json
{
  • "errors": [
    ]
}

Attach a file to an invoice

Attach a file to an invoice. Must be in PDF, PNG, or JPG format.

SecurityApiKey
Request
path Parameters
id
required
string

The id of the invoice.

query Parameters
attachmentName
string

The name of the file to attach

Request Body schema:
string <binary>
Responses
201

Uploaded

default

Error Response

post/{id}/attach
Request samples
Response samples
application/json
{
  • "errors": [
    ]
}
Copyright © RoadSync 2023. All right reserved.