-
Notifications
You must be signed in to change notification settings - Fork 0
My API documentation writing sample
This is Kfir's API technical writing portfolio.
What is Stripe;
What is this API all about;
Use this API for X purpose, i.e. financial services of online store;
To connect to the Stripe API, you need to use the https://api.stripe.com base url.
You also need to register for an account on stripe.com, to be able to get full access.
Go to the Stripe website.
Search for "API Keys."
Go to Developers > API Keys.
Copy the hidden secret key.
Note that Stripe API supports various types of authentication, like Bearer: "Authentication: Bearer sk_test_51OeymSI4kExMG4nltVyfmFoNoX0sM8x6EoFHUWiVOKNGW4nrQgWpgEsmuHP2OjqEQAOyifV8nkkbF8fIiA2jqV5Y00p66DUJs0"
Explain the requests that the developer may use and what he can expect as responses. 200: OK 400: Bad Request
Explain to the developer what he can do with the Stripe API:
As a developer you can use the Stripe API to:
- Check balance of a credit card
You can use the balance request to find out what the available expense amount on a particular credit card is.
A GET operation is possible only for this request!
The endpoint for this operation is:
{{baseUrl}}/v1/balance
Responses will return standard codes.
Response code 200: OK
{
"object": "balance",
"available": [
{
"amount": 0,
"currency": "usd",
"source_types": {
"card": 0
}
}
],
"livemode": false,
"pending": [
{
"amount": 0,
"currency": "usd",
"source_types": {
"card": 0
}
}
]
}
Parameter1:
This is when you should use it;
This is the type of the parameter (Int, String, etc);
This is an optional/mandatory parameter;
This parameter has/does not have prefixed values;
This is an example of the use of this parameter;
etc
Parameter1 response
Response code 400: Bad Request
{
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameter: hahaha",
"param": "hahaha",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_KgXeaZp4oefYbl?t=1708168678",
"type": "invalid_request_error"
}
}