Create a source
POST/v2/sources/
Creates a single use source that wraps the details of a credit card, wallet or bank account. These sources can only be used once: by creating a new charge object, or attaching them to a customer.
Request
- application/json
Body
required
Possible values: [card
, gcash
, paymaya
, wechat
, alipay
, unionpay
, grabpay
, instapay
, qrph
, bpi
, unionbank
, metrobank
, bdo
, pnb
, rcbc
]
An enumeration.
card
object
Possible values: non-empty
and <= 50 characters
, Value must match regular expression ^[A-Za-z0-9\s\'#_\.\-,]+$
Full name of cardholder
The 16-digit card number
Possible values: non-empty
and <= 2 characters
Expiration month of the card.
Possible values: >= 4 characters
and <= 4 characters
Four-digit number expiration year of the card.
Possible values: >= 3 characters
and <= 4 characters
The card’s security code.
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 <= 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 <= 255 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\'#_\.\-,]+$
redirect
object
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\'#_\.\-,]+$
Responses
- 200
- 422
Successful Response
- application/json
- Schema
- Example (from schema)
Schema
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
]
An enumeration.
card
object
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
Reference Id we used in connecting to debit api
Token's bank type
Specific bank's code
redirect
object
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.
{
"object": "source",
"id": "src_01786de4d9d69ad1369bfd56b098ccd9",
"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": {}
}
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"
}
]
}