Forward a request
/forward_requestsSends the provider's request to its destination with the placeholders filled in, and returns the provider's answer.
When the provider answers, whatever its status, the response is 200 with the provider's reply inside: read response.status for the provider's result. Before the reply comes back, Pay.com saves the cards at your response.tokenize paths and puts their token in their place, applies your response.redact paths, then masks any other card number in the body and the headers to its first six and last four digits. Saving a card that's already in your vault returns its existing token.
Pay.com doesn't follow redirects: a 3xx comes back as the provider's answer. A compressed reply is decompressed, and a reply body that isn't JSON comes back as UTF-8 text.
When Pay.com can't get an answer from the provider, the error's upstream_sent says whether the provider got the request. See Errors.
Headers
AuthorizationstringRequiredIdempotency-KeystringMakes a retry safe. A retry with the same key gets the first answer again when the first attempt reached the provider, or might have. 1 to 255 printable ASCII characters, without spaces, kept for 24 hours.
Parameters
destinationstringRequiredThe destination's id.
requestobjectRequiredThe provider's request, with placeholders for card data and stored credentials.
Show 4 child parametersHide child parameters
methodstringRequiredurlstringRequiredThe provider's full URL: https://, on the destination's host and port, under one of its path prefixes. No placeholders, user name or password.
headersobjectHeader names and string values, up to 64. Placeholders go in the values. Pay.com sets Host, Content-Length, Transfer-Encoding, Connection and the other connection headers itself, so a request that sends them is refused.
bodyobject or stringThe provider's body, with placeholders in its string values: a JSON object, sent as JSON, or a string, sent as it is, for XML or a form. A JSON object needs a JSON Content-Type, or none.
responseobjectWhat to do with card data in the provider's JSON reply. Any other card number is masked.
Show 2 child parametersHide child parameters
tokenizearray of objectsCard numbers to save as Pay.com tokens. A card that can't be saved is replaced with "[REDACTED]".
Show 3 child parametersHide child parameters
json_pathstringRequiredThe card number, such as $.card.number.
exp_monthstringRequiredThe card's expiry month, in the same reply.
exp_yearstringRequiredThe card's expiry year, in the same reply.
redactarray of stringsFields to replace with "[REDACTED]". [*] stands for every item of a list.
Returns
The provider answered. Its status, headers and body are in response.
idstringThe forward's id, also in the x-pay-com-forward-id header.
resourcestringdestinationstringThe destination's id.
responseobjectThe provider's answer.
Show 3 child attributesHide child attributes
statusintegerThe provider's HTTP status.
headersobjectThe provider's headers, without Set-Cookie, Content-Length, Content-Encoding and the connection headers.
bodyobject or stringThe provider's body: an object for JSON, a string for anything else.
tokenizedarray of objectsOne entry for each response.tokenize path.
Show 3 child attributesHide child attributes
json_pathstringThe path, as you sent it.
tokenstringThe saved card's token, now at that path.
errorstringSet instead of token when the card couldn't be saved.
timingobjectShow 2 child attributesHide child attributes
total_msintegerThe time the forward took, in milliseconds.
upstream_msintegerThe time the provider took, in milliseconds.
Errors
400401sk-pay-com-, as Basic or Bearer auth.403404tok_card_ or pm_card_ id isn't a card of your account.409Idempotency-Key hasn't been answered yet. For the second, retry after the Retry-After header's seconds.413422Idempotency-Key was used for a different request.429Retry-After header's seconds.500502503Retry-After header's seconds.504