Verify a charge
POST/v2/charges/:ch_id/verify
Verify Charge
Request
Path Parameters
- application/json
Body
required
Possible values: >= 5 characters
and <= 255 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Confirmation Id data from the provider
Possible values: non-empty
and <= 10 characters
OTP from the provider
Responses
- 200
- 422
Successful Response
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The type of object, in this case charge
A unique ID for this charge. usually starts with 'ch_', followed by an alphanumeric string.
The amount of the charge
The amount refunded
Whether an amount is authorized / held for future capturing.
Whether an authorized amount has been captured or not
3-letter ISO-code for currency.
The statement descriptor that will appear in the credit card statement
The description for this charge
source
object
required
String representing the object's type. Objects of the same type share the same value.
A unique ID for this source, usually starts with src_
, followed by an alphanumeric string.
Possible values: [card
, gcash
, paymaya
, wechat
, alipay
, unionpay
, grabpay
, instapay
, qrph
, bpi
, unionbank
, metrobank
, bdo
, pnb
, rcbc
]
The type of the source to create.
card
object
Card details of tokenized credit card.
String representing the object's type. Objects of the same type share the same value.
A unique ID for this card, usually starts with card_
, followed by an alphanumeric string.
Full name of cardholder
The last 4 digits of the credit card number
Expiration month of the card.
Four-digit number expiration year of the card.
bank_account
object
Bank details of the tokenized account.
Reference Id we used in connecting to debit api
Token's bank type
Specific bank's code
redirect
object
Information related to the redirect flow. Present if the source is authenticated by a redirect
Possible values: non-empty
and <= 2083 characters
The URL where we redirect after successful payment.
Possible values: non-empty
and <= 2083 characters
The URL where we redirect after failed payment.
Possible values: non-empty
and <= 2083 characters
The URL where we will call repeatedly, until a proper response was received.
owner
object
billing
object
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Full name of account holder
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 255 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 255 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 100 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
shipping
object
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Full name of account holder
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 255 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 255 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 100 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Possible values: <= 50 characters
Full name of account holder
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Whether this source has been securely saved for later reuse.
Whether this source has already been used.
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
Time at which the object was created in ISO 8601 format.
Time at which the object was updated in ISO 8601 format.
Default value: true
When set to false, attempt to do 3D secure authentication for credit card is bypassed and charge is immediately executed. This has no effect for vaulted cards.
Payment source owner details
Tells the next action the client needs to make. Generally used for credit card, bank or wallet authentication.
refunds
object[]
required
A list of refunds, if applicable
The type of object, in this case refund
A unique ID for this refund. usually starts with 're_', followed by an alphanumeric string.
The amount of the charge
3-letter ISO-code for currency.
Reason for the refund
The status of the refund
Time at which the object was created in ISO 8601 format.
Time at which the object was updated in ISO 8601 format.
The status of the charge
Will be true if the secret key used was the live key, false if the test key was used
Time at which the object was created in ISO 8601 format.
Latest time at which the object was updated in ISO 8601 format.
A dictionary that contains error response from the provider.
{
"object": "charge",
"id": "ch_0179504c16bddfe6bb8444581af5ae05",
"amount": 5000,
"amount_refunded": 0,
"authorized": false,
"captured": true,
"currency": "PHP",
"statement_descriptor": "Surf Rack",
"description": "1 hour surf lesson",
"source": {
"object": "source",
"id": "src_01786de4d9d69ad1369bfd56b098ccd9",
"type": "card",
"card": {
"object": "source",
"id": "card_01786e96b17d197aacd0de4e1f01ac5f",
"name": "Gerry Isaac",
"last4": "1112",
"exp_month": "12",
"exp_year": "2025",
"address_line1": "string",
"address_line2": "string",
"address_city": "string",
"address_state": "string",
"address_country": "string",
"address_zip": "string",
"brand": "string",
"country": "string",
"cvc_checked": "string",
"funding": "string",
"issuing_bank": "string"
},
"bank_account": {
"reference_id": "cus_123123123",
"bank_type": "BPI",
"bank_code": "magpiebpi",
"account_name": "",
"account_number": "",
"account_type": "",
"expires_at": "",
"metadata": {}
},
"redirect": {
"success": "https://magpie.im/?status=success",
"fail": "https://magpie.im/?status=failed",
"notify": "https://magpie.im/?status=notification"
},
"owner": {
"billing": {
"name": "Gerry Isaac",
"phone_number": "639175511222",
"email": "[email protected]",
"line1": "#123 JP Rizal St.",
"line2": "Brgy. Aguinaldo",
"city": "Quezon City",
"state": "Metro Manila",
"country": "PH",
"zip_code": "1100"
},
"shipping": {
"name": "Gerry Isaac",
"phone_number": "639175511222",
"email": "[email protected]",
"line1": "#123 JP Rizal St.",
"line2": "Brgy. Aguinaldo",
"city": "Quezon City",
"state": "Metro Manila",
"country": "PH",
"zip_code": "1100"
},
"name": "Gerry Isaac",
"address_country": "PH"
},
"vaulted": false,
"used": false,
"livemode": true,
"created_at": "2021-03-26T17:36:57.828847+08:00",
"updated_at": "2021-03-26T17:36:57.828847+08:00",
"metadata": {}
},
"require_auth": false,
"owner": {
"name": "John Doe",
"address_country": "PH"
},
"action": {
"type": "redirect_to_url",
"url": "https://api.magpie.im/v2/charges/auth/ra_0179082b7bf0afce5b5f7e445907198d/"
},
"refunds": [
{
"object": "refund",
"id": "re_0179ee1e0b12cb6430a04ee7ae103ee6",
"amount": 5000,
"currency": "PHP",
"reason": "Refund",
"status": "succeeded",
"created_at": "2021-04-12T13:55:54.194136+08:00",
"updated_at": "2021-04-12T13:55:54.194136+08:00"
}
],
"status": "succeeded",
"livemode": true,
"created_at": "2021-04-12T13:55:54.194136+08:00",
"updated_at": "2021-04-13T13:55:54.194136+08:00",
"metadata": {},
"failure_data": {
"code": "authentication_required",
"reason": "The card was declined as the transaction requires authentication.",
"next_steps": "The customer should try again and authenticate their card when prompted during the transaction.",
"provider_response": {}
}
}
Validation Error
- application/json
- Schema
- Example (from schema)
Schema
Array [
Array [
- MOD1
- MOD2
]
]
detail
object[]
loc
object[]
required
anyOf
string
integer
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}