Endpoints associated with creating and managing user accounts.
Endpoints associated with creating and managing user accounts.
Get current payment info
This endpoint returns your current payment info, we do not store credit card numbers, only a card token for security reasons.
Refer to Status Codes for definitions of HTTP status code responses.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
'https://rest.clicksend.com/v3/recharge/credit-card'
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Customer payment info.", "data": { "display_number": "XXXX-XXXX-XXXX-0000", "expiry_month": 1, "expiry_year": 2020, "name": "Roland Robot" } }
Update credit card info
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
number | string | true | none | Credit card number |
expiry_month | integer(int32) | true | none | Expiry month of credit card |
expiry_year | integer(int32) | true | none | Expiry year of credit card |
cvc | integer(int32) | true | none | CVC number of credit card |
name | string | true | none | Name printed on credit card |
bank_name | string | true | none | Name of bank that credit card belongs to |
Refer to Status Codes for definitions of HTTP status code responses.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
--request PUT \
--header "Content-Type: application/json" \
--data-binary " {
\"number\":\"5520000000000000\",
\"expiry_month\":\"05\",
\"expiry_year\":\"2016\",
\"cvc\":\"123\",
\"name\":\"Roland Robot\",
\"bank_name\": \"Robotic Banking\"
}" \
'https://rest.clicksend.com/v3/recharge/credit-card'
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Your payment info has been updated.", "data": { "token": "cus_6Z3mHM9QvQQoJ28WsIWuLA" } }
Get list of all packages
Parameter | In | Type | Required | Description |
---|---|---|---|---|
country | query | string | false | Two-letter country code (ISO3166) |
Refer to Status Codes for definitions of HTTP status code responses.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
'https://rest.clicksend.com/v3/recharge/packages?country={country}'
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "List of Packages.", "data": { "packages": [ … ], "_currency": { … } } }
Purchase a package
Parameter | In | Type | Required | Description |
---|---|---|---|---|
package_id | path | integer(int32) | true | ID of package to purchase |
Refer to Status Codes for definitions of HTTP status code responses.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
--request PUT \
'https://rest.clicksend.com/v3/recharge/purchase/{package_id}'
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Successfully purchased a package", "data": { "user_id": 1, "amount": 50, "currency": "USD", "amount_aud": 61.86, "date": 1481610495 } }
Purchase a package
Get all transactions
Parameter | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer(int32) | false | Page number |
limit | query | integer(int32) | false | Number of records per page |
Refer to Status Codes for definitions of HTTP status code responses.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
'https://rest.clicksend.com/v3/recharge/transactions'
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are your transactions.", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 2, "data": [ … ] } }
Get specific Transaction
Parameter | In | Type | Required | Description |
---|---|---|---|---|
transaction_id | path | string | true | ID of transaction to retrieve |
Refer to Status Codes for definitions of HTTP status code responses.
curl --include \
--header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \
'https://rest.clicksend.com/v3/recharge/transactions/{transaction_id}'
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your transaction.", "data": { "invoice_number": "cb726c65-1c65-47fa-aea2-3ded9ed57557", "amount": 20, "currency": "AUD", "date": 1443420196 } }