Source Resource

A Source is a resource to generate your customer's payment instrument. This is normally used to generate check out URLs for e-wallet payments. To learn more about e-wallet integrations, you can visit GCash or GrabPay integration.

A Source Resource

{
    "data": {
        "id": "src_1bLmj5BnqV2fCnM1SGGTdcrf",
        "type": "source",
        "attributes": {
            "amount": 10000,
            "billing": {
                "address": {
                    "city": "Taguig",
                    "country": "PH",
                    "line1": "9th Avenue and 26th Street, Unit 3308",
                    "line2": "High Street South Corporate Plaza Tower 2",
                    "postal_code": "1634",
                    "state": "Metro Manila"
                },
                "email": "[email protected]",
                "name": "Juan Dela Cruz",
                "phone": "09168268582"
            },
            "currency": "PHP",
            "livemode": false,
            "redirect": {
                "checkout_url": "https://test-sources.paymongo.com/sources?id=src_1bLmj5BnqV2fCnM1SGGTdcrf",
                "failed": "https://mysite.com/gcash/failed",
                "success": "https://mysite.com/gcash/success"
            },
            "status": "pending",
            "type": "gcash",
            "created_at": 1586192301,
            "updated_at": 1586192301
        }
    }
}

id string
Unique ID of the resource.


type string
Represents the resource type. Value is always source.


amount integer
amount to be authorized by the source. A positive integer with minimum amount of 10000. 10000 is the smallest unit in cents. If you want to receive an amount of 100.00, the value that you should pass is 10000. If you want to receive an amount of 1500.50, the value that you should pass is 150050. Take note that whenever you create a payment from a chargeable source, the source amount should match the Payment that you will create.


billing dictionary

AttributeDescription
address.city stringCity of the billing address information
address.country stringCountry of the billing address information. Possible values are ISO 3166-1 alpha-2 codes or two-letter country codes..
address.line1 stringLine1 of the billing address information
address.line2 stringLine2 of the billing address information
address.postal_code stringPostal Code of the billing address information
address.state stringState of the billing address information
email stringE-mail address of the billing information.
name stringName of the billing information.
phone stringPhone of the billing information.

currency string
Three-letter ISO currency code, in uppercase. PHP is the only supported currency as of the moment.


livemode boolean
The value is true if the resource exists in live mode or the value is false if the resource exists in test mode.


redirect dictionary

AttributeDescription
success stringURL to redirect the customer once authorization is successful.
failed stringURL to redirect the customer if the authorization encountered an error.

status string
Status of the Source. Possible values are pending, chargeable, cancelled, expired, and paid.


attributes.type string
The type of source. Possible values are gcash and grab_pay.



metadata dictionary
A set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the object in a structured format. Only string values are accepted.


created_at timestamp
The timestamp when the payment method has been created.


updated_at timestamp
The timestamp when the source has been updated.