API Introduction
API Introduction
Authentication
sk_test_/pk_test
and live mode keys have the prefix sk_live_/pk_live
.Test domain: https://apitest.wooshpay.com
Live domain: https://api.wooshpay.com
Error
2xx
success status codes confirm that your request worked as expected4xx
error status codes indicate an error because of the information provided (for example, a required parameter was omitted)5xx
error status codes are rare and indicate an error with internal serversHttp Satus | Description |
---|---|
200 - OK | Everything worked as expected. |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 - Unauthorized | No valid API key provided. |
402 - Request Failed | The parameters were valid but the request failed. |
403 - Forbidden | The API key doesn't have permissions to perform the request. |
404 - Not Found | The requested resource doesn't exist. |
409 - Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
429 - Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
500, 502, 503, 504 - Server Errors | Something went wrong on internal end. |
Error Types and Code
Error Types | Description |
---|---|
api_error | API errors cover any other type of problem (e.g., a temporary problem with internal servers), and are extremely uncommon. |
card_error | Card errors are the most common type of error you should expect to handle. They result when the user enters a card that can't be charged for some reason. |
idempotency_error | Idempotency errors occur when an Idempotency-Key is re-used on a request that does not match the first request's API endpoint and parameters. |
invalid_request_error | Invalid request errors arise when your request has invalid parameters. |
Error Object
Field | Type | Desc |
---|---|---|
type | string | One of api_error, card_error, idempotency_error, or invalid_request_error |
code | string | For some errors that could be handled programmatically, a short string indicating the error code reported. |
decline_code | string | For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one. |
message | string | A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. |
param | string | If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. |
payment_intent | object | The PaymentIntent object for errors returned on a request involving a PaymentIntent. |
charge | string | For card errors, the ID of the failed charge. |
Errors Example
{
"error": {
"message": "You did not provide an API key. ",
"type": "invalid_request_error"
}
}
Expanding Responses
expand
request parameter. This parameter is available on all API requests, and applies to the response of that request only. Responses can be expanded in two ways.expand
param on any endpoint which returns expandable fields, including list, create, and update endpoints.data
property. For example, you would expand data.customers
on a request to list charges and associated customers. Many deep expansions on list requests can be slow.expand
array.
{
"id": "pi_3KCKoxL6kclEVx6M0kQ4ETTl",
"object": "payment_intent",
"amount": 1400,
....
"payment_method": {
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
....
},
....
}
Idempotent Requests
Idempotency-Key
element to the request options.500
errors.POST
requests accept idempotency keys. Sending idempotency keys in GET
and DELETE
requests has no effect and should be avoided, as these requests are idempotent by definition.
Pagination
limit
, starting_after
, and ending_before
.starting_after
and ending_before
parameters. Both parameters take an existing object ID value (see below) and return objects in reverse chronological order. The ending_before
parameter returns objects listed before the named object. The starting_after
parameter returns objects listed after the named object. These parameters are mutually exclusive -- only one of starting_after
or**ending_before
** may be used.Request IDs
Request-Id
. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.Access Rate Limit
429
. We have several limiters in the API, including: