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.
Successful response
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.
Successful response
{- "number": "number",
- "expiry_month": 0,
- "cvc": 1,
- "name": "name",
- "bank_name": "bank_name",
- "expiry_year": 6
}
{- "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.
Successful response
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": [
- {
- "package_id": 1,
- "package_price": 20,
- "sms_price": 0.099,
- "sms_quantity": 202,
- "voice_mobile_price": 0.99,
- "voice_mobile_quantity": 202,
- "voice_landline_price": 0.0583,
- "voice_landline_quantity": 343,
- "fax_price": 0.198,
- "fax_quantity": 101,
- "email_price": 0.033,
- "email_quantity": 606,
- "post_letter_black_price": 1.397,
- "post_letter_colour_price": 1.617,
- "post_page_black_price": 0.11,
- "post_page_colour_price": 0.264,
- "post_letter_black_quantity": 13,
- "post_letter_colour_quantity": 10,
- "post_direct_mail_dl_price": 0.44,
- "post_direct_mail_a5_price": 0.44,
- "post_direct_mail_min_quantity": 5000,
- "postcard_price": 11,
- "postcard_quantity": 1
}
], - "_currency": {
- "currency_name_short": "AUD",
- "currency_prefix_d": "$",
- "currency_prefix_c": "c",
- "currency_name_long": "Australian Dollars"
}
}
}
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.
Successful response
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.
Successful response
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": [
- {
- "invoice_number": "cb726c65-1c65-47fa-aea2-3ded9ed57557",
- "amount": 20,
- "currency": "AUD",
- "date": 1443420196
}, - {
- "invoice_number": "13d35606-5f10-4d31-9de4-065b025aa5b8",
- "amount": 20,
- "currency": "AUD",
- "date": 1443420094
}
]
}
}
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.
Successful response
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
}
}