cURL
curl "https://api.phrase.com/v2/projects/:project_id/orders/:id/confirm" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"branch":"my-feature-branch"}' \
-H 'Content-Type: application/json'phrase orders confirm \
--project_id <project_id> \
--id <id> \
--data '{"branch":"my-feature-branch"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm"
payload = { "branch": "my-feature-branch" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch: 'my-feature-branch'})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'branch' => 'my-feature-branch'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm"
payload := strings.NewReader("{\n \"branch\": \"my-feature-branch\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"my-feature-branch\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branch\": \"my-feature-branch\"\n}"
response = http.request(request)
puts response.read_body{
"id": "30AB4884",
"lsp": "gengo",
"amount_in_cents": 1152,
"currency": "usd",
"message": "Please make everything sound really nice :)",
"state": "confirmed",
"translation_type": "pro",
"progress_percent": 50,
"source_locale": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "en",
"code": "en-GB"
},
"target_locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "de",
"code": "de-DE"
},
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "fr",
"code": "fr-FR"
}
],
"tag_name": "latest-upload",
"styleguide": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"title": "My Styleguide"
},
"unverify_translations_upon_delivery": true,
"quality": true,
"priority": true,
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Orders
Confirm an order
Confirm an existing order and send it to the provider for translation. Same constraints as for create.
PATCH
/
projects
/
{project_id}
/
orders
/
{id}
/
confirm
cURL
curl "https://api.phrase.com/v2/projects/:project_id/orders/:id/confirm" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-d '{"branch":"my-feature-branch"}' \
-H 'Content-Type: application/json'phrase orders confirm \
--project_id <project_id> \
--id <id> \
--data '{"branch":"my-feature-branch"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm"
payload = { "branch": "my-feature-branch" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch: 'my-feature-branch'})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'branch' => 'my-feature-branch'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm"
payload := strings.NewReader("{\n \"branch\": \"my-feature-branch\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"my-feature-branch\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/orders/{id}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branch\": \"my-feature-branch\"\n}"
response = http.request(request)
puts response.read_body{
"id": "30AB4884",
"lsp": "gengo",
"amount_in_cents": 1152,
"currency": "usd",
"message": "Please make everything sound really nice :)",
"state": "confirmed",
"translation_type": "pro",
"progress_percent": 50,
"source_locale": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "en",
"code": "en-GB"
},
"target_locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "de",
"code": "de-DE"
},
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "fr",
"code": "fr-FR"
}
],
"tag_name": "latest-upload",
"styleguide": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"title": "My Styleguide"
},
"unverify_translations_upon_delivery": true,
"quality": true,
"priority": true,
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Authorizations
TokenBasic
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Body
application/json
specify the branch to use
Example:
"my-feature-branch"
Response
OK
Show child attributes
Show child attributes
Example:
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
Show child attributes
Show child attributes
Name of the tag whose keys are included in the order.
Show child attributes
Show child attributes
Example:
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"title": "My Style Guide"
}
Was this page helpful?
⌘I