Skip to main content
PUT
/
apple-pay-certificates
/
{apple_pay_certificate_id}
Update Apple Pay certificate
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("Authorization", "Bearer <token>");
request.FormBoundary = "---011000010111000001101001";
request.AddFile("file", "example-file");
var response = await client.PutAsync(request);

Console.WriteLine("{0}", response.Content);
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id}"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id}"

files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}

response = requests.put(url, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('file', '<string>');

const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request PUT \
--url https://api.sandbox.{id}.gr4vy.app/apple-pay-certificates/{apple_pay_certificate_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'
{
  "type": "anti-fraud-service",
  "id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
  "merchant_account_id": "default",
  "anti_fraud_service_definition_id": "sift-anti-fraud",
  "display_name": "Sift Anti-Fraud Service.",
  "active": true,
  "silent": false,
  "reviews_enabled": false,
  "fields": [
    {
      "key": "approve_decision",
      "value": "sk_test_26PHem9AhJZvU623DfE1x4sd"
    }
  ],
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "updated_at": "2013-07-16T19:23:00.000+00:00"
}
{
"type": "error",
"code": "bad_request",
"status": 400,
"message": "Missing '****' field",
"details": [
{
"location": "body",
"type": "value_error.missing",
"pointer": "/payment_method/number",
"message": "field required"
}
]
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"details": []
}
{
"type": "error",
"code": "not_found",
"status": 404,
"message": "The resource could not be found",
"details": []
}
This endpoint requires the apple-pay-certificates.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

apple_pay_certificate_id
string<uuid>
required

The unique ID for an Apple Pay certificate record.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

Body

multipart/form-data
file
file

The payment processing certificate received from Apple. This file should be associated with the Certificate Signing Request of this record, have a valid expiration date, and be DER encoded.

Response

Returns the Apple Pay certificate record that was updated.

type
enum<string>

The type of this resource. Is always anti-fraud-service.

Available options:
anti-fraud-service
Example:

"anti-fraud-service"

id
string<uuid>

The unique Gr4vy ID for this anti-fraud service.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

merchant_account_id
string

The unique ID for a merchant account.

Example:

"default"

anti_fraud_service_definition_id
enum<string>

The name of the Anti-Fraud service provider. During update request, this value is used for validation only but the underlying service can not be changed for an existing service.

Available options:
cybersource-anti-fraud,
forter-anti-fraud,
sift-anti-fraud
Example:

"sift-anti-fraud"

display_name
string | null

A unique name for this anti-fraud service which is used in the Gr4vy admin panel to give a anti-fraud service a human readable name.

Required string length: 1 - 200
Example:

"Sift Anti-Fraud Service."

active
boolean
default:true

Defines if this service is currently active or not.

Example:

true

silent
boolean
default:false

Defines if this service is currently running in silent mode. In silent mode, a service's decisions will be created but ignored when processing a transaction, allowing for warm-up and comparison of new services against the active service.

Example:

false

reviews_enabled
boolean
default:false

Defines if this service needs to handle the review status with a proper review workflow. If not, the review status will be treated as any other one.

Example:

false

fields
object[]

A list of fields, each containing a key-value pair for anti-fraud service decision mapping e.g. for Sift approve_decision will be in the response.

created_at
string<date-time>

The date and time when this anti-fraud service was created in our system.

Example:

"2013-07-16T19:23:00.000+00:00"

updated_at
string<date-time>

The date and time when this anti-fraud service was last updated in our system.

Example:

"2013-07-16T19:23:00.000+00:00"