The POST /payments call allows your platform to create a new payment. For platforms on blended rate pricing leveraging the Clear product, remember to appropriately calculate fees. To try this request out in the console, update the following parameters with your own information: App-Id, App-Token, Unique-Key, payment_method.
amount required | integer >= 100 Amount in the lowest denomination. For example, $1.00 is represented as 100. This applies to all currencies WePay supports. | ||||||
currency required | string ISO 4217 currency code. Possible values include:
| ||||||
account_id required | string Merchant's account id associated with the payment. | ||||||
required | object The payment method used to create this payment.Note: The payment method's top level data object corresponds with the payment method type. For example, if you set type to | ||||||
auto_capture | boolean For payments with a credit card payment method, set to | ||||||
capture_at | integer or null Designate the time at which this payment will capture using a UNIX epoch timestamp. The capture time cannot be more than 7 days in the future. Note that epoch timestamps use the UTC timezone. | ||||||
object or null Any custom data your platform chooses to attach to this resource. The custom data must be key-value pairs and not contain any personally identifiable information (PII) or payment card (PCI) data. | |||||||
fee_amount | integer >= 0 Specifies the fee amount your platform will collect from the payment. The amount should be in the lowest denomination. For example, $1.00 is represented as 100. This applies to all currencies WePay supports. Note: The upper limit for the fee amount is 20% of the payment. If this field is blank and the merchant is on blended pricing, $0 will be debited from the merchant and credited to your platform account, but WePay’s fees will still be debited from your platform account. Remember to appropriately calculate fees. Payments for merchants on MIC+ should leave this field blank as fees are assessed monthly rather than per transaction. If any number other than 0 is passed it will be ignored, and 0 will be applied and returned. | ||||||
fee_type | string Specifies the fee type your platform will use to collect fee from the payment.
| ||||||
initiated_by | string Indicates who initiated a payment. Possible values include:
| ||||||
object | |||||||
order_id | string or null [ 1 .. 255 ] characters The resource ID of the order that your app associated with this payment. If no order was associated, then the value will be | ||||||
Array of objects or null Any rbit data your platform chooses to attach to this resource. The rbit data must be key-value pairs and can be an array of rbit objects. | |||||||
reference_id | string or null [ 1 .. 255 ] characters A custom reference ID for your platform to track the object. It can be any string. |
INVALID_PARAMS, MERCHANT_ACCOUNT_CANNOT_ACCEPT_PAYMENTS, TRANSACTION_DECLINED, UNSUPPORTED_CURRENCY
NOT_AUTHORIZED
UNEXPECTED_ERROR
{- "account_id": "abc123",
- "amount": 1000,
- "auto_capture": true,
- "fee_type": "rent_surcharge",
- "currency": "USD",
- "custom_data": {
- "my_key": "invoice #54321"
}, - "fee_amount": 30,
- "payment_method": {
- "credit_card": {
- "auto_update": false,
- "card_holder": {
- "address": {
- "city": "Redwood City",
- "country": "US",
- "line1": "350 Convention Way",
- "postal_code": "94025",
- "region": "CA"
}, - "email": "example@wepay.com",
- "holder_name": "John Snow"
}, - "card_number": "5496198584584769",
- "cvv": "007",
- "expiration_month": 4,
- "expiration_year": 2030,
- "virtual_terminal_mode": "web",
- "card_on_file": true,
- "recurring": false
}, - "custom_data": {
- "my_key": "invoice #54321"
}, - "type": "credit_card"
}, - "initiated_by": "customer",
- "reference_id": "dfeb052b-ae8c-4a69-b909-8d9ecdd7c742"
}
{- "amount": 1000,
- "amount_refunded": 1000,
- "amount_disputed": 1000,
- "fee_type": "rent_surcharge",
- "auto_capture": false,
- "capture_at": null,
- "create_time": 1510080179,
- "currency": "USD",
- "custom_data": null,
- "failure_reason": null,
- "fee_amount": 0,
- "fee_amount_refundable": 0,
- "id": "00000000-0000-0000-0000-0000767bf5cd",
- "order": null,
- "owner": {
- "id": "be2b42e5-b808-40ae-9bbe-3291ab493f57",
- "path": "/accounts/be2b42e5-b808-40ae-9bbe-3291ab493f57",
- "resource": "accounts"
}, - "path": "/payments/00000000-0000-0000-0000-0000767bf5cd",
- "payment_method": {
- "id": "00000000-6363-0000-0000-000008b93a6e",
- "path": "/payment_methods/00000000-6363-0000-0000-000008b93a6e",
- "resource": "payment_methods"
}, - "pending_reasons": [
- {
- "details": [ ],
- "reason_code": "PENDING_CAPTURE",
- "reason_message": "Payment pending capture."
}
], - "resource": "payments",
- "status": "pending",
- "authorization_code": "0224241",
- "txnr_app_fee": null,
- "txnr_merchant": null,
- "initiated_by": "customer",
- "api_version": "3.1",
- "reference_id": "d6a60610-3a7e-4b9d-b56f-9005b9cd18ac"
}