Create a payment

post/payments

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.

SecurityappIdAuth and appTokenAuth
Request
header Parameters
Api-Version
required
string
Example: 3.0
Content-Type
required
stringapplication/json
Example: application/json
Unique-Key
required
string
Request Body schema: application/json
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: CAD & USD. Note: as of today, currency supports a single value.

Enum: Description
USD

United States Dollar

CAD

Canadian Dollar

… 1 more
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 credit_card, then the payment method's top level data object must be credit_card.

auto_capture
boolean

For payments with a credit card payment method, set to false to create a delayed-capture payment. Capture the payment within 7 days with the POST /payments/{id}/capture endpoint. Alternatively, cancel the payment with the POST /payments/{id}/cancel endpoint.

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.

initiated_by
string

Indicates who initiated a payment. Possible values include: customer, merchant, null. Note: This parameter defaults to none when creating a payment unless a credit card payment method has "card_on_file": "true". "Card on file" payments default to customer. For recurring credit card payments: this parameter should be set to customer on the first transaction, and then on subsequent recurring transactions, this parameter should be set to merchant. This parameter is not used for recurring ACH payments.

Enum: Description
customer
merchant
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 null.

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.

Responses
201
Response Schema: application/json
id
required
string [ 1 .. 255 ] characters

ID of the object or resource.

resource
required
string

Helps organize information by identifying the resource type of the object data.

Value: Description
payments
path
required
string

The HTTP path of the resource. The path can be used to retrieve details about the resource and perform actions on it.

required
object or null

Details the owner resource and owner path.

create_time
required
integer <int64> >= 0

The UNIX timestamp for when the object was created.

status
required
string
Enum: Description
pending

This payment is processing, but is not yet included in the account's available or reserve balance. Find more information in the pending_reasons structure.

completed

This payment has finished processing, and is now available in either the account's available or reserved balance. Note: A payment can have a completed status and simultaneously have a refund or dispute issued against it.

… 2 more
amount
required
integer
amount_refunded
required
integer
amount_disputed
required
integer
currency
required
string

ISO 4217 currency code. Possible values include: CAD & USD. Note: as of today, currency supports a single value.

Enum: Description
USD

United States Dollar

CAD

Canadian Dollar

… 1 more
required
object
reference_id
required
string or null [ 1 .. 255 ] characters

A custom reference ID for your platform to track the object. It can be any string.

capture_at
required
integer or null <int64> >= 0
authorization_code
required
string or null

Authorization code returned from the card issuer after a credit card payment is authorized

api_version
string
auto_capture
boolean
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.

object or null
fee_amount
integer
fee_amount_refundable
integer
initiated_by
string

Indicates who initiated a payment. Possible values include: customer, merchant, none.

Enum: Description
customer
merchant
… 1 more
object or null

The resource ID and path for the Order that your app created and associated with the payment.

Array of objects or null
object or null

THIS SHOULD NOT SHOW UP

object or null

THIS SHOULD NOT SHOW UP

400

INVALID_PARAMS, MERCHANT_ACCOUNT_CANNOT_ACCEPT_PAYMENTS, TRANSACTION_DECLINED, UNSUPPORTED_CURRENCY

403

NOT_AUTHORIZED

500

UNEXPECTED_ERROR

Request samples
application/json
{
  • "amount": 100,
  • "currency": "USD",
  • "account_id": "{{account_v3_id}}",
  • "payment_method": {
    • "apple_pay": {
      • "payment_method_data": "eyJ0b2tlbiI6eyJwYXltZW50RGF0YSI6eyJkYXRhIjoiZC9IOW56U0xWTmtvVnd0SmYwOGJaL2tHazUvN3N4bHNzZTliVFZMc0JqQ0kzNmpxMkQwcy8wRi9MeXNLM2IwTWQ3OFZIOEpOQW1DUkRwUzVEU0xzajI1cVRPR0hNVzFFZzAxdXlpVUovTGt3Q3ZJQ3Jtd25ud2Vla3dCSWY1bEVqUVdvMTl2QjFjNGdEczBNNWQyQThKS0cva2FGSDRSTzhlUk1ESjdCK2NIU2RnV2J5QzJRQW84WnlzLzVua0F3L2QzcG54d2IwQ1prNmxYL0Y5Y1ZXQktOMU9PMFRPMmRPN1pyYTJxQTAxT1RxZlhMQ3k2TE9FNkUxbDNzZ3NIcnpHVUNuVWxTZ3UydnFleDNQTGpQN1lBNnNoUnNXb1JGTWFqUlZ0WGJ5aE40dTg1RnhXTlozYXYxdWxFc241VWd6T1NNTFNsQ2hscElNZmV3OVZGS3pSa21KcktDNW5mNXlTaUQ2Mm5pVElkTDh3RW50S2E2WW1WNDBqWDNBOVFMMXRQamp3Y3ZDa1ZNL0tCK3dVTitGak5NWUFOMjdRRko3YTdBWUNzc1pnPT0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK013Z2dPSW9BTUNBUUlDQ0V3d1FVbFJuVlEyTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0J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OXlhWFI1TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVd0lJVERCQlNWR2RWRFl3Q3dZSllJWklBV1VEQkFJQm9JR1RNQmdHQ1NxR1NJYjNEUUVKQXpFTEJna3Foa2lHOXcwQkJ3RXdIQVlKS29aSWh2Y05BUWtGTVE4WERUSXlNRGN5TWpBMU5UazFNMW93S0FZSktvWklodmNOQVFrME1Sc3dHVEFMQmdsZ2hrZ0JaUU1FQWdHaENnWUlLb1pJemowRUF3SXdMd1lKS29aSWh2Y05BUWtFTVNJRUlIQjh4YTJzeXhDS3MwemVQeUM3aW5uOXo4cnpFOG5NREgzbHlCV2Y4STArTUFvR0NDcUdTTTQ5QkFNQ0JFZ3dSZ0loQUxDUXVoTDZ3TnNmR0VsSUR1TzdPUWRZLzg2OGU4WW9XOVZWWlhVRDNleDNBaUVBcE0rUGU5TmxCVXZDOUtEWndiOU9lSUVSc0RoYjQ0UUMxT2x6U3VnYlRYWUFBQUFBQUFBPSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoiM29vRFc2OE1JSzY4WjV0bDhmM3RXUFlhVGd2TVJVZFB0eUxPOW02VlFrdz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVUd1UyNzgyejlRSm4xcHpwL044L3JYanErejhwSksvWTNZY1ZiY0VURXF6d2RiZTlUQnRhd0dDSjBZZlR1Mnd4d2FCNkowdUlweEsvbEZuaGxGa09yQT09IiwidHJhbnNhY3Rpb25JZCI6IjE1MjcyYmVhOGQ2M2YyZWM4MjcwZmIzZWVjMjNiYTg3ZTQ0NTViZDczN2U1MDhkMjVhYmU5YjI3NDA2NTM1NW",
      • "card_holder": {
        • "holder_name": "Card Holder Name",
        • "email": "example@wepay.com",
        • "address": {
          • "country": "US",
          • "postal_code": "94043"
          }
        }
      },
    • "type": "apple_pay"
    },
  • "custom_data": {
    • "my_key": "invoice #54321"
    }
}
Response samples
application/json
No sample