URL
/host/pgw/api/payment-method/update
Method:
POST
Header params
An authentication token is required to prevent unauthorized access to protected data.
Required:
-> auth_token=[string]
- authorization token
-> content-type
- application/json
URL Params
Api will consume query and data params.
Required (Query params):
id=[string]
- payment method id (also known as pm_alias)
POST Params
Required:
-> expiry_date=[YYYY-MM]
- expiration date in format YYYY-MM
Example request
Curl:
curl -X POST \
'https://mobile.webteh.hr/pgw/api/payment-method/update?id=xoAVCN1-4nzfgOP6uKlH6LWgZXYuk7IY4kJ8JxYa' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: ae263b8b-59b3-44bc-be19-ca49bf59dbdb' \
-H 'auth_token: 00001111222233330000111122223333' \
-d '{
"expiry_date": "2018-07"
}'
Success Response:
Response is successful:
Response contains: status: string
and payment_method:{pm_alias, expiration_date}
Code: 200
Content:
{
"status": "updated",
"payment_method": {
"pm_alias": "xoAVCN1-4nzfgOP6uKlH6LWgZXYuk7IY4kJ8JxYa",
"expiration_date": "1807"
}
}
Error Response:
Error response can occur in scenarios:
- Wrong or missing auth token
- Code:
401 UNAUTHORIZED
- Invalid input (expiry_date in past, not provided, etc)
- Code:
422 Unprocessable entity
- Response:
{
"status": "not_updated",
"message": "Validation failed",
"errors": [
"Expiration date in past"
]
}