OpenAPI Specification
openapi: 3.1.1
info:
title: Django instant-invoice-share instant-invoices API
description: The classical Django service that powers the marketplace and most invoicing functionality.
version: 2.0.0
servers:
- url: https://localhost
description: Development
- url: https://apiv2.sandbox.hitchpin.com
description: Sandbox
- url: https://apiv2.staging.hitchpin.com
description: Staging
- url: https://apiv2.demo.hitchpin.com
description: Demo
- url: https://apiv2.hitchpin.com
description: Production
tags:
- name: instant-invoices
description: Invoices created by a seller.
paths:
/instant-invoices/:
get:
operationId: list_instant_invoices
parameters:
- name: limit
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: offset
required: false
in: query
description: The initial index from which to return the results.
schema:
type: integer
tags:
- instant-invoices
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json; version=v2:
schema:
$ref: '#/components/schemas/PaginatedInstantInvoiceList'
description: ''
'404':
description: Not Found
post:
operationId: create_instant_invoices
parameters: []
tags:
- instant-invoices
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InstantInvoiceRequest'
required: true
security:
- tokenAuth: []
- cookieAuth: []
responses:
'201':
content:
application/json; version=v2:
schema:
$ref: '#/components/schemas/InstantInvoice'
description: ''
'404':
description: Not Found
/instant-invoices/{invoice_number}/:
get:
operationId: retrieve_instant_invoices
parameters:
- in: path
name: invoice_number
schema:
type: string
pattern: ^\d+$
required: true
examples:
InvoiceNumber:
value: '0004'
summary: Invoice Number
tags:
- instant-invoices
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json; version=v2:
schema:
$ref: '#/components/schemas/InstantInvoice'
description: ''
'404':
description: Not Found
/instant-invoices/{invoice_number}/revoke/:
delete:
operationId: void_instant_invoice
description: Action that allows the owner (seller) of an InstantInvoice to revoke it.
parameters:
- in: path
name: invoice_number
schema:
type: string
pattern: ^\d+$
required: true
examples:
InvoiceNumber:
value: '0004'
summary: Invoice Number
tags:
- instant-invoices
security:
- tokenAuth: []
- cookieAuth: []
responses:
'204':
description: Invoice revoked.
'400':
content:
application/json; version=v2:
schema:
type: object
description: Error response
properties:
detail:
type: string
required:
- detail
description: ''
'404':
content:
application/json; version=v2:
schema:
type: object
description: Error response
properties:
detail:
type: string
required:
- detail
description: ''
x-hp-src:
filename: /code/instant_invoicing/api.py
linespan:
start: 95
end: 111
container: InstantInvoiceViewSet
/instant-invoices/{invoice_number}/share/:
post:
operationId: share_instant_invoice
description: Action that allows the owner (seller) of an InstantInvoice to share it with a contact.
parameters:
- in: path
name: invoice_number
schema:
type: string
pattern: ^\d+$
required: true
examples:
InvoiceNumber:
value: '0004'
summary: Invoice Number
tags:
- instant-invoices
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InstantInvoiceRequest'
required: true
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json; version=v2:
schema:
$ref: '#/components/schemas/InstantInvoiceShare'
description: ''
'400':
content:
application/json; version=v2:
schema:
type: object
description: Error response
properties:
detail:
type: string
required:
- detail
description: ''
'404':
content:
application/json; version=v2:
schema:
type: object
description: Error response
properties:
detail:
type: string
required:
- detail
description: ''
x-hp-src:
filename: /code/instant_invoicing/api.py
linespan:
start: 112
end: 132
container: InstantInvoiceViewSet
components:
schemas:
ShareableInstantInvoice:
type: object
properties:
title:
type: string
invoice_number:
type: integer
maximum: 2147483647
minimum: -2147483648
total_owed:
type: integer
readOnly: true
for_name:
type: string
attachments:
type: array
items:
$ref: '#/components/schemas/Nested'
readOnly: true
sender:
type: string
readOnly: true
PaginatedInstantInvoiceList:
type: object
required:
- count
- results
properties:
count:
type: integer
example: 123
next:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?offset=400&limit=100
previous:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?offset=200&limit=100
results:
type: array
items:
$ref: '#/components/schemas/InstantInvoice'
InstantInvoiceRequest:
type: object
properties:
title:
type: string
principal:
type: integer
maximum: 9223372036854776000
minimum: -9223372036854776000
format: int64
for_name:
type: string
attachment_ids:
type: array
items:
type: integer
writeOnly: true
writeOnly: true
required:
- principal
Attachment:
type: object
properties:
id:
type: integer
readOnly: true
user:
type: integer
readOnly: true
attachment_type:
enum:
- document
- image
- text
type: string
description: '* `document` - Document (PDF)
* `image` - Image (jpg, png)
* `text` - Plain text'
x-spec-enum-id: 58640327c5314d15
image:
type: string
format: uri
document:
type: string
format: uri
text:
type: string
local_identifier:
type: string
maxLength: 256
show_in_library:
type: boolean
InstantInvoiceShare:
type: object
properties:
invoice:
allOf:
- $ref: '#/components/schemas/ShareableInstantInvoice'
readOnly: true
share_type:
enum:
- email
- sms
- link
- qr
- ''
type: string
description: '* `email` - Email
* `sms` - SMS
* `link` - Link
* `qr` - QR Code'
x-spec-enum-id: b538a5aac69dcfe7
share_hash:
type: string
readOnly: true
share_link:
type: string
readOnly: true
qr_code:
type: string
readOnly: true
is_paid:
type: boolean
readOnly: true
is_pending:
type: boolean
readOnly: true
expires:
type: string
format: date-time
readOnly: true
timestamp:
type: string
format: date-time
readOnly: true
updated:
type: string
format: date-time
readOnly: true
Nested:
type: object
properties:
id:
type: integer
readOnly: true
attachment_type:
enum:
- document
- image
- text
type: string
description: '* `document` - Document (PDF)
* `image` - Image (jpg, png)
* `text` - Plain text'
x-spec-enum-id: 58640327c5314d15
image:
type: string
format: uri
document:
type: string
format: uri
text:
type: string
local_identifier:
type: string
maxLength: 256
timestamp:
type: string
format: date-time
readOnly: true
updated:
type: string
format: date-time
readOnly: true
show_in_library:
type: boolean
user:
type: integer
required:
- user
InstantInvoice:
type: object
properties:
id:
type: integer
readOnly: true
title:
type: string
invoice_number:
type: integer
readOnly: true
principal:
type: integer
maximum: 9223372036854776000
minimum: -9223372036854776000
format: int64
for_name:
type: string
state:
enum:
- created
- shared
- pending
- paid
- canceled
type: string
description: '* `created` - Created
* `shared` - Shared
* `pending` - Pending
* `paid` - Paid
* `canceled` - canceled'
x-spec-enum-id: b6e03d05b730e433
readOnly: true
total_owed:
type: integer
readOnly: true
effective_seller_fee_percent:
type: string
format: decimal
pattern: ^-?\d{0,1}(?:\.\d{0,7})?$
readOnly: true
description: 'Do not edit directly. Equal to (coupons * settings.INVOICE_SELLER_FEE). '
total_seller_fee:
type: integer
readOnly: true
description: Amount of seller fee based on principal * effective_seller_fee_percent
is_paid:
type: boolean
readOnly: true
attachments:
type: array
items:
$ref: '#/components/schemas/Attachment'
readOnly: true
timestamp:
type: string
format: date-time
readOnly: true
updated:
type: string
format: date-time
readOnly: true
required:
- principal
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: sessionid
tokenAuth:
type: apiKey
in: header
name: Authorization
description: Token-based authentication with required prefix "Token"
x-speakeasy-retries:
strategy: backoff
backoff:
initialInterval: 500
maxInterval: 60000
maxElapsedTime: 3600000
exponent: 1.5
statusCodes:
- 5XX
retryConnectionErrors: true
x-hp-version:
branch: feature/2758-instant-invoicing-models
commit_id: 130543d53be424bc7d33903988ae0e57d9d1ec32
deploy_env: dev