Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

freight-hub/api-standards

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

api-standards

This is Freighthub API guidelines, forked from PayPal

You can find the actual guidelines here

You can find examples and patterns here

You can find the list of references here

You can find the JSON schema spec here

TL;DR

Paths: kebab case and plurals βœ… purchase-orders 🚫purchaseOrder, purchaseOrders, purchase_orders

Query Params: camelCase βœ… customerID 🚫customer-id, customer_id, customerId

Path Params: camelCase βœ… customerID 🚫customer-id, customerId

Headers: Pascal-Case, no X- for custom headers βœ… API-Key 🚫api-key, apiKey, X-API-Key

Responses: must be an object with camelCase properties βœ… customerID, id 🚫customer-id,customerId, _id

Pagination: must take page and pageSize parameters and response must contains a property items and should contain totalItems for the respones (also accepted is totalPages)

Sorting: should take a sort parameter following the pattern {field_name}|{asc|desc} where {field_name} is a property of the resource βœ… createdAt|asc,activatedAt|desc

Enums: must be camcelCase βœ… green, blue, blueGreen 🚫 BLUE, blue_green

Acronyms: must be all lower or all upper case βœ… HTTP, API, HTTPHeader, { "httpHeader": "" }, { "id": 1 } 🚫 Http, Api

About

The API standards and guidelines forked from Paypal

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published