Process Payment
API Reference
Once you’ve identified an invoice that supports card spend, you can process the payment triggering a processing job with the invoice document and details of the card to be used for the payment.
Provide Card Details
To provide the virtual card details to the Virtual Card Agent, you need to generate the virtual card with your issuing partner, and then provide the card details to the Virtual Card Agent.
iFrame Card Details
The simplest way to provide the card details is to use an iFrame link. This will allow the Virtual Card Agent to navigate to the iFrame link and view the card details without exposing the card details directly.
The iFrame link should render just the card details and nothing else (card number, expiration date, CVV, etc.), and all authentication should be handled by the iFrame link using url parameters.
Native Integrations
Mercoa supports native integrations with the following issuing partners:
We are working on adding support for more issuing partners, and you can request support for your issuing partner by contacting us at support@mercoa.com.
Direct Card Details
We recommend that you provide card details via an iFrame link or native integration rather than directly in the request body to avoid exposing sensitive data.
Job Pending State
During payment processing:
- The agent navigates to the vendor’s payment portal
- Enters the provided card information
- Completes the payment transaction
- Captures the payment receipt
- Returns the payment confirmation
Upon successful completion, the result of the processing job will contain the following information:
- The receipt URL for the payment
- A session replay link to review the agent’s actions
If the agent is unable to process the payment, no funds will be moved and the result will contain a descriptive error message explaining what went wrong.
Job Completed Webhook
Success Response
Failure Response
Response Fields
Webhooks
Mercoa sends webhook notifications when Virtual Card Agent processing jobs complete. You can configure these webhooks in the Mercoa Developer Portal.
Processing Job Completed
When a Virtual Card Agent processing job completes (either successfully or with an error), a webhook with the event type paymentGateway.process.completed
is sent to your configured webhook endpoint.
Webhook Payload:
Error Handling
If a job fails, the webhook will include error information in the response:
For more information about webhooks, see our Webhooks documentation.